33 lines
820 B
Python
33 lines
820 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
import time
|
|
|
|
from pathlib import Path
|
|
from watchdog.observers import Observer
|
|
from watchdog.events import PatternMatchingEventHandler
|
|
|
|
|
|
class FileWatchdog(PatternMatchingEventHandler):
|
|
def __init__(self, file_pattern):
|
|
super(FileWatchdog, self).__init__(patterns=[file_pattern], ignore_directories=True)
|
|
self.pattern = file_pattern
|
|
|
|
def on_created(self, event):
|
|
print(event.src_path)
|
|
|
|
|
|
def main():
|
|
watch_path = os.path.join(Path.home(), "Documents", "Guild Wars 2", "addons", "arcdps", "arcdps.cbtlogs")
|
|
file_pattern = os.path.join("*.zevtc")
|
|
|
|
|
|
observer = Observer()
|
|
observer.schedule(FileWatchdog(file_pattern), watch_path, recursive=True)
|
|
observer.start()
|
|
|
|
while True:
|
|
time.sleep(1)
|
|
|
|
if __name__ =='__main__':
|
|
main()
|