Fixed non-main calling

This commit is contained in:
Abhorrent_Anger 2019-10-29 11:30:06 +02:00 committed by Mārtiņš Kurmis
parent b9f7992c23
commit bef4eb7967
1 changed files with 7 additions and 4 deletions

View File

@ -100,16 +100,19 @@ def parse_args():
args = parser.parse_args()
globals().update(args.__dict__)
def main():
def notification_loop():
init()
while 1:
wait()
send_notification()
uninit()
if __name__ == '__main__':
def main():
parse_args()
notify_thread = threading.Thread(target=main, name="Notify Thread")
notify_thread = threading.Thread(target=notification_loop, name="Notify Thread")
notify_thread.start()
create_tray_icon()
notify_thread.join()
notify_thread.join()
if __name__ == '__main__':
main()