本文整理汇总了Python中watchdog.observers.api.EventEmitter.queue_event方法的典型用法代码示例。如果您正苦于以下问题:Python EventEmitter.queue_event方法的具体用法?Python EventEmitter.queue_event怎么用?Python EventEmitter.queue_event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类watchdog.observers.api.EventEmitter
的用法示例。
在下文中一共展示了EventEmitter.queue_event方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: queue_event
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import queue_event [as 别名]
def queue_event(self, event):
EventEmitter.queue_event(self, event)
if event.event_type == EVENT_TYPE_CREATED:
self._register_kevent(event.src_path, event.is_directory)
elif event.event_type == EVENT_TYPE_MOVED:
self._unregister_kevent(event.src_path)
self._register_kevent(event.dest_path, event.is_directory)
elif event.event_type == EVENT_TYPE_DELETED:
self._unregister_kevent(event.src_path)
示例2: queue_event
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import queue_event [as 别名]
def queue_event(self, event):
"""
Handles queueing a single event object.
:param event:
An instance of :class:`watchdog.events.FileSystemEvent`
or a subclass.
"""
# Handles all the book keeping for queued events.
# We do not need to fire moved/deleted events for all subitems in
# a directory tree here, because this function is called by kqueue
# for all those events anyway.
EventEmitter.queue_event(self, event)
if event.event_type == EVENT_TYPE_CREATED:
self._register_kevent(event.src_path, event.is_directory)
elif event.event_type == EVENT_TYPE_MOVED:
self._unregister_kevent(event.src_path)
self._register_kevent(event.dest_path, event.is_directory)
elif event.event_type == EVENT_TYPE_DELETED:
self._unregister_kevent(event.src_path)
示例3: test___init__
# 需要导入模块: from watchdog.observers.api import EventEmitter [as 别名]
# 或者: from watchdog.observers.api.EventEmitter import queue_event [as 别名]
def test___init__(self):
event_queue = EventQueue()
watch = ObservedWatch('/foobar', True)
event_emitter = EventEmitter(event_queue, watch, timeout=1)
event_emitter.queue_event(FileModifiedEvent('/foobar/blah'))