-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
74 lines (67 loc) · 2.52 KB
/
main.py
File metadata and controls
74 lines (67 loc) · 2.52 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
65
66
67
68
69
70
71
72
73
74
'''
Execute programs
This program needs the following directory structure:
- Code/
- Contracts/
- ContractsOld/
- new_contract.pdf
- Locker.xlsx
- main.py
'''
__author__ = "Lukas Beck"
__date__ = "31.10.2025"
import logging
try:
from Code.add_contract import AddContract
from Code.extend_code_generator import ExtendCodeGenerator
from Code.extend_contract import ExtendContract
from Code.remove_contract import RemoveContracts
from Code.send_extend_reminder import SendExtendReminder
from Code.extend_code_generator import ExtendCodeGenerator
from Code.extend_update_from_file import ExtendUpdateFromFile
logging.basicConfig(
format="%(asctime)s.%(msecs)03d; %(levelname)-8s; "
"%(message)-90s; %(module)s.%(funcName)s(%(lineno)d);",
datefmt='%H:%M:%S', level=logging.INFO)
# Find file path and other global variables in \Code\lib\locker_parent.py
while(True):
print()
print("This program handles interaction between spreadsheets and contracts, it can:"
+ "\nA: Add a contract"
+ "\nR: Remove a contract"
+ "\nE: Extending and reminding options"
+ "\n Press enter to exit: "
)
choice = input("Please enter the letter for the wanted function (A/R/E): ").lower()
if choice == "a":
AddContract()
elif choice == "r":
RemoveContracts()
elif choice == "e":
print("In this menu you can: "
+ "\nE: Extend a specific contract"
+ "\nS: Send extend reminder to all contracts"
+ "\nG: Generate, save and export new extend codes for all contracts"
+ "\nU: Update the check-ins from a csv-list (generated by the website)"
+ "\n Press enter to return to previous menu: "
)
choice = input("Please enter the letter for the wanted function (E/S/G/U): ").lower()
if choice == "e":
ExtendContract()
elif choice == "g":
ExtendCodeGenerator()
elif choice == "s":
SendExtendReminder()
elif choice == "g":
ExtendCodeGenerator()
elif choice == "u":
ExtendUpdateFromFile()
else:
continue
else:
break
except KeyboardInterrupt:
print("\nProgram interrupted by user.")
except Exception as e:
logging.exception("Fatal error in main program: " + str(e))
input("Press Enter to exit.")