Example #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)
Example #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)
Example #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()
Example #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
Example #5
0
 def __init__(self, timeout=1):
     BaseObserver.__init__(self,
                           emitter_class=WatcherPollingEmitter,
                           timeout=timeout)
Example #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)
Example #8
0
 def __init__(self, make_snapshot, polling_interval=1):
   constructor = partial(Poller, make_snapshot=make_snapshot)
   BaseObserver.__init__(self, constructor, polling_interval)
Example #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)
Example #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)
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=WindowsApiAsyncEmitter,
                           timeout=timeout)
Example #12
0
 def __init__(self):
     BaseObserver.__init__(self, None)
Example #13
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self, emitter_class=MistWatchdogPollingEmitter, timeout=timeout)
Example #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)
Example #15
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=KqueueEmitter,
                           timeout=timeout)
Example #16
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(self,
                           emitter_class=MistWatchdogPollingEmitter,
                           timeout=timeout)
Example #17
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
   BaseObserver.__init__(self, emitter_class=InotifyEmitter,
                         timeout=timeout)
Example #18
0
 def __init__(self, timeout=DEFAULT_OBSERVER_TIMEOUT):
     BaseObserver.__init__(
         self,
         timeout=timeout,
         emitter_class=GeventEmitter,
     )