45 lines
1.1 KiB
Python
45 lines
1.1 KiB
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)
|
|
|
|
Log.v(str(data))
|
|
path = data['DETECTION']['watchdogPath']
|
|
|
|
|
|
Log.v("""
|
|
|
|
o o 8
|
|
8b 8 8
|
|
8`b 8 .oPYo. o o .oPYo. 8
|
|
8 `b 8 8 8 Y. .P 8oooo8 8
|
|
8 `b8 8 8 `b..d' 8. 8
|
|
8 `8 `YooP' `YP' `Yooo' 8
|
|
..:::..:.....:::...:::.....:..
|
|
::::::::::::::::::::::::::::::
|
|
|
|
Product - ANTI-ABUSE
|
|
Release - {}
|
|
License - GNU GENERAL PUBLIC LICENSE, Version 3
|
|
|
|
""".format(data['ver']))
|
|
#endregion
|
|
|
|
if __name__ == "__main__":
|
|
with DirWatcher(path, interval=1) as watcher:
|
|
watcher.run()
|
|
|
|
Log.s(data['LANGUGAE']['english']['novelStarted'].format(str(round(time.time() - t, 1))))
|
|
try:
|
|
while True:
|
|
time.sleep(1)
|
|
except KeyboardInterrupt:
|
|
exit()
|