From 96818fa3a1aa7f29bc677aa150bf382f338e8e31 Mon Sep 17 00:00:00 2001 From: school Date: Tue, 29 Jan 2019 11:16:15 -0600 Subject: [PATCH] removed dialog boxes --- workers/timeout.py | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/workers/timeout.py b/workers/timeout.py index 3b99129..514b486 100644 --- a/workers/timeout.py +++ b/workers/timeout.py @@ -1,35 +1,9 @@ -import tkinter.messagebox as message -import subprocess +from dateutil.parser import parse +from upload import upload import datetime import os -import webbrowser -from dateutil.parser import parse -# import ctypes -import tkinter as tk +import subprocess import time -root = tk.Tk() -root.overrideredirect(1) -root.withdraw() -urL='https://drive.google.com' -firefox_path="C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe" -webbrowser.register('firefox', None,webbrowser.BackgroundBrowser(firefox_path)) - -## Styles: -## 0 : OK -## 1 : OK | Cancel -## 2 : Abort | Retry | Ignore -## 3 : Yes | No | Cancel -## 4 : Yes | No -## 5 : Retry | No -## 6 : Cancel | Try Again | Continue - t = parse(input("Enter endtime: ")) wait = (t-datetime.datetime.today()).seconds -subprocess.call(['timeout.exe','/nobreak',str(wait)]) -subprocess.call(['done.bat']) -subprocess.call(['explorer.exe',os.path.dirname(os.getcwd())]) -webbrowser.get('firefox').open_new_tab(urL) -time.sleep(.5) -res = message.askokcancel('Alert!','Upload file and press ok to log off') -if res: - subprocess.call(['shutdown.exe','/f','/l']) +subprocess.call(['timeout.exe','/nobreak',str(wait)]) \ No newline at end of file