-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.py
36 lines (33 loc) · 1.29 KB
/
menu.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
from selenium_header import *
from Pages.page import Page
from Pages.attendance import AttendancePage
import logging
def menu():
logging.info("Main menu started.")
print(f"MMLS Automator 2.0")
options_set = {"M","A","E"}
options = 0
while options not in options_set:
options = input("M - Check MMLS' Announcement\nA - Take Attendance\nE - Exit\n---->").capitalize()
logging.info(f"Option {options} is selected.")
if options == "M":
logging.info(f"Creating MMLS' Instance.")
mmls = Page(chrome)
print("\nLoading...\n")
logging.info(f"Attempting to Login.")
mmls.login()
logging.info(f"Login Successfully, and now starting to do announcement checking.")
mmls.subjects_checker()
elif options == "A":
logging.info(f"Attendance Instance is created.")
AttendancePage(chrome)
elif options == "E":
logging.info(f"Closing chrome browser.")
chrome.close()
print("Thanks for using this application!")
break
else:
logging.info(f"Invalid option selected, main menu.")
print("Invalid option!")
logging.info("Option is being reinitialized to 0.")
options = 0