Refactor MedTrackerApp and UI components for improved structure and readability
- Simplified initialization logic in init.py - Consolidated testing_mode assignment - Removed unnecessary else statements - Created UIManager class to handle UI-related tasks - Modularized input frame creation, table frame creation, and graph frame creation - Enhanced edit window creation with better organization and error handling - Updated data management methods to improve clarity and maintainability - Improved logging for better debugging and tracking of application flow
This commit is contained in:
11
src/init.py
11
src/init.py
@@ -4,8 +4,6 @@ from constants import LOG_PATH, LOG_CLEAR, LOG_LEVEL
|
||||
|
||||
if not os.path.exists(LOG_PATH):
|
||||
os.mkdir(LOG_PATH)
|
||||
else:
|
||||
pass
|
||||
|
||||
log_files = (
|
||||
f"{LOG_PATH}/app.log",
|
||||
@@ -13,10 +11,7 @@ log_files = (
|
||||
f"{LOG_PATH}/app.error.log",
|
||||
)
|
||||
|
||||
if LOG_LEVEL == "DEBUG":
|
||||
testing_mode = True
|
||||
else:
|
||||
testing_mode = False
|
||||
testing_mode = LOG_LEVEL == "DEBUG"
|
||||
|
||||
logger = init_logger(__name__, testing_mode=testing_mode)
|
||||
|
||||
@@ -26,10 +21,6 @@ if LOG_CLEAR == "True":
|
||||
if os.path.exists(log_file):
|
||||
with open(log_file, "r+") as t:
|
||||
t.truncate(0)
|
||||
else:
|
||||
pass
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
raise
|
||||
else:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user