-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime_reporting.py
48 lines (34 loc) · 1.11 KB
/
time_reporting.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
45
46
47
48
"""
This is the main script.
This script starts the GUI and other operations.
"""
import os
import sys
__author__ = "milanbalazs"
__version__ = "0.1"
# Get the path of the directory of the current file.
PATH_OF_FILE_DIR = os.path.join(os.path.realpath(os.path.dirname(__file__)))
# Append the required directories to PATH
sys.path.append(PATH_OF_FILE_DIR)
sys.path.append(os.path.join(PATH_OF_FILE_DIR, "gui"))
import main_gui # noqa: E402
from color_logger import ColoredLogger # noqa: E402
# Set-up the main logger instance.
PATH_OF_LOG_FILE = os.path.join(PATH_OF_FILE_DIR, "logs", "main_log.log")
MAIN_LOGGER = ColoredLogger(os.path.basename(__file__), log_file_path=PATH_OF_LOG_FILE)
####
# ENTRY POINT
####
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--test",
dest="test_flag",
help="If this flag is set, the tool uses test values.",
action="store_true",
)
args = parser.parse_args()
if args.test_flag:
main_gui.TEST_RUNNING = True
main_gui.main(c_logger=MAIN_LOGGER)