mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Logging tidy-up, IDE inspection fixes
This commit is contained in:
@@ -1,13 +1,3 @@
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from threading import Thread, Event
|
||||
|
||||
import pytz
|
||||
from requests import ReadTimeout
|
||||
from requests.exceptions import ConnectionError, ConnectTimeout
|
||||
|
||||
from core.constants import HTTP_HEADERS
|
||||
from core.url_data_cache import URLDataCache
|
||||
from providers.callsigndata.callsign_data_provider import CallsignDataProvider
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
import pytz
|
||||
|
||||
@@ -41,8 +41,8 @@ class ClublogAPI(APIQueryCallsignDataProvider):
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from Clublog API", e, exc_info=True)
|
||||
logging.exception("Exception when looking up data from Clublog API")
|
||||
|
||||
return callsign_data
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import gzip
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
||||
import pytz
|
||||
from pyhamtools import LookupLib, Callinfo
|
||||
|
||||
from core.data_store import DATA_STORE
|
||||
@@ -47,8 +45,8 @@ class ClublogXML(FileDownloadCallsignDataProvider):
|
||||
self._callinfo = Callinfo(lookuplib)
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logging.error("Exception when loading Clublog XML.", e, exc_info=True)
|
||||
except Exception:
|
||||
logging.exception("Exception when loading Clublog XML.")
|
||||
return False
|
||||
|
||||
def _perform_new_lookup(self, callsign, lookup_credentials):
|
||||
@@ -62,8 +60,8 @@ class ClublogXML(FileDownloadCallsignDataProvider):
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from Clublog XML data", e, exc_info=True)
|
||||
logging.exception("Exception when looking up data from Clublog XML data")
|
||||
|
||||
return callsign_data
|
||||
|
||||
@@ -26,8 +26,8 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
self._callinfo = Callinfo(lookuplib)
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
logging.error("Exception when loading Country Files cty.plist.", e, exc_info=True)
|
||||
except Exception:
|
||||
logging.exception("Exception when loading Country Files cty.plist.")
|
||||
return False
|
||||
|
||||
def _perform_new_lookup(self, callsign, lookup_credentials):
|
||||
@@ -41,8 +41,8 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from Country file", e, exc_info=True)
|
||||
logging.exception("Exception when looking up data from Country file")
|
||||
|
||||
return callsign_data
|
||||
|
||||
@@ -97,15 +97,15 @@ class HamQTH(APIQueryCallsignDataProvider):
|
||||
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)
|
||||
logging.exception("Exception when looking up callsign %s using HamQTH", lookup_call)
|
||||
continue
|
||||
|
||||
# Not found in HamQTH; return a Callsign object with no data so we cache that and don't keep retrying
|
||||
return Callsign(call=callsign)
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from HamQTH", e, exc_info=True)
|
||||
logging.exception("Exception when looking up data from HamQTH")
|
||||
# Return None, this won't be cached so we will be asked to query data again for this call next time.
|
||||
return None
|
||||
|
||||
|
||||
@@ -106,15 +106,15 @@ class QRZ(APIQueryCallsignDataProvider):
|
||||
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)
|
||||
logging.exception("Exception when looking up callsign %s using QRZ", lookup_call)
|
||||
continue
|
||||
|
||||
# Not found in QRZ; return a Callsign object with no data so we cache that and don't keep retrying
|
||||
return Callsign(call=callsign)
|
||||
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from QRZ.com", e, exc_info=True)
|
||||
logging.exception("Exception when looking up data from QRZ.com")
|
||||
# Return None, this won't be cached so we will be asked to query data again for this call next time.
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user