Fix ruff lint errors to unblock CI (import sorting, unused imports, style)

This commit is contained in:
James Smith
2026-03-20 13:51:30 +00:00
parent 90d39f12c1
commit 34e1d25069
14 changed files with 35 additions and 34 deletions

View File

@@ -20,12 +20,12 @@ def register_blueprints(app):
from .correlation import correlation_bp
from .dsc import dsc_bp
from .gps import gps_bp
from .ground_station import ground_station_bp
from .listening_post import receiver_bp
from .meshtastic import meshtastic_bp
from .meteor_websocket import meteor_bp
from .morse import morse_bp
from .offline import offline_bp
from .ground_station import ground_station_bp
from .ook import ook_bp
from .pager import pager_bp
from .radiosonde import radiosonde_bp

View File

@@ -728,8 +728,9 @@ def agent_management_page():
@controller_bp.route('/monitor')
def network_monitor_page():
"""Render the network monitor page for multi-agent aggregated view."""
from flask import render_template
from config import VERSION
from flask import render_template
from config import VERSION
return render_template('network_monitor.html', version=VERSION)

View File

@@ -11,7 +11,6 @@ from __future__ import annotations
import json
import queue
import threading
from pathlib import Path
from flask import Blueprint, Response, jsonify, request, send_file
@@ -102,6 +101,8 @@ def update_profile(norad_id: int):
data = request.get_json(force=True) or {}
from utils.ground_station.observation_profile import (
get_profile as _get,
)
from utils.ground_station.observation_profile import (
legacy_decoder_to_tasks,
normalize_tasks,
save_profile,
@@ -443,7 +444,6 @@ def init_ground_station_websocket(app) -> None:
@sock.route('/ws/satellite_waterfall')
def satellite_waterfall_ws(ws):
"""Stream binary waterfall frames from the active ground station IQ bus."""
import app as _app_mod
scheduler = _get_scheduler()
wf_queue = scheduler.waterfall_queue

View File

@@ -88,7 +88,7 @@ def find_auto_rx() -> str | None:
def _resolve_shebang_interpreter(script_path: str) -> str | None:
"""Resolve a Python interpreter from a script shebang if possible."""
try:
with open(script_path, 'r', encoding='utf-8', errors='ignore') as handle:
with open(script_path, encoding='utf-8', errors='ignore') as handle:
first_line = handle.readline().strip()
except OSError:
return None

View File

@@ -12,7 +12,6 @@ import requests
from flask import Blueprint, Response, jsonify, make_response, render_template, request
from config import SHARED_OBSERVER_LOCATION_ENABLED
from utils.sse import sse_stream_fanout
from data.satellites import TLE_SATELLITES
from utils.database import (
add_tracked_satellite,
@@ -23,6 +22,7 @@ from utils.database import (
)
from utils.logging import satellite_logger as logger
from utils.responses import api_error
from utils.sse import sse_stream_fanout
from utils.validation import validate_elevation, validate_hours, validate_latitude, validate_longitude
satellite_bp = Blueprint('satellite', __name__, url_prefix='/satellite')
@@ -55,6 +55,7 @@ _TRACK_CACHE_TTL = 1800
# Thread pool for background ground-track computation (non-blocking from 1Hz tracker loop)
from concurrent.futures import ThreadPoolExecutor as _ThreadPoolExecutor
_track_executor = _ThreadPoolExecutor(max_workers=2, thread_name_prefix='sat-track')
_track_in_progress: set = set() # cache keys currently being computed
_pass_cache: dict = {}
@@ -726,6 +727,7 @@ def get_transmitters_endpoint(norad_id: int):
def parse_packet():
"""Parse a raw satellite telemetry packet (base64-encoded)."""
import base64
from utils.satellite_telemetry import auto_parse
data = request.json or {}
try: