-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__main__.py
35 lines (31 loc) · 937 Bytes
/
__main__.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
from prompt_toolkit.shortcuts import (
button_dialog
)
from prompt import styles, sign_in, sign_up, manager_menu, student_menu
from config import userRoles
if __name__=='__main__':
while True:
signin_signup_selected = button_dialog(
title='Sign In | Sign Up',
text='Sign In or Sign Up?',
buttons=[
('Sign In', 'sign_in'),
('Sign Up', 'sign_up'),
('Exit', None)
],
style=styles.BLUE,
).run()
if signin_signup_selected=="sign_in":
user = sign_in()
if user:
break
elif signin_signup_selected=="sign_up":
user = sign_up()
if user:
break
else:
break
if user.role == userRoles.MANAGER:
manager_menu(user.id)
elif user.role == userRoles.STUDENT:
student_menu(user.id)