コード例 #1
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT,
              stat=default_stat, listdir=os.listdir):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._snapshot = None
     self._lock = threading.Lock()
     self._take_snapshot = lambda: DirectorySnapshot(
         self.watch.path, self.watch.is_recursive, stat=stat, listdir=listdir)
コード例 #2
0
    def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
        EventEmitter.__init__(self, event_queue, watch, timeout)

        self._kq = select.kqueue()
        self._lock = threading.RLock()

        # A collection of KeventDescriptor.
        self._descriptors = KeventDescriptorSet()

        def walker_callback(path, stat_info, self=self):
            self._register_kevent(path, stat.S_ISDIR(stat_info.st_mode))

        self._snapshot = DirectorySnapshot(watch.path, watch.is_recursive,
                                           walker_callback)
コード例 #3
0
ファイル: kqueue.py プロジェクト: LucaBongiorni/MITMf
    def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
        EventEmitter.__init__(self, event_queue, watch, timeout)

        self._kq = select.kqueue()
        self._lock = threading.RLock()

        # A collection of KeventDescriptor.
        self._descriptors = KeventDescriptorSet()

        def walker_callback(path, stat_info, self=self):
            self._register_kevent(path, stat.S_ISDIR(stat_info.st_mode))

        self._snapshot = DirectorySnapshot(watch.path,
                                           watch.is_recursive,
                                           walker_callback)
コード例 #4
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._fsevents = FSEventsQueue(watch.path)
     self._fsevents.start()
コード例 #5
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._handle = None
コード例 #6
0
ファイル: fsevents.py プロジェクト: LucaBongiorni/MITMf
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self.snapshot = DirectorySnapshot(watch.path, watch.is_recursive)
コード例 #7
0
ファイル: inotify.py プロジェクト: LucaBongiorni/MITMf
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._inotify = None
コード例 #8
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self.snapshot = DirectorySnapshot(watch.path, watch.is_recursive)