diff --git a/core/activity_lookup_helper.py b/core/activity_lookup_helper.py index af0aeb2..6ec1f5a 100644 --- a/core/activity_lookup_helper.py +++ b/core/activity_lookup_helper.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re diff --git a/core/activity_utils.py b/core/activity_utils.py index 93713e0..c4efab3 100644 --- a/core/activity_utils.py +++ b/core/activity_utils.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from core.enums import ActivityName from data.activities import ACTIVITIES from data.activity import Activity diff --git a/core/call_lookup_helper.py b/core/call_lookup_helper.py index da407e6..75f8a87 100644 --- a/core/call_lookup_helper.py +++ b/core/call_lookup_helper.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from core.data_providers import DATA_PROVIDERS diff --git a/core/cleanup.py b/core/cleanup.py index 713d2f9..b71236b 100644 --- a/core/cleanup.py +++ b/core/cleanup.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/core/config.py b/core/config.py index b090963..8217a30 100644 --- a/core/config.py +++ b/core/config.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import importlib import logging import os diff --git a/core/constants.py b/core/constants.py index c4ec4d9..862ac8b 100644 --- a/core/constants.py +++ b/core/constants.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from core.config import SERVER_OWNER_CALLSIGN from data.band import Band diff --git a/core/data_providers.py b/core/data_providers.py index 818053d..a72d37f 100644 --- a/core/data_providers.py +++ b/core/data_providers.py @@ -3,14 +3,19 @@ from __future__ import annotations import logging import threading import time +from typing import TYPE_CHECKING from core.config import config, create_provider_from_config -from providers.activityrefdata.activity_ref_data_provider import ActivityRefDataProvider -from providers.alert.alert_provider import AlertProvider -from providers.callsigndata.callsign_data_provider import CallsignDataProvider -from providers.solarconditions.solar_conditions_provider import SolarConditionsProvider -from providers.spot.spot_provider import SpotProvider -from providers.staticdata.static_data_provider import StaticDataProvider + +if TYPE_CHECKING: + # Can't find a way to resolve the circular dependency on types but apparently this is a way of managing that + # while still having type safety in method definitions. + from providers.activityrefdata.activity_ref_data_provider import ActivityRefDataProvider + from providers.alert.alert_provider import AlertProvider + from providers.callsigndata.callsign_data_provider import CallsignDataProvider + from providers.solarconditions.solar_conditions_provider import SolarConditionsProvider + from providers.spot.spot_provider import SpotProvider + from providers.staticdata.static_data_provider import StaticDataProvider logger = logging.getLogger(__name__) diff --git a/core/enums.py b/core/enums.py index a6f2a39..ffa9063 100644 --- a/core/enums.py +++ b/core/enums.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from enum import Enum @@ -46,7 +44,7 @@ class Mode(str, Enum): return not (self.is_cw or self.is_phone) @staticmethod - def from_name(name: str) -> Mode | None: + def from_name(name: str) -> "Mode | None": """Convert a string to an enum mode using the alias table.""" if not name: diff --git a/core/geo_utils.py b/core/geo_utils.py index 5577bec..0c9473a 100644 --- a/core/geo_utils.py +++ b/core/geo_utils.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from math import floor, isnan diff --git a/core/live_data_cache.py b/core/live_data_cache.py index 36c7f86..4bb9ec6 100644 --- a/core/live_data_cache.py +++ b/core/live_data_cache.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import threading import time diff --git a/core/prometheus_metrics_handler.py b/core/prometheus_metrics_handler.py index c706462..4234120 100644 --- a/core/prometheus_metrics_handler.py +++ b/core/prometheus_metrics_handler.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from prometheus_client import ( CollectorRegistry, Counter, diff --git a/core/single_object_data_cache.py b/core/single_object_data_cache.py index dbb3fcb..bd947c5 100644 --- a/core/single_object_data_cache.py +++ b/core/single_object_data_cache.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import threading from typing import Generic, TypeVar diff --git a/core/status_reporter.py b/core/status_reporter.py index b5fe608..62617e3 100644 --- a/core/status_reporter.py +++ b/core/status_reporter.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import os from datetime import datetime diff --git a/core/url_data_cache.py b/core/url_data_cache.py index a75c3f6..10e71ce 100644 --- a/core/url_data_cache.py +++ b/core/url_data_cache.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import threading from datetime import timedelta from typing import Any diff --git a/core/utils.py b/core/utils.py index 2e3ead8..0ff4203 100644 --- a/core/utils.py +++ b/core/utils.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from typing import Any diff --git a/data/activities.py b/data/activities.py index 9afdc55..8e4b2fe 100644 --- a/data/activities.py +++ b/data/activities.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from core.enums import ActivityName, ActivityRefType, ActivityType from data.activity import Activity diff --git a/data/activity.py b/data/activity.py index 6b1f5e3..c0e2fb0 100644 --- a/data/activity.py +++ b/data/activity.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass, field from core.enums import ActivityName, ActivityRefType, ActivityType diff --git a/data/activity_ref.py b/data/activity_ref.py index aacf4cd..d766c8d 100644 --- a/data/activity_ref.py +++ b/data/activity_ref.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass from core.enums import ActivityRefType diff --git a/data/alert.py b/data/alert.py index 25caa5f..290fc40 100644 --- a/data/alert.py +++ b/data/alert.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import hashlib import json import logging diff --git a/data/callsign.py b/data/callsign.py index 8cd10b2..f4a04fb 100644 --- a/data/callsign.py +++ b/data/callsign.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass from core.enums import Continent, LocationSourceForCallsign diff --git a/data/lookup_credentials.py b/data/lookup_credentials.py index db579b1..7150f3e 100644 --- a/data/lookup_credentials.py +++ b/data/lookup_credentials.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass from tornado.httputil import HTTPHeaders diff --git a/data/solar_conditions.py b/data/solar_conditions.py index 592461a..9c5481f 100644 --- a/data/solar_conditions.py +++ b/data/solar_conditions.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json from dataclasses import dataclass from typing import Any, TypeVar diff --git a/data/spot.py b/data/spot.py index d374597..2b5f5e7 100644 --- a/data/spot.py +++ b/data/spot.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import hashlib import json import logging diff --git a/providers/activityrefdata/activity_ref_data_provider.py b/providers/activityrefdata/activity_ref_data_provider.py index f6776a7..5ce4dba 100644 --- a/providers/activityrefdata/activity_ref_data_provider.py +++ b/providers/activityrefdata/activity_ref_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event diff --git a/providers/activityrefdata/arlhs.py b/providers/activityrefdata/arlhs.py index 45cca9a..41d7047 100644 --- a/providers/activityrefdata/arlhs.py +++ b/providers/activityrefdata/arlhs.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/cota.py b/providers/activityrefdata/cota.py index 367b377..6d0491e 100644 --- a/providers/activityrefdata/cota.py +++ b/providers/activityrefdata/cota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/activityrefdata/dce.py b/providers/activityrefdata/dce.py index 64e9893..b0afc61 100644 --- a/providers/activityrefdata/dce.py +++ b/providers/activityrefdata/dce.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import io from time import sleep from typing import Any diff --git a/providers/activityrefdata/defe.py b/providers/activityrefdata/defe.py index 6e4cd4d..10e5f52 100644 --- a/providers/activityrefdata/defe.py +++ b/providers/activityrefdata/defe.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import io from time import sleep from typing import Any diff --git a/providers/activityrefdata/dme.py b/providers/activityrefdata/dme.py index 0dbee04..8da5d91 100644 --- a/providers/activityrefdata/dme.py +++ b/providers/activityrefdata/dme.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/dmue.py b/providers/activityrefdata/dmue.py index dc12d47..0bfaac3 100644 --- a/providers/activityrefdata/dmue.py +++ b/providers/activityrefdata/dmue.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/dmve.py b/providers/activityrefdata/dmve.py index 14c02e4..e3b13a3 100644 --- a/providers/activityrefdata/dmve.py +++ b/providers/activityrefdata/dmve.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import io from time import sleep from typing import Any diff --git a/providers/activityrefdata/dtmba.py b/providers/activityrefdata/dtmba.py index 2c18747..90388f0 100644 --- a/providers/activityrefdata/dtmba.py +++ b/providers/activityrefdata/dtmba.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/activityrefdata/fea.py b/providers/activityrefdata/fea.py index 9af498c..d52944b 100644 --- a/providers/activityrefdata/fea.py +++ b/providers/activityrefdata/fea.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from io import BytesIO from time import sleep from typing import Any diff --git a/providers/activityrefdata/file_download_activity_ref_data_provider.py b/providers/activityrefdata/file_download_activity_ref_data_provider.py index daeff09..129bf47 100644 --- a/providers/activityrefdata/file_download_activity_ref_data_provider.py +++ b/providers/activityrefdata/file_download_activity_ref_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Thread diff --git a/providers/activityrefdata/gma.py b/providers/activityrefdata/gma.py index 3731833..b90f5b1 100644 --- a/providers/activityrefdata/gma.py +++ b/providers/activityrefdata/gma.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/illw.py b/providers/activityrefdata/illw.py index f8b7fec..a8f0ae4 100644 --- a/providers/activityrefdata/illw.py +++ b/providers/activityrefdata/illw.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/iota.py b/providers/activityrefdata/iota.py index 426f1e8..ba0397b 100644 --- a/providers/activityrefdata/iota.py +++ b/providers/activityrefdata/iota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from time import sleep from typing import Any diff --git a/providers/activityrefdata/krmnpa.py b/providers/activityrefdata/krmnpa.py index 1739510..441dd35 100644 --- a/providers/activityrefdata/krmnpa.py +++ b/providers/activityrefdata/krmnpa.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from core.enums import ActivityName diff --git a/providers/activityrefdata/llota.py b/providers/activityrefdata/llota.py index e51a36f..c327e0a 100644 --- a/providers/activityrefdata/llota.py +++ b/providers/activityrefdata/llota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/activityrefdata/local_file_activity_ref_data_provider.py b/providers/activityrefdata/local_file_activity_ref_data_provider.py index 5c2ad9b..2423690 100644 --- a/providers/activityrefdata/local_file_activity_ref_data_provider.py +++ b/providers/activityrefdata/local_file_activity_ref_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any diff --git a/providers/activityrefdata/mota.py b/providers/activityrefdata/mota.py index aeb6f9d..dc48de1 100644 --- a/providers/activityrefdata/mota.py +++ b/providers/activityrefdata/mota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/pga.py b/providers/activityrefdata/pga.py index 5c44b82..4cb8b2b 100644 --- a/providers/activityrefdata/pga.py +++ b/providers/activityrefdata/pga.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/activityrefdata/pnp_kml_activity_ref_data_provider.py b/providers/activityrefdata/pnp_kml_activity_ref_data_provider.py index 67211ca..1c771c2 100644 --- a/providers/activityrefdata/pnp_kml_activity_ref_data_provider.py +++ b/providers/activityrefdata/pnp_kml_activity_ref_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from time import sleep from typing import Any diff --git a/providers/activityrefdata/pota.py b/providers/activityrefdata/pota.py index cbf0583..0d6f21e 100644 --- a/providers/activityrefdata/pota.py +++ b/providers/activityrefdata/pota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/sanpcpa.py b/providers/activityrefdata/sanpcpa.py index ac726a7..2be02aa 100644 --- a/providers/activityrefdata/sanpcpa.py +++ b/providers/activityrefdata/sanpcpa.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from core.enums import ActivityName diff --git a/providers/activityrefdata/siota.py b/providers/activityrefdata/siota.py index f66e015..3717432 100644 --- a/providers/activityrefdata/siota.py +++ b/providers/activityrefdata/siota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/sota.py b/providers/activityrefdata/sota.py index 0463f6d..aa4a038 100644 --- a/providers/activityrefdata/sota.py +++ b/providers/activityrefdata/sota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/toilets.py b/providers/activityrefdata/toilets.py index 935cf41..842a761 100644 --- a/providers/activityrefdata/toilets.py +++ b/providers/activityrefdata/toilets.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from typing import Any diff --git a/providers/activityrefdata/towers.py b/providers/activityrefdata/towers.py index 411a64e..4025b92 100644 --- a/providers/activityrefdata/towers.py +++ b/providers/activityrefdata/towers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/wca.py b/providers/activityrefdata/wca.py index f64907a..0f9bedb 100644 --- a/providers/activityrefdata/wca.py +++ b/providers/activityrefdata/wca.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv import logging from time import sleep diff --git a/providers/activityrefdata/wota.py b/providers/activityrefdata/wota.py index 897f5bb..5828c1b 100644 --- a/providers/activityrefdata/wota.py +++ b/providers/activityrefdata/wota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/activityrefdata/wwbota.py b/providers/activityrefdata/wwbota.py index f50fc6f..71e71bd 100644 --- a/providers/activityrefdata/wwbota.py +++ b/providers/activityrefdata/wwbota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/wwff.py b/providers/activityrefdata/wwff.py index 9a3f047..30b9f2f 100644 --- a/providers/activityrefdata/wwff.py +++ b/providers/activityrefdata/wwff.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv from time import sleep from typing import Any diff --git a/providers/activityrefdata/zlota.py b/providers/activityrefdata/zlota.py index 846d98e..7b79c7a 100644 --- a/providers/activityrefdata/zlota.py +++ b/providers/activityrefdata/zlota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from time import sleep from typing import Any diff --git a/providers/alert/alert_provider.py b/providers/alert/alert_provider.py index 98f9afd..f72a39e 100644 --- a/providers/alert/alert_provider.py +++ b/providers/alert/alert_provider.py @@ -1,17 +1,11 @@ -from __future__ import annotations - from datetime import datetime -from typing import TYPE_CHECKING, Any +from typing import Any import pytz from core.data_store import DATA_STORE from core.live_data_cache import LiveDataCache - -if TYPE_CHECKING: - # Deferred to avoid a circular import: data.alert imports core.call_lookup_helper, which imports - # core.data_providers, which imports this module. - from data.alert import Alert +from data.alert import Alert class AlertProvider: diff --git a/providers/alert/bota.py b/providers/alert/bota.py index 2448436..a875ea7 100644 --- a/providers/alert/bota.py +++ b/providers/alert/bota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime, timedelta from typing import Any diff --git a/providers/alert/hamsat.py b/providers/alert/hamsat.py index dfc3fdb..4b447c5 100644 --- a/providers/alert/hamsat.py +++ b/providers/alert/hamsat.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/alert/http_alert_provider.py b/providers/alert/http_alert_provider.py index 71d563e..e765d92 100644 --- a/providers/alert/http_alert_provider.py +++ b/providers/alert/http_alert_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/alert/ical_alert_provider.py b/providers/alert/ical_alert_provider.py index 61f39a6..1dfb49f 100644 --- a/providers/alert/ical_alert_provider.py +++ b/providers/alert/ical_alert_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import date, datetime, time from typing import Any, cast diff --git a/providers/alert/ng3k.py b/providers/alert/ng3k.py index 5cb614c..f9c6180 100644 --- a/providers/alert/ng3k.py +++ b/providers/alert/ng3k.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from datetime import datetime from typing import Any, cast diff --git a/providers/alert/parksnpeaks.py b/providers/alert/parksnpeaks.py index d99ddf4..a5fcb40 100644 --- a/providers/alert/parksnpeaks.py +++ b/providers/alert/parksnpeaks.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any diff --git a/providers/alert/pota.py b/providers/alert/pota.py index 6c2f4e7..64848ab 100644 --- a/providers/alert/pota.py +++ b/providers/alert/pota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/alert/rsgb_ical_alert_provider.py b/providers/alert/rsgb_ical_alert_provider.py index 820f199..4141f86 100644 --- a/providers/alert/rsgb_ical_alert_provider.py +++ b/providers/alert/rsgb_ical_alert_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from typing import Any diff --git a/providers/alert/rsgbhfcontests.py b/providers/alert/rsgbhfcontests.py index 8ea402f..14e3fd9 100644 --- a/providers/alert/rsgbhfcontests.py +++ b/providers/alert/rsgbhfcontests.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from providers.alert.rsgb_ical_alert_provider import RSGBICALAlertProvider diff --git a/providers/alert/rsgbvhfcontests.py b/providers/alert/rsgbvhfcontests.py index 180417f..39e22ea 100644 --- a/providers/alert/rsgbvhfcontests.py +++ b/providers/alert/rsgbvhfcontests.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from providers.alert.rsgb_ical_alert_provider import RSGBICALAlertProvider diff --git a/providers/alert/sota.py b/providers/alert/sota.py index 1c1739f..62c5830 100644 --- a/providers/alert/sota.py +++ b/providers/alert/sota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/alert/wa7bnm.py b/providers/alert/wa7bnm.py index fb7e73f..9ee7de7 100644 --- a/providers/alert/wa7bnm.py +++ b/providers/alert/wa7bnm.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any from icalendar import Event diff --git a/providers/alert/wota.py b/providers/alert/wota.py index d6ceb0d..1780946 100644 --- a/providers/alert/wota.py +++ b/providers/alert/wota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any, cast diff --git a/providers/alert/wwff.py b/providers/alert/wwff.py index 0bbcd89..f1a5165 100644 --- a/providers/alert/wwff.py +++ b/providers/alert/wwff.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/callsigndata/api_query_callsign_data_provider.py b/providers/callsigndata/api_query_callsign_data_provider.py index 58f8170..566fafa 100644 --- a/providers/callsigndata/api_query_callsign_data_provider.py +++ b/providers/callsigndata/api_query_callsign_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any import diskcache diff --git a/providers/callsigndata/callsign_data_provider.py b/providers/callsigndata/callsign_data_provider.py index 83edd29..767c921 100644 --- a/providers/callsigndata/callsign_data_provider.py +++ b/providers/callsigndata/callsign_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/callsigndata/clublogapi.py b/providers/callsigndata/clublogapi.py index 3432d0a..e4d1e57 100644 --- a/providers/callsigndata/clublogapi.py +++ b/providers/callsigndata/clublogapi.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any diff --git a/providers/callsigndata/clublogxml.py b/providers/callsigndata/clublogxml.py index eb99cf7..90dbfbf 100644 --- a/providers/callsigndata/clublogxml.py +++ b/providers/callsigndata/clublogxml.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import gzip import logging from typing import Any diff --git a/providers/callsigndata/countryfiles.py b/providers/callsigndata/countryfiles.py index b46957b..ee243a9 100644 --- a/providers/callsigndata/countryfiles.py +++ b/providers/callsigndata/countryfiles.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any diff --git a/providers/callsigndata/file_download_callsign_data_provider.py b/providers/callsigndata/file_download_callsign_data_provider.py index 4359ae9..e4a9135 100644 --- a/providers/callsigndata/file_download_callsign_data_provider.py +++ b/providers/callsigndata/file_download_callsign_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/callsigndata/hamqth.py b/providers/callsigndata/hamqth.py index 673c122..c0f8213 100644 --- a/providers/callsigndata/hamqth.py +++ b/providers/callsigndata/hamqth.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import urllib.parse from datetime import datetime, timedelta diff --git a/providers/callsigndata/qrz.py b/providers/callsigndata/qrz.py index b264c55..f3f5cea 100644 --- a/providers/callsigndata/qrz.py +++ b/providers/callsigndata/qrz.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import urllib.parse from datetime import datetime, timedelta diff --git a/providers/solarconditions/giroionosonde.py b/providers/solarconditions/giroionosonde.py index 0de6334..e1ac023 100644 --- a/providers/solarconditions/giroionosonde.py +++ b/providers/solarconditions/giroionosonde.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import csv import logging from datetime import datetime, timedelta, timezone diff --git a/providers/solarconditions/hamqsl.py b/providers/solarconditions/hamqsl.py index 8b03603..1feeaa1 100644 --- a/providers/solarconditions/hamqsl.py +++ b/providers/solarconditions/hamqsl.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any from xml.etree import ElementTree diff --git a/providers/solarconditions/http_solar_conditions_provider.py b/providers/solarconditions/http_solar_conditions_provider.py index 427272a..a7699fe 100644 --- a/providers/solarconditions/http_solar_conditions_provider.py +++ b/providers/solarconditions/http_solar_conditions_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/solarconditions/ionosonde_utils.py b/providers/solarconditions/ionosonde_utils.py index e4cfe8a..e773a2a 100644 --- a/providers/solarconditions/ionosonde_utils.py +++ b/providers/solarconditions/ionosonde_utils.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from core.constants import BANDS from data.band import Band diff --git a/providers/solarconditions/kc2gprop.py b/providers/solarconditions/kc2gprop.py index 3f79438..e259306 100644 --- a/providers/solarconditions/kc2gprop.py +++ b/providers/solarconditions/kc2gprop.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime, timedelta, timezone from threading import Event, Thread diff --git a/providers/solarconditions/noaa3dayforecast.py b/providers/solarconditions/noaa3dayforecast.py index 4fa5e1b..bd30984 100644 --- a/providers/solarconditions/noaa3dayforecast.py +++ b/providers/solarconditions/noaa3dayforecast.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from datetime import date, datetime, timezone @@ -152,11 +150,11 @@ class NOAA3dayForecast(HTTPSolarConditionsProvider): except (ValueError, IndexError): continue - date = column_dates[i] + column_date = column_dates[i] start_dt = datetime( - date.year, - date.month, - date.day, + column_date.year, + column_date.month, + column_date.day, start_hour, 0, 0, diff --git a/providers/solarconditions/solar_conditions_provider.py b/providers/solarconditions/solar_conditions_provider.py index 422c439..4d4aa23 100644 --- a/providers/solarconditions/solar_conditions_provider.py +++ b/providers/solarconditions/solar_conditions_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/spot/aprsis.py b/providers/spot/aprsis.py index fdb6c7f..168d29b 100644 --- a/providers/spot/aprsis.py +++ b/providers/spot/aprsis.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/spot/dxcluster.py b/providers/spot/dxcluster.py index 7523b77..c66ed6e 100644 --- a/providers/spot/dxcluster.py +++ b/providers/spot/dxcluster.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re import socket diff --git a/providers/spot/gma.py b/providers/spot/gma.py index 68e4aaa..d959524 100644 --- a/providers/spot/gma.py +++ b/providers/spot/gma.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any diff --git a/providers/spot/hema.py b/providers/spot/hema.py index 7667d36..bbd1ee9 100644 --- a/providers/spot/hema.py +++ b/providers/spot/hema.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from datetime import datetime diff --git a/providers/spot/http_spot_provider.py b/providers/spot/http_spot_provider.py index d6a3105..20dca27 100644 --- a/providers/spot/http_spot_provider.py +++ b/providers/spot/http_spot_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/spot/llota.py b/providers/spot/llota.py index fc2e88b..abf6e65 100644 --- a/providers/spot/llota.py +++ b/providers/spot/llota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/spot/parksnpeaks.py b/providers/spot/parksnpeaks.py index 60d5507..b130c46 100644 --- a/providers/spot/parksnpeaks.py +++ b/providers/spot/parksnpeaks.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from datetime import datetime diff --git a/providers/spot/pota.py b/providers/spot/pota.py index c358509..3fefeb1 100644 --- a/providers/spot/pota.py +++ b/providers/spot/pota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/spot/rbn.py b/providers/spot/rbn.py index 37a5ef7..b566219 100644 --- a/providers/spot/rbn.py +++ b/providers/spot/rbn.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re import socket diff --git a/providers/spot/sota.py b/providers/spot/sota.py index 51aad76..f6f1d8e 100644 --- a/providers/spot/sota.py +++ b/providers/spot/sota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any, ClassVar diff --git a/providers/spot/spot_provider.py b/providers/spot/spot_provider.py index 499f1e1..da050c7 100644 --- a/providers/spot/spot_provider.py +++ b/providers/spot/spot_provider.py @@ -1,17 +1,11 @@ -from __future__ import annotations - from datetime import datetime -from typing import TYPE_CHECKING, Any +from typing import Any import pytz from core.data_store import DATA_STORE from core.live_data_cache import LiveDataCache - -if TYPE_CHECKING: - # Deferred to avoid a circular import: data.spot imports core.call_lookup_helper, which imports - # core.data_providers, which imports this module. - from data.spot import Spot +from data.spot import Spot class SpotProvider: diff --git a/providers/spot/sse_spot_provider.py b/providers/spot/sse_spot_provider.py index 367ff1f..09bbb82 100644 --- a/providers/spot/sse_spot_provider.py +++ b/providers/spot/sse_spot_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Lock, Thread diff --git a/providers/spot/tiles.py b/providers/spot/tiles.py index 3796180..263804b 100644 --- a/providers/spot/tiles.py +++ b/providers/spot/tiles.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any, ClassVar diff --git a/providers/spot/towers.py b/providers/spot/towers.py index f12c663..cfa533c 100644 --- a/providers/spot/towers.py +++ b/providers/spot/towers.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json from datetime import datetime from typing import Any diff --git a/providers/spot/ukpacketnet.py b/providers/spot/ukpacketnet.py index 4e2dfb5..8e3c6a5 100644 --- a/providers/spot/ukpacketnet.py +++ b/providers/spot/ukpacketnet.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from datetime import datetime from typing import Any diff --git a/providers/spot/websocket_spot_provider.py b/providers/spot/websocket_spot_provider.py index 2c90821..098220d 100644 --- a/providers/spot/websocket_spot_provider.py +++ b/providers/spot/websocket_spot_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/spot/wota.py b/providers/spot/wota.py index 739e4ee..c6751a3 100644 --- a/providers/spot/wota.py +++ b/providers/spot/wota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from datetime import datetime diff --git a/providers/spot/wwbota.py b/providers/spot/wwbota.py index 26d0df1..c9fd201 100644 --- a/providers/spot/wwbota.py +++ b/providers/spot/wwbota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json from datetime import datetime from typing import Any diff --git a/providers/spot/wwff.py b/providers/spot/wwff.py index 83ad763..ae144dd 100644 --- a/providers/spot/wwff.py +++ b/providers/spot/wwff.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/spot/xota.py b/providers/spot/xota.py index 6efc495..17b6736 100644 --- a/providers/spot/xota.py +++ b/providers/spot/xota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json from datetime import datetime from typing import Any diff --git a/providers/spot/zlota.py b/providers/spot/zlota.py index 34c7e35..52f26cd 100644 --- a/providers/spot/zlota.py +++ b/providers/spot/zlota.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/providers/staticdata/cqzonedata.py b/providers/staticdata/cqzonedata.py index a1722a3..09ef807 100644 --- a/providers/staticdata/cqzonedata.py +++ b/providers/staticdata/cqzonedata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import logging from typing import Any diff --git a/providers/staticdata/file_download_static_data_provider.py b/providers/staticdata/file_download_static_data_provider.py index 1ab443e..a0a53cd 100644 --- a/providers/staticdata/file_download_static_data_provider.py +++ b/providers/staticdata/file_download_static_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from threading import Event, Thread diff --git a/providers/staticdata/ituzonedata.py b/providers/staticdata/ituzonedata.py index 8aa6230..8be3523 100644 --- a/providers/staticdata/ituzonedata.py +++ b/providers/staticdata/ituzonedata.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import logging from typing import Any diff --git a/providers/staticdata/k0swe.py b/providers/staticdata/k0swe.py index 996552b..2c5b430 100644 --- a/providers/staticdata/k0swe.py +++ b/providers/staticdata/k0swe.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any diff --git a/providers/staticdata/local_file_static_data_provider.py b/providers/staticdata/local_file_static_data_provider.py index 93f2e0a..444c68b 100644 --- a/providers/staticdata/local_file_static_data_provider.py +++ b/providers/staticdata/local_file_static_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from datetime import datetime from typing import Any diff --git a/providers/staticdata/static_data_provider.py b/providers/staticdata/static_data_provider.py index b177e29..da27215 100644 --- a/providers/staticdata/static_data_provider.py +++ b/providers/staticdata/static_data_provider.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from datetime import datetime from typing import Any diff --git a/spothole.py b/spothole.py index f475654..fe191e9 100644 --- a/spothole.py +++ b/spothole.py @@ -1,6 +1,4 @@ # Main script -from __future__ import annotations - import logging import os import signal diff --git a/static/img/flags/generate.py b/static/img/flags/generate.py index 8e86075..d731e0f 100644 --- a/static/img/flags/generate.py +++ b/static/img/flags/generate.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import os from datetime import timedelta diff --git a/telnetserver/telnetserver.py b/telnetserver/telnetserver.py index 0f12513..3f29b20 100644 --- a/telnetserver/telnetserver.py +++ b/telnetserver/telnetserver.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import asyncio import logging import threading diff --git a/webserver/handlers/api/addspot.py b/webserver/handlers/api/addspot.py index 675116e..cb62e55 100644 --- a/webserver/handlers/api/addspot.py +++ b/webserver/handlers/api/addspot.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re import threading diff --git a/webserver/handlers/api/alerts.py b/webserver/handlers/api/alerts.py index d77b966..30f6959 100644 --- a/webserver/handlers/api/alerts.py +++ b/webserver/handlers/api/alerts.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import copy import logging from datetime import datetime diff --git a/webserver/handlers/api/dxstats.py b/webserver/handlers/api/dxstats.py index 22e0c6e..52b365d 100644 --- a/webserver/handlers/api/dxstats.py +++ b/webserver/handlers/api/dxstats.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import json import logging from collections import Counter diff --git a/webserver/handlers/api/lookups.py b/webserver/handlers/api/lookups.py index 94b0b90..7f1fbc5 100644 --- a/webserver/handlers/api/lookups.py +++ b/webserver/handlers/api/lookups.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from typing import Any diff --git a/webserver/handlers/api/options.py b/webserver/handlers/api/options.py index 36f5383..70274ab 100644 --- a/webserver/handlers/api/options.py +++ b/webserver/handlers/api/options.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any diff --git a/webserver/handlers/api/solar_conditions.py b/webserver/handlers/api/solar_conditions.py index d9d345d..552bc83 100644 --- a/webserver/handlers/api/solar_conditions.py +++ b/webserver/handlers/api/solar_conditions.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any diff --git a/webserver/handlers/api/spots.py b/webserver/handlers/api/spots.py index b05fe55..a6ce3f4 100644 --- a/webserver/handlers/api/spots.py +++ b/webserver/handlers/api/spots.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import copy import logging from datetime import datetime, timedelta diff --git a/webserver/handlers/api/status.py b/webserver/handlers/api/status.py index dc2baf3..007f3ce 100644 --- a/webserver/handlers/api/status.py +++ b/webserver/handlers/api/status.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging from typing import Any diff --git a/webserver/handlers/api/v1_addspot.py b/webserver/handlers/api/v1_addspot.py index 6c138a4..85994c7 100644 --- a/webserver/handlers/api/v1_addspot.py +++ b/webserver/handlers/api/v1_addspot.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import re from typing import Any diff --git a/webserver/handlers/api/v1_compatability.py b/webserver/handlers/api/v1_compatability.py index 8dea95e..9b611b1 100644 --- a/webserver/handlers/api/v1_compatability.py +++ b/webserver/handlers/api/v1_compatability.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import tornado diff --git a/webserver/handlers/api/v1_spots.py b/webserver/handlers/api/v1_spots.py index 172e34c..1b9cd03 100644 --- a/webserver/handlers/api/v1_spots.py +++ b/webserver/handlers/api/v1_spots.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import re from typing import Any diff --git a/webserver/handlers/manifesthandler.py b/webserver/handlers/manifesthandler.py index e5b7500..314e97e 100644 --- a/webserver/handlers/manifesthandler.py +++ b/webserver/handlers/manifesthandler.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import tornado.web from core.config import BASE_URL diff --git a/webserver/handlers/metrics.py b/webserver/handlers/metrics.py index b3fcf23..dc28962 100644 --- a/webserver/handlers/metrics.py +++ b/webserver/handlers/metrics.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import tornado from prometheus_client import CONTENT_TYPE_LATEST diff --git a/webserver/handlers/pagetemplate.py b/webserver/handlers/pagetemplate.py index 91b433a..abd852f 100644 --- a/webserver/handlers/pagetemplate.py +++ b/webserver/handlers/pagetemplate.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from typing import Any import tornado diff --git a/webserver/sse_broadcaster.py b/webserver/sse_broadcaster.py index 1cc33ae..b5de188 100644 --- a/webserver/sse_broadcaster.py +++ b/webserver/sse_broadcaster.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import logging import threading from typing import Any diff --git a/webserver/webserver.py b/webserver/webserver.py index 9a4667d..c02d212 100644 --- a/webserver/webserver.py +++ b/webserver/webserver.py @@ -1,5 +1,3 @@ -from __future__ import annotations - import asyncio import logging import os diff --git a/webserver/webserver_metrics.py b/webserver/webserver_metrics.py index e60799f..d4af0e1 100644 --- a/webserver/webserver_metrics.py +++ b/webserver/webserver_metrics.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from collections import deque from datetime import datetime, timedelta