add first version of dps.report uploader

This commit is contained in:
Stefan Regnery 2019-01-19 01:07:19 +01:00
parent 27d1800e27
commit 1d17bac3da

View File

@ -0,0 +1,32 @@
#!/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()