forked from Pavithran-07/Automated_online_class_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
181 lines (126 loc) · 5.25 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
from tkinter import *
from PIL import ImageTk,Image
import tkinter.font as font
import tkinter as tk
from mainv2 import CRUD,totalInput
from alarm import Alarm
import threading
import os
class startPage:
def __init__(self):
window = Tk()
window.title('Online class Bot')
window.geometry("790x400+300+200")
myFont = font.Font(weight="bold")
#Image
img = Image.open('bot.png')
img = img.resize((100, 100), Image.ANTIALIAS)
img = ImageTk.PhotoImage(img)
panel = Label(window, image=img,bg='#87ceeb')
panel.image = img
panel.place(x=320,y=70)
#Icon Image
photo = PhotoImage(file = "bot.png")
window.iconphoto(False, photo)
#label
heading = Label(window, text = "Welcome!",bg='#87ceeb',font='bold').place(x=340,y=40)
#buttons
btn=Button(window, text="Add Link and time",fg='white' ,bg='red',command=linkPage)
btn.place(x=80, y=100)
btn['font']=myFont
btn1=Button(window, text="Add Gmail ID and Password",fg='white' , bg='red',command=CredsPage)
btn1.place(x=450, y=100)
btn1['font']=myFont
btn=Button(window, text="Start Scheduler",fg='white' ,bg='red',command=runSchedulePage)
btn.place(x=80, y=240)
btn['font']=myFont
#for Background Color
window.configure(bg='#87ceeb')
window.mainloop()
class linkPage:
def submitDetails(self):
self.Ti = totalInput()
fromht = list(str(self.fromtime.get()).split(" "))
toht = list(str(self.totime.get()).split(" "))
self.Ti.formatInput(fromht,toht,str(self.link.get()))
self.newwindow.destroy()
def __init__(self):
self.newwindow = Toplevel()
self.newwindow.title("Enter Details")
#geometry of the window
self.newwindow.geometry("400x400+200+200")
self.newwindow.configure(bg='#87ceeb')
self.heading = Label(self.newwindow, text="Please enter the details",bg='#87ceeb',font='bold').place(x=70,y=40)
#Labels
self.fromlable = Label(self.newwindow,text="From Time (eg: 09:45 AM): ",bg='#87ceeb',font='bold').place(x=25,y=90)
self.tolable = Label(self.newwindow,text="To Time (eg: 09:45 PM): ",bg='#87ceeb',font='bold').place(x=25,y=160)
self.linklable = Label(self.newwindow,text="Link: ",bg='#87ceeb',font='bold').place(x=25,y=220)
#Text Box
self.fromtime = StringVar()
Entry(self.newwindow,width=35,textvariable=self.fromtime).place(x=150,y=120)
self.totime = StringVar()
Entry(self.newwindow,width=35,textvariable=self.totime).place(x=150,y=190)
self.link = StringVar()
Entry(self.newwindow,width=35,textvariable=self.link).place(x=150,y=230)
#submit Button
self.submitbtn = Button(self.newwindow,text="Submit",fg='white' , bg='red',command=self.submitDetails).place(x=130,y=300)
class runSchedulePage:
def closeIt(self):
self.t1.stop()
self.newwindow.destroy()
def __init__(self):
self.newwindow = Toplevel()
self.newwindow.title("Running Scheduler")
self.newwindow.geometry("400x400+200+200")
self.newwindow.configure(bg="#87ceeb")
self.schedule = Alarm()
self.l = self.schedule.Checkalarm()
# print(self.l)
if(not self.l):
self.runninglabel = Label(self.newwindow,text="Running...",bg='#87ceeb',font='bold',fg='green').pack()
os.system("cmd /k python alarm.py -r")
else:
self.runninglabel = Label(self.newwindow,text=self.l,bg='#87ceeb',font='bold',fg='red').pack()
self.btn = Button(self.newwindow,text="Close",fg="white",bg="red",command=self.closeIt).place(x=170,y=300)
class SchedulerPage:
def closeIt(self):
self.newwindow.destroy()
def __init__(self):
self.newwindow = Toplevel()
self.newwindow.title("Running Scheduler")
#geometry of the window
self.newwindow.geometry("400x400+200+200")
self.newwindow.configure(bg='#87ceeb')
self.schedule = Alarm()
self.l = self.schedule.Checkalarm()
if(self.l is None):
self.runninglabel = Label(self.newwindow,text="Running...",bg='#87ceeb',font='bold',fg='green').pack()
else:
self.runninglabel = Label(self.newwindow,text=self.l,bg='#87ceeb',font='bold',fg='red').pack()
self.btn = Button(self.newwindow,text="Close",fg="white",bg="red",command=closeIt)
class CredsPage:
# global email
# global password
def submitCreds(self):
crud = CRUD()
crud.userInsert(self.email.get(),self.password.get())
self.newwindow.destroy()
def __init__(self):
self.newwindow = Toplevel()
self.newwindow.title("Enter your Credentials")
#geometry of the window
self.newwindow.geometry("400x400+200+200")
self.newwindow.configure(bg='#87ceeb')
self.heading = Label(self.newwindow, text="Please enter your Credentials",bg='#87ceeb',font='bold').place(x=70,y=40)
#Labels
self.emaillabel = Label(self.newwindow,text="Email ID: ",bg='#87ceeb',font='bold').place(x=25,y=90)
self.passlabel = Label(self.newwindow,text="Password: ",bg='#87ceeb',font='bold').place(x=25,y=160)
#Text Box
self.email = StringVar()
Entry(self.newwindow,width=35,textvariable=self.email).place(x=150,y=95)
self.password = StringVar()
Entry(self.newwindow,show="*",width=35,textvariable=self.password).place(x=150,y=170)
#submit Button
self.submitbtn = Button(self.newwindow,text="Submit",fg='white' , bg='red',command=self.submitCreds).place(x=130,y=300)
app = startPage()
# app.mainloop()