-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
64 lines (54 loc) · 1.79 KB
/
main.py
File metadata and controls
64 lines (54 loc) · 1.79 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Do not modify this file
import sys
import os
import ui # User Interface
from importlib.machinery import SourceFileLoader
main_path = os.path.dirname(os.path.abspath(__file__))
# Store module
store = SourceFileLoader("store", main_path + "/store/store.py").load_module()
# Human Resources module
hr = SourceFileLoader("hr", main_path + "/hr/hr.py").load_module()
# Tool manager module
tool_manager = SourceFileLoader("tool_manager", main_path + "/tool_manager/tool_manager.py").load_module()
# Accounting module
accounting = SourceFileLoader("accounting", main_path + "/accounting/accounting.py").load_module()
# Selling module
selling = SourceFileLoader("selling", main_path + "/selling/selling.py").load_module()
# Customer Relationship Management (CRM) module
crm = SourceFileLoader("crm", main_path + "/crm/crm.py").load_module()
def choose():
inputs = ui.get_inputs(["Please enter a number: "], "")
option = inputs[0]
if option == '1':
store.start()
elif option == '2':
hr.start()
elif option == '3':
tool_manager.start()
elif option == '4':
accounting.start()
elif option == '5':
selling.start()
elif option == '6':
crm.start()
elif option == '0':
sys.exit(0)
else:
raise KeyError("There is no such option.")
def handle_menu():
options = ["Store manager",
"Human resources manager",
"Tool manager",
"Accounting manager",
"Selling manager",
"Customer Relationship Management (CRM)"]
ui.print_menu("\nMain menu", options, "Exit program")
def main():
while True:
handle_menu()
try:
choose()
except KeyError as err:
ui.print_error_message(err)
if __name__ == '__main__':
main()