本文整理汇总了Python中watchdog.observers.api.EventEmitter.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python EventEmitter.__init__方法的具体用法?Python EventEmitter.__init__怎么用?Python EventEmitter.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类watchdog.observers.api.EventEmitter
的用法示例。
在下文中一共展示了EventEmitter.__init__方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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
示例4: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例5: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例6: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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()
示例7: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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()
示例9: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例10: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
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)
示例11: __init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import __init__ [as 别名]
def __init__(self, event_queue, watch, timeout=1):
EventEmitter.__init__(self, event_queue, watch, timeout)
self._snapshot = None