-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogistics-R-Bus.py
More file actions
40 lines (35 loc) · 1.22 KB
/
Logistics-R-Bus.py
File metadata and controls
40 lines (35 loc) · 1.22 KB
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
#Importing module and define classes needed
import Bus_Logistics
Driver = Bus_Logistics.Driver
Owner = Bus_Logistics.Owner
Admin = Bus_Logistics.Admin
c = Bus_Logistics.color
def main():
note = '\nPlease select user type: \n 1 - Driver \t 2 - Owner \t 3 - Admin:\t'
bad = '\nInvalid entry, try again'
response = None
try:
response = int((input(note)).strip())
while response not in range(1,4):
response = int((input(c.RED + c.BOLD + bad + c.END + note)).strip())
except:
while response not in range(1,4):
response = int((input(c.RED + c.BOLD + bad + c.END + note)).strip())
finally:
start_system(response)
def start_system(response):
#allow prompts according to user5
if response == 1:
#Driver
do = Driver(fName=None, lName=None, uName=None, pWord=None, phone=None, bus=None, ID=None)
do.driver_options()
if response == 2:
#Owner
own = Owner(fName=None, lName=None, uName=None, pWord=None, phone=None, active=None, ID=None)
own.owner_options()
if response == 3:
#Admin :)
admin = Admin(adm_name=None, adm_pass=None)
admin.admin_sign_in()
if __name__ == '__main__':
main()