Browse Source

removed dialog boxes

master
school 7 years ago
parent
commit
96818fa3a1
  1. 34
      workers/timeout.py

34
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)])
Loading…
Cancel
Save