本文整理汇总了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()
示例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))
示例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()
示例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()