-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigManager.py
More file actions
47 lines (42 loc) · 1.5 KB
/
ConfigManager.py
File metadata and controls
47 lines (42 loc) · 1.5 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
import os
import sys
class ConfigManager:
def __init__(self):
self.font_family = "TkDefaultFont"
self.font_family_monospace = "Consolas"
self.font_size_small = 8
self.font_size_normal = 10
self.date_format = "%d. %b. %Y"
self.frequency_hours = 6
self.task_name_regex = r"\s*([^:;]*)\s*:\s*([^:;]*)"
# Export
self.export_empty_row = "No data"
self.export_file_name = os.path.join(ConfigManager._get_full_curr_dir_path(), "task_notes.ods")
self.export_file_tab_name_default = "Default"
self.export_file_tab_name_task_names = "Task names"
self.export_data_date = "Date"
self.export_data_done = "Done"
self.export_data_in_progress = "In progress"
self.export_data_problems = "Problems"
self.full_path = os.path.join(ConfigManager._get_full_curr_dir_path(), "task_notes.yaml")
@staticmethod
def _get_full_curr_dir_path():
if getattr(sys, 'frozen', False):
application_path = os.path.dirname(sys.executable)
else:
application_path = os.path.dirname(os.path.abspath(__file__))
return application_path
def __str__(self):
return """
Font family: {}
Font size: {}
Date format: {}
Frequency hours: {}
Output file: {}
Excel file: {}""".format(
self.font_family,
self.font_size_normal,
self.date_format,
self.frequency_hours,
self.full_path,
self.export_file_name)