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


Python events.LoggingEventHandler方法代码示例

本文整理汇总了Python中watchdog.events.LoggingEventHandler方法的典型用法代码示例。如果您正苦于以下问题:Python events.LoggingEventHandler方法的具体用法?Python events.LoggingEventHandler怎么用?Python events.LoggingEventHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在watchdog.events的用法示例。


在下文中一共展示了events.LoggingEventHandler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mod_change_detected

# 需要导入模块: from watchdog import events [as 别名]
# 或者: from watchdog.events import LoggingEventHandler [as 别名]
def mod_change_detected(self):
        return LoggingEventHandler() 
开发者ID:tenstone,项目名称:kim-voice-assistant,代码行数:4,代码来源:brain.py

示例2: __init__

# 需要导入模块: from watchdog import events [as 别名]
# 或者: from watchdog.events import LoggingEventHandler [as 别名]
def __init__(self):
        event_handler = LoggingEventHandler()
        self.observer = Observer()
        self.observer.schedule(event_handler, ts3lib.getConfigPath(), recursive=True)
        self.observer.start()
        try:
            while True:
                time.sleep(1)
        except KeyboardInterrupt:
            self.observer.stop()
            self.observer.join()
        if PluginHost.cfg.getboolean("general", "verbose"): ts3lib.printMessageToCurrentTab("{0}[color=orange]{1}[/color] Plugin for pyTSon by [url=https://github.com/{2}]{2}[/url] loaded.".format(timestamp(), self.name, self.author)) 
开发者ID:Bluscream,项目名称:pyTSon_plugins,代码行数:14,代码来源:__init__.py

示例3: main

# 需要导入模块: from watchdog import events [as 别名]
# 或者: from watchdog.events import LoggingEventHandler [as 别名]
def main():
  logging.basicConfig(level=logging.INFO,
                      format='%(asctime)s - %(message)s',
                      datefmt='%Y-%m-%d %H:%M:%S')
  path = raw_input("What is the path of the directory (and all files recursively) you wish to monitor: ")
  event_handler = LoggingEventHandler()
  observer = Observer()
  observer.schedule(event_handler, path, recursive=True)
  observer.start()
  try:
    while True:
      time.sleep(1)
  except KeyboardInterrupt:
    observer.stop()
  observer.join() 
开发者ID:ahhh,项目名称:SPSE,代码行数:17,代码来源:monitor_directory.py

示例4: main

# 需要导入模块: from watchdog import events [as 别名]
# 或者: from watchdog.events import LoggingEventHandler [as 别名]
def main():
    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)s - %(message)s',
                        datefmt='%Y-%m-%d %H:%M:%S')

    (options, args) = parse_options()

    port = options.port
    assets_path = options.path
    file_prefix = options.prefix
    host_address = options.host_address

    csv.register_dialect('custom_delimiter', delimiter=options.delimiter)

    card_renderer = CardRenderer(assets_path, file_prefix)

    observer = Observer()
    observer.schedule(LoggingEventHandler(), assets_path, recursive=True)
    observer.schedule(RenderingEventHandler(card_renderer), assets_path, recursive=True)

    card_renderer.render_cards()

    observer.start()

    server = Server()
    server.watch(card_renderer.all_cards_rendered_path)
    server.serve(root=assets_path, port=port, host=host_address)

    observer.stop()
    observer.join() 
开发者ID:ghostsquad,项目名称:pycard,代码行数:32,代码来源:pycard.py


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