-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
44 lines (32 loc) · 1011 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
36
37
38
39
40
41
42
43
44
import argparse
from src import payroll as pr
DEFAULT_CONFIGPATH = "config/example.yml"
DEFAULT_PATH_TO_RECORDS = "data/service_records.jsonl"
def main(config_path: str, path_to_records: str):
registry = pr.ServiceTypeRegistry.from_yaml(config_path)
current_week_dates = pr.generate_current_week_dates()
gui = pr.PayPeriodGUI(
dates=current_week_dates,
registry=registry,
path_to_records=path_to_records,
)
root = gui.create_layout()
root.mainloop()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"-c",
"--config",
default=DEFAULT_CONFIGPATH,
help="path to the services config YAML file",
type=str,
)
parser.add_argument(
"-p",
"--path_to_records",
default=DEFAULT_PATH_TO_RECORDS,
help="path to the services config YAML file",
type=str,
)
args = parser.parse_args()
main(args.config, args.path_to_records)