diff --git a/alertproviders/http_alert_provider.py b/alertproviders/http_alert_provider.py index df79177..9bef504 100644 --- a/alertproviders/http_alert_provider.py +++ b/alertproviders/http_alert_provider.py @@ -4,7 +4,7 @@ from threading import Thread, Event import pytz import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from alertproviders.alert_provider import AlertProvider from core.constants import HTTP_HEADERS @@ -59,8 +59,8 @@ class HTTPAlertProvider(AlertProvider): except ConnectionError: logging.warning(f"Connection error when accessing {self.name} alerts API.") - except ReadTimeout: - logging.warning(f"Read timeout when accessing {self.name} alerts API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing {self.name} alerts API.") except Exception: self.status = "Error" logging.exception("Exception in HTTP JSON Alert Provider (" + self.name + ")") diff --git a/core/lookup_helper.py b/core/lookup_helper.py index e9c9641..8d8dec4 100644 --- a/core/lookup_helper.py +++ b/core/lookup_helper.py @@ -11,7 +11,7 @@ from pyhamtools import LookupLib, Callinfo, callinfo from pyhamtools.exceptions import APIKeyMissingError from pyhamtools.frequency import freq_to_band from pyhamtools.locator import latlong_to_locator -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from requests_cache import CachedSession from core.cache_utils import SEMI_STATIC_URL_DATA_CACHE @@ -156,8 +156,8 @@ class LookupHelper: except ConnectionError: logging.warning(f"Connection error when downloading Clublog cty.xml.") - except ReadTimeout: - logging.warning(f"Read timeout when downloading Clublog cty.xml.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when downloading Clublog cty.xml.") except Exception as e: logging.error("Exception when downloading Clublog cty.xml", e) return False @@ -182,8 +182,8 @@ class LookupHelper: except ConnectionError: logging.warning(f"Connection error when downloading dxcc.json.") - except ReadTimeout: - logging.warning(f"Read timeout when downloading dxcc.json.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when downloading dxcc.json.") except Exception as e: logging.error("Exception when downloading dxcc.json", e) return False @@ -541,8 +541,8 @@ class LookupHelper: except ConnectionError: logging.warning(f"Connection error when looking up callsign %s using QRZ", lookup_call) continue - except ReadTimeout: - logging.warning(f"Read timeout when looking up callsign %s using QRZ.", lookup_call) + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when looking up callsign %s using QRZ.", lookup_call) continue except Exception: logging.error("Exception when looking up callsign %s using QRZ", lookup_call, exc_info=True) @@ -608,8 +608,8 @@ class LookupHelper: except ConnectionError: logging.warning(f"Connection error when looking up callsign %s using HamQTH", lookup_call) continue - except ReadTimeout: - logging.warning(f"Read timeout when looking up callsign %s using HamQTH", lookup_call) + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when looking up callsign %s using HamQTH", lookup_call) continue except Exception: logging.error("Exception when looking up callsign %s using HamQTH", lookup_call, exc_info=True) diff --git a/core/sig_utils.py b/core/sig_utils.py index 8f0fa98..2fd96b5 100644 --- a/core/sig_utils.py +++ b/core/sig_utils.py @@ -2,7 +2,7 @@ import csv import logging from pyhamtools.locator import latlong_to_locator, locator_to_latlong -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.cache_utils import SEMI_STATIC_URL_DATA_CACHE from core.constants import SIGS, HTTP_HEADERS @@ -271,8 +271,8 @@ def populate_sig_ref_info(sig_ref): except ConnectionError: logging.warning("Connection error when looking up sig_ref info for " + sig + " ref " + ref_id) - except ReadTimeout: - logging.warning(f"Read timeout when looking up sig_ref info for " + sig + " ref " + ref_id) + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when looking up sig_ref info for " + sig + " ref " + ref_id) except Exception: logging.error("Exception when looking up sig_ref info for " + sig + " ref " + ref_id, exc_info=True) return sig_ref diff --git a/solarconditionsproviders/giroionosonde.py b/solarconditionsproviders/giroionosonde.py index 03d7b02..1c5795f 100644 --- a/solarconditionsproviders/giroionosonde.py +++ b/solarconditionsproviders/giroionosonde.py @@ -5,7 +5,7 @@ from threading import Thread, Event import pytz import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.constants import HTTP_HEADERS from solarconditionsproviders.ionosonde_utils import compute_band_states @@ -134,8 +134,8 @@ class GIROIonosonde(SolarConditionsProvider): logging.warning(f"HTTP {http_response.status_code} when calling Giro ionosonde API.") return None, None, None return self._parse_all(http_response.text) - except ReadTimeout: - logging.warning(f"Read timeout when accessing Giro ionosonde API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing Giro ionosonde API.") return None, None, None except ConnectionError: logging.warning("Connection error when accessing Giro ionosonde API.") diff --git a/solarconditionsproviders/http_solar_conditions_provider.py b/solarconditionsproviders/http_solar_conditions_provider.py index ddd3be9..0f7903e 100644 --- a/solarconditionsproviders/http_solar_conditions_provider.py +++ b/solarconditionsproviders/http_solar_conditions_provider.py @@ -4,7 +4,7 @@ from threading import Thread, Event import pytz import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.constants import HTTP_HEADERS from solarconditionsproviders.solar_conditions_provider import SolarConditionsProvider @@ -54,8 +54,8 @@ class HTTPSolarConditionsProvider(SolarConditionsProvider): except ConnectionError: logging.warning(f"Connection error when accessing {self.name} solar conditions API.") - except ReadTimeout: - logging.warning(f"Read timeout when accessing {self.name} solar conditions API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing {self.name} solar conditions API.") except Exception: self.status = "Error" logging.exception("Exception in HTTP Solar Conditions Provider (" + self.name + ")") diff --git a/solarconditionsproviders/kc2gprop.py b/solarconditionsproviders/kc2gprop.py index 1d879a1..16af204 100644 --- a/solarconditionsproviders/kc2gprop.py +++ b/solarconditionsproviders/kc2gprop.py @@ -4,7 +4,7 @@ from threading import Thread, Event import pytz import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.constants import HTTP_HEADERS from solarconditionsproviders.ionosonde_utils import compute_band_states @@ -118,8 +118,8 @@ class KC2GProp(SolarConditionsProvider): except ConnectionError: logging.warning("Connection error when accessing KC2G ionosonde API.") - except ReadTimeout: - logging.warning(f"Read timeout when accessing KC2G ionosonde API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing KC2G ionosonde API.") except Exception: self.status = "Error" logging.exception("Exception in KC2G ionosonde data provider") diff --git a/spotproviders/hema.py b/spotproviders/hema.py index 62d8d61..b5d2d13 100644 --- a/spotproviders/hema.py +++ b/spotproviders/hema.py @@ -4,7 +4,7 @@ from datetime import datetime import pytz import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.constants import HTTP_HEADERS from data.sig_ref import SIGRef @@ -68,8 +68,8 @@ class HEMA(HTTPSpotProvider): # Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other # code will do that for us. new_spots.append(spot) - except ReadTimeout: - logging.warning(f"Read timeout when accessing HEMA spots API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing HEMA spots API.") except ConnectionError: logging.warning("Connection error when accessing HEMA spots API.") return new_spots diff --git a/spotproviders/http_spot_provider.py b/spotproviders/http_spot_provider.py index c851bb0..bf083a5 100644 --- a/spotproviders/http_spot_provider.py +++ b/spotproviders/http_spot_provider.py @@ -5,7 +5,7 @@ from threading import Thread, Event import pytz import requests from requests import ReadTimeout -from requests.exceptions import ConnectionError +from requests.exceptions import ConnectionError, ConnectTimeout from core.constants import HTTP_HEADERS from spotproviders.spot_provider import SpotProvider @@ -60,8 +60,8 @@ class HTTPSpotProvider(SpotProvider): except ConnectionError: logging.warning(f"Connection error when accessing {self.name} spots API.") - except ReadTimeout: - logging.warning(f"Read timeout when accessing {self.name} spots API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing {self.name} spots API.") except Exception: self.status = "Error" logging.exception("Exception in HTTP JSON Spot Provider (" + self.name + ")") diff --git a/spotproviders/sota.py b/spotproviders/sota.py index 750753b..eef05b4 100644 --- a/spotproviders/sota.py +++ b/spotproviders/sota.py @@ -2,7 +2,7 @@ import logging from datetime import datetime import requests -from requests.exceptions import ConnectionError, ReadTimeout +from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout from core.constants import HTTP_HEADERS from data.sig_ref import SIGRef @@ -60,6 +60,6 @@ class SOTA(HTTPSpotProvider): new_spots.append(spot) except ConnectionError: logging.warning("Connection error when accessing SOTA spots API") - except ReadTimeout: - logging.warning(f"Read timeout when accessing SOTA spots API.") + except (ConnectTimeout, ReadTimeout): + logging.warning(f"Timeout when accessing SOTA spots API.") return new_spots diff --git a/templates/add_spot.html b/templates/add_spot.html index afa63e7..91cbe33 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index cdde5e5..61ba018 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index d0cf2b0..4a3e712 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -75,8 +75,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index ad0ee39..66bc487 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}
diff --git a/templates/conditions.html b/templates/conditions.html index 373f0df..06b5f45 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -284,7 +284,7 @@
- + diff --git a/templates/map.html b/templates/map.html index 8f9b1af..5eb5524 100644 --- a/templates/map.html +++ b/templates/map.html @@ -108,8 +108,8 @@ - - + + diff --git a/templates/spots.html b/templates/spots.html index a2a975e..deeb2ee 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -116,8 +116,8 @@ - - + + diff --git a/templates/status.html b/templates/status.html index a1fbaa2..a3e4e7f 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,7 +59,7 @@ - +