当前位置: 首页>>代码示例>>Python>>正文


Python EventEmitter.queue_event方法代码示例

本文整理汇总了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)
开发者ID:connoryang,项目名称:dec-eve-serenity,代码行数:11,代码来源:kqueue.py

示例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)
开发者ID:Witos,项目名称:watchdog,代码行数:22,代码来源:kqueue.py

示例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'))
开发者ID:edevil,项目名称:watchdog,代码行数:7,代码来源:test_watchdog_observers_api.py


注:本文中的watchdog.observers.api.EventEmitter.queue_event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。