fix: ruff findings
This commit is contained in:
+9
-13
@@ -12,7 +12,6 @@ Criteria: TUI-1, TUI-2, TUI-4, CI-1, CI-2, CI-4, IN-3, LC-6, LC-8.
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlite3
|
||||
import sys
|
||||
from datetime import date, datetime, timedelta, timezone
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
@@ -21,7 +20,7 @@ from zoneinfo import ZoneInfo
|
||||
from rich.text import Text
|
||||
from textual.app import App, ComposeResult
|
||||
from textual.binding import Binding
|
||||
from textual.containers import Container, Horizontal, VerticalScroll
|
||||
from textual.containers import Container, VerticalScroll
|
||||
from textual.screen import ModalScreen
|
||||
from textual.message import Message
|
||||
from textual.widget import Widget
|
||||
@@ -38,16 +37,14 @@ from .activity_plot import VolumePoint, volume_plot
|
||||
from .projection import (
|
||||
ConfidenceState,
|
||||
ProjectionResult,
|
||||
ScenarioRange,
|
||||
compute_projection,
|
||||
)
|
||||
from .status import (
|
||||
CADENCE_DEFAULT_S,
|
||||
FRESH_THRESHOLD_S,
|
||||
STALENESS_THRESHOLD_S,
|
||||
FRESH_THRESHOLD_S, # noqa: F401 -- re-exported; tests/test_acceptance_sweep.py asserts parity with status
|
||||
STALENESS_THRESHOLD_S, # noqa: F401 -- re-exported (see above)
|
||||
format_disclosures,
|
||||
freshness_age_human,
|
||||
grade_freshness,
|
||||
grade_freshness, # noqa: F401 -- re-exported (see above)
|
||||
deliberate_pause_lines,
|
||||
read_status,
|
||||
_journalctl_hint,
|
||||
@@ -55,7 +52,6 @@ from .status import (
|
||||
from .status_composition import (
|
||||
StatusComposition,
|
||||
render_status_tui,
|
||||
STATUS_POLL_INTERVAL_S,
|
||||
)
|
||||
from .control import MONITOR_HELPER, MonitorError, run_monitor
|
||||
from .derive import _parse_ts
|
||||
@@ -1110,10 +1106,10 @@ def _query_local_day_graph_data(
|
||||
(start_text, end_text, selected_date or ""),
|
||||
).fetchall()
|
||||
recorded_zones: Dict[str, list[str]] = {}
|
||||
for local_date, timezone in rows:
|
||||
for local_date, zone_name in rows:
|
||||
recorded_zones.setdefault(local_date, [])
|
||||
if timezone not in recorded_zones[local_date]:
|
||||
recorded_zones[local_date].append(timezone)
|
||||
if zone_name not in recorded_zones[local_date]:
|
||||
recorded_zones[local_date].append(zone_name)
|
||||
|
||||
result: List[Dict[str, Any]] = []
|
||||
for local_date in sorted(local_dates):
|
||||
@@ -1138,9 +1134,9 @@ def _query_local_day_graph_data(
|
||||
})
|
||||
continue
|
||||
|
||||
for timezone in timezones:
|
||||
for zone_name in timezones:
|
||||
summary = query_local_day_summary(
|
||||
conn, local_date, timezone, now,
|
||||
conn, local_date, zone_name, now,
|
||||
)
|
||||
if summary is None:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user