35 lines
792 B
Python
35 lines
792 B
Python
#region Imports
|
|
import time, os, tomllib
|
|
|
|
from utils.Logger import Log
|
|
from utils.WatchdogHandler import DirWatcher
|
|
#endregion
|
|
|
|
#region Initialize
|
|
t = time.time()
|
|
with open("config.toml", "rb") as f:
|
|
data = tomllib.load(f)
|
|
|
|
path = data['DETECTION']['watchdogPath']
|
|
|
|
|
|
Log.v("""
|
|
____ ____
|
|
/ __ \\____ _/ __ \\____ ______
|
|
/ /_/ / __ `/ / / / __ `/ ___/
|
|
/ _, _/ /_/ / /_/ / /_/ / /
|
|
/_/ |_|\\__,_/_____/\\__,_/_/ (ver. {})
|
|
""".format(data['ver']))
|
|
#endregion
|
|
|
|
if __name__ == "__main__":
|
|
with DirWatcher(path, interval=1) as watcher:
|
|
watcher.run()
|
|
|
|
Log.s(data['LANGUGAE']['english']['radarStarted'].format(str(round(time.time() - t, 1))))
|
|
try:
|
|
while True:
|
|
time.sleep(1)
|
|
except KeyboardInterrupt:
|
|
exit()
|