Exemplo n.º 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)
Exemplo n.º 2
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self.wm = pyinotify.WatchManager()
     self.notifier = pyinotify.Notifier(self.wm, InotifyEventHandler(emitter=self))
     self.wm.add_watch(watch.path, mask, rec=watch.is_recursive)
     self.stopped = threading.Event()
     self.path = watch.path
Exemplo n.º 3
0
    def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
      EventEmitter.__init__(self, event_queue, watch, timeout)
      self._lock = threading.Lock()

      self._directory_handle = get_directory_handle(watch.path,
                                                    WATCHDOG_FILE_FLAGS)
      self._buffer = ctypes.create_string_buffer(BUFFER_SIZE)
Exemplo n.º 4
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()
        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)
Exemplo n.º 5
0
    def __init__(self,
                 event_queue,
                 watch,
                 timeout=DEFAULT_EMITTER_TIMEOUT,
                 stat=default_stat):
        EventEmitter.__init__(self, event_queue, watch, timeout)

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

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

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

        self._snapshot = DirectorySnapshot(watch.path,
                                           recursive=watch.is_recursive,
                                           stat=custom_stat)
Exemplo n.º 6
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._snapshot = DirectorySnapshot(watch.path, watch.is_recursive)
     self._lock = threading.Lock()
Exemplo n.º 7
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()
Exemplo n.º 8
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._inotify = None
Exemplo n.º 9
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()
Exemplo n.º 10
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
Exemplo n.º 11
0
 def __init__(self, event_queue, watch, timeout = DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._directory_handle = get_directory_handle(watch.path, WATCHDOG_FILE_FLAGS)
     self._buffer = ctypes.create_string_buffer(BUFFER_SIZE)
Exemplo n.º 12
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._inotify = Inotify(watch.path, watch.is_recursive)
Exemplo n.º 13
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)
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._handle = get_directory_handle(watch.path)
Exemplo n.º 15
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._lock = threading.Lock()
     self._handle = get_directory_handle(watch.path)
Exemplo n.º 16
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._snapshot = DirectorySnapshot(watch.path, watch.is_recursive)
     self._lock = threading.Lock()
Exemplo n.º 17
0
 def __init__(self, event_queue, watch, timeout=1):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._snapshot = None
Exemplo n.º 18
0
 def __init__(self, event_queue, watch, make_snapshot, timeout):
   EventEmitter.__init__(self, event_queue, watch, timeout)
   self._make_snapshot = make_snapshot
   self._snapshot = make_snapshot(self.watch.path)
Exemplo n.º 19
0
 def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT):
   EventEmitter.__init__(self, event_queue, watch, timeout)
   self._lock = threading.Lock()
   self._inotify = Inotify(watch.path, watch.is_recursive)
Exemplo n.º 20
0
 def __init__(self, event_queue, watch, timeout=1):
     EventEmitter.__init__(self, event_queue, watch, timeout)
     self._snapshot = None