def create_file_watcher(pl, watcher_type=u'auto', expire_time=10):
 if (watcher_type == u'stat'):
  pl.debug(u'Using requested stat-based watcher', prefix=u'watcher')
  return StatFileWatcher()
 if (watcher_type == u'inotify'):
  pl.debug(u'Using requested inotify watcher', prefix=u'watcher')
  return INotifyFileWatcher(expire_time=expire_time)
 elif (watcher_type == u'uv'):
  pl.debug(u'Using requested uv watcher', prefix=u'watcher')
  return UvFileWatcher()
 if sys.platform.startswith(u'linux'):
  try:
   pl.debug(u'Trying to use inotify watcher', prefix=u'watcher')
   return INotifyFileWatcher(expire_time=expire_time)
  except INotifyError:
   pl.info(u'Failed to create inotify watcher', prefix=u'watcher')
 try:
  pl.debug(u'Using libuv-based watcher')
  return UvFileWatcher()
 except UvNotFound:
  pl.debug(u'Failed to import pyuv')
 pl.debug(u'Using stat-based watcher')
 return StatFileWatcher()

def create_file_watcher ( pl , watcher_type = u'auto' , expire_time = 10 ) : if ( watcher_type == u'stat' ) : pl . debug ( u'Using requested stat-based watcher' , prefix = u'watcher' ) return StatFileWatcher ( ) if ( watcher_type == u'inotify' ) : pl . debug ( u'Using requested inotify watcher' , prefix = u'watcher' ) return INotifyFileWatcher ( expire_time = expire_time ) elif ( watcher_type == u'uv' ) : pl . debug ( u'Using requested uv watcher' , prefix = u'watcher' ) return UvFileWatcher ( ) if sys . platform . startswith ( u'linux' ) : try : pl . debug ( u'Trying to use inotify watcher' , prefix = u'watcher' ) return INotifyFileWatcher ( expire_time = expire_time ) except INotifyError : pl . info ( u'Failed to create inotify watcher' , prefix = u'watcher' ) try : pl . debug ( u'Using libuv-based watcher' ) return UvFileWatcher ( ) except UvNotFound : pl . debug ( u'Failed to import pyuv' ) pl . debug ( u'Using stat-based watcher' ) return StatFileWatcher ( )
create an object that can watch for changes to specified files use .