Ejemplo n.º 1
0
 def __init__(self, stat, listdir, polling_interval=1):
     """
     :param stat: stat function. See ``os.stat`` for details.
     :param listdir: listdir function. See ``os.listdir`` for details.
     :type polling_interval: float
     :param polling_interval: interval in seconds between polling the file system.
     """
     emitter_cls = partial(PollingEmitter, stat=stat, listdir=listdir)
     BaseObserver.__init__(self, emitter_class=emitter_cls, timeout=polling_interval)
Ejemplo n.º 2
0
 def __init__(self,
              timeout=DEFAULT_OBSERVER_TIMEOUT,
              generate_full_events=False):
     if (generate_full_events):
         BaseObserver.__init__(self,
                               emitter_class=InotifyFullEmitter,
                               timeout=timeout)
     else:
         BaseObserver.__init__(self,
                               emitter_class=InotifyEmitter,
                               timeout=timeout)
Ejemplo n.º 3
0
    def __init__(self, path, force_polling=False, **kwargs):
        """Create observer for the directory at `path`."""
        if force_polling:
            observer_class = PollingObserver
        else:
            observer_class = Observer

        self.root_observer = observer_class(**kwargs)

        # get proper emitter class from root_observer instance of observer_class
        BaseObserver.__init__(
            self, emitter_class=self.root_observer._emitter_class, **kwargs
        )
        # initialize as an event handler as well for handling the root observer events
        RegexMatchingEventHandler.__init__(self)

        self.path = os.path.abspath(path)
        self.root_watch = None
        self._stopped_handlers = dict()
Ejemplo n.º 4
0
    def __init__(self, path, force_polling=False, **kwargs):
        """Create observer for the directory at `path`."""
        if force_polling:
            observer_class = PollingObserver
        else:
            observer_class = Observer

        self.root_observer = observer_class(**kwargs)

        # get proper emitter class from root_observer instance of observer_class
        BaseObserver.__init__(self,
                              emitter_class=self.root_observer._emitter_class,
                              **kwargs)
        # replace default event queue with ordered set queue to disallow
        # duplicate events even if added out of order
        self._event_queue = OrderedSetQueue()
        RegexMatchingEventHandler.__init__(self)

        self.path = os.path.abspath(path)
        self.root_watch = None
        self._stopped_handlers = dict()
        self._dispatching_enabled = True
Ejemplo n.º 5
0
 def __init__(self, timeout=1):
     BaseObserver.__init__(self,
                           emitter_class=WatcherPollingEmitter,
                           timeout=timeout)
Ejemplo n.º 6
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self, emitter_class=PollingEmitterWithState, timeout=timeout)
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self, emitter_class=WindowsApiAsyncEmitter,
                           timeout=timeout)
Ejemplo n.º 8
0
 def __init__(self, make_snapshot, polling_interval=1):
   constructor = partial(Poller, make_snapshot=make_snapshot)
   BaseObserver.__init__(self, constructor, polling_interval)
Ejemplo n.º 9
0
 def __init__(self, stat, listdir, polling_interval=1):
    
     emitter_cls = partial(PollingEmitter, stat=stat, listdir=listdir)
     BaseObserver.__init__(self, emitter_class=emitter_cls, timeout=polling_interval)
Ejemplo n.º 10
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT, generate_full_events=False):
     if (generate_full_events):
         BaseObserver.__init__(self, emitter_class=InotifyFullEmitter, timeout=timeout)
     else:
         BaseObserver.__init__(self, emitter_class=InotifyEmitter,
                           timeout=timeout)
Ejemplo n.º 11
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=WindowsApiAsyncEmitter,
                           timeout=timeout)
Ejemplo n.º 12
0
 def __init__(self):
     BaseObserver.__init__(self, None)
Ejemplo n.º 13
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self, emitter_class=MistWatchdogPollingEmitter, timeout=timeout)
Ejemplo n.º 14
0
 def __init__(self, stat, listdir, polling_interval = 1):
     emitter_cls = partial(PollingEmitter, stat=stat, listdir=listdir)
     BaseObserver.__init__(self, emitter_class=emitter_cls, timeout=polling_interval)
Ejemplo n.º 15
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=KqueueEmitter,
                           timeout=timeout)
Ejemplo n.º 16
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=MistWatchdogPollingEmitter,
                           timeout=timeout)
Ejemplo n.º 17
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
   BaseObserver.__init__(self, emitter_class=InotifyEmitter,
                         timeout=timeout)
Ejemplo n.º 18
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(
         self,
         timeout=timeout,
         emitter_class=GeventEmitter,
     )