本文整理匯總了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()