|
|
@ -2,6 +2,7 @@
|
|
|
|
import os.path
|
|
|
|
import os.path
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
|
|
|
|
import signal
|
|
|
|
|
|
|
|
|
|
|
|
import click
|
|
|
|
import click
|
|
|
|
import schedule
|
|
|
|
import schedule
|
|
|
@ -701,13 +702,19 @@ def init_notifications():
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Handles exit signals, cancels jobs and exits cleanly
|
|
|
|
|
|
|
|
def exit_handler(signum, frame):
|
|
|
|
|
|
|
|
log.info(f"Received {signal.Signals(signum).name}, canceling jobs and exiting.")
|
|
|
|
|
|
|
|
schedule.clear()
|
|
|
|
|
|
|
|
exit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
############################################################
|
|
|
|
############################################################
|
|
|
|
# MAIN
|
|
|
|
# MAIN
|
|
|
|
############################################################
|
|
|
|
############################################################
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
if __name__ == "__main__":
|
|
|
|
print("""
|
|
|
|
print("""
|
|
|
|
|
|
|
|
|
|
|
|
,--. ,--. ,--.
|
|
|
|
,--. ,--. ,--.
|
|
|
|
,-' '-.,--.--. ,--,--.| |,-.,-' '-. ,--,--.,--.--.,--.--.
|
|
|
|
,-' '-.,--.--. ,--,--.| |,-.,-' '-. ,--,--.,--.--.,--.--.
|
|
|
|
'-. .-'| .--'' ,-. || /'-. .-'' ,-. || .--'| .--'
|
|
|
|
'-. .-'| .--'' ,-. || /'-. .-'' ,-. || .--'| .--'
|
|
|
@ -723,4 +730,10 @@ if __name__ == "__main__":
|
|
|
|
# GNU General Public License v3.0 #
|
|
|
|
# GNU General Public License v3.0 #
|
|
|
|
#########################################################################
|
|
|
|
#########################################################################
|
|
|
|
""")
|
|
|
|
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Register the signal handlers
|
|
|
|
|
|
|
|
signal.signal(signal.SIGTERM, exit_handler)
|
|
|
|
|
|
|
|
signal.signal(signal.SIGINT, exit_handler)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Start application
|
|
|
|
app()
|
|
|
|
app()
|
|
|
|