def get_file_watcher(directories, use_mtime_file_watcher):
 assert (not isinstance(directories, types.StringTypes)), 'expected list got str'
 if (len(directories) != 1):
  return _MultipleFileWatcher(directories, use_mtime_file_watcher)
 directory = directories[0]
 if use_mtime_file_watcher:
  return mtime_file_watcher.MtimeFileWatcher(directory)
 elif sys.platform.startswith('linux'):
  return inotify_file_watcher.InotifyFileWatcher(directory)
 elif sys.platform.startswith('win'):
  return win32_file_watcher.Win32FileWatcher(directory)
 return mtime_file_watcher.MtimeFileWatcher(directory)

def get_file_watcher ( directories , use_mtime_file_watcher ) : assert ( not isinstance ( directories , types . StringTypes ) ) , 'expected list got str' if ( len ( directories ) != 1 ) : return _MultipleFileWatcher ( directories , use_mtime_file_watcher ) directory = directories [ 0 ] if use_mtime_file_watcher : return mtime_file_watcher . MtimeFileWatcher ( directory ) elif sys . platform . startswith ( 'linux' ) : return inotify_file_watcher . InotifyFileWatcher ( directory ) elif sys . platform . startswith ( 'win' ) : return win32_file_watcher . Win32FileWatcher ( directory ) return mtime_file_watcher . MtimeFileWatcher ( directory )
returns an instance that monitors a hierarchy of directories .