def watch_file(inputfile, timeline_handler):
# log handler does not load on detecting the initial file
timeline_handler.load(inputfile)
event_handler = LogHandler(inputfile, timeline_handler)
observer = Observer()
observer.schedule(event_handler,
os.path.dirname(os.path.abspath(inputfile)))
observer.start()
yield
observer.stop()
observer.join()
评论列表
文章目录