add first version of dps.report uploader
This commit is contained in:
parent
27d1800e27
commit
1d17bac3da
32
dps.report-uploader/uploader.py
Normal file
32
dps.report-uploader/uploader.py
Normal 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()
|
||||||
Loading…
Reference in New Issue
Block a user