anti-abuse/main.py

45 lines
1.1 KiB
Python
Raw Normal View History

2025-03-23 19:03:28 +01:00
#region Imports
import time, os, tomllib
2025-03-24 18:03:56 +00:00
from utils.Logger import Log
from utils.WatchdogHandler import DirWatcher
2025-03-24 20:07:14 +00:00
#endregion
2025-03-23 19:03:28 +01:00
#region Initialize
t = time.time()
with open("config.toml", "rb") as f:
data = tomllib.load(f)
2025-03-24 20:07:14 +00:00
Log.v(str(data))
2025-03-23 19:03:28 +01:00
path = data['DETECTION']['watchdogPath']
Log.v("""
2025-03-24 20:07:14 +00:00
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
2025-03-23 19:03:28 +01:00
""".format(data['ver']))
#endregion
if __name__ == "__main__":
2025-03-24 18:03:56 +00:00
with DirWatcher(path, interval=1) as watcher:
watcher.run()
2025-03-24 20:07:14 +00:00
Log.s(data['LANGUGAE']['english']['novelStarted'].format(str(round(time.time() - t, 1))))
2025-03-23 19:03:28 +01:00
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
2025-03-24 18:03:56 +00:00
exit()