Run ruff format changes and finalize indentation and lint fixes.

This commit is contained in:
William Valentin
2025-08-09 12:10:16 -07:00
parent 9cec07e9f6
commit 9a5a2f0022
68 changed files with 1272 additions and 4301 deletions

View File

@@ -3,20 +3,28 @@
Test script for dose tracking UI in edit window.
Tests the specific issue where adding new doses replaces existing ones.
"""
# ruff: noqa: E402
import os
import sys
import tkinter as tk
from datetime import datetime
from pathlib import Path
# Add the src directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
from init import logger
from medicine_manager import MedicineManager
from pathology_manager import PathologyManager
from theme_manager import ThemeManager
from ui_manager import UIManager
def _ensure_src_on_path() -> None:
src_dir = Path(__file__).resolve().parent.parent / "src"
if str(src_dir) not in sys.path:
sys.path.insert(0, str(src_dir))
_ensure_src_on_path()
from thechart.core.constants import LOG_LEVEL
from thechart.core.logger import init_logger
from thechart.managers import Medicine, MedicineManager, PathologyManager
from thechart.ui import ThemeManager
from thechart.ui.ui_manager import UIManager
logger = init_logger(__name__, testing_mode=(LOG_LEVEL == "DEBUG"))
def test_dose_tracking():
@@ -39,8 +47,6 @@ def test_dose_tracking():
# Add a test medicine if none exist
medicines = medicine_manager.get_all_medicines()
if not medicines:
from medicine_manager import Medicine
test_medicine = Medicine(
key="bupropion",
display_name="Bupropion",