當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。