More ruff linter fixes

This commit is contained in:
Ian Renton
2026-08-15 08:43:19 +01:00
parent dd89ff4af7
commit a6e54f524d
43 changed files with 99 additions and 153 deletions
+7 -7
View File
@@ -32,7 +32,7 @@ def infer_mode_from_comment(comment):
for mode in ALL_MODES:
if mode in comment.upper():
return mode
for mode in MODE_ALIASES.keys():
for mode in MODE_ALIASES:
if mode in comment.upper():
return MODE_ALIASES[mode]
return None
@@ -101,7 +101,7 @@ def infer_mode_from_frequency(freq):
def get_flag_for_dxcc(dxcc):
"""Get an emoji flag for a given DXCC entity ID"""
dxcc_data = DATA_STORE.dxcc_data[dxcc] if dxcc in DATA_STORE.dxcc_data else None
dxcc_data = DATA_STORE.dxcc_data.get(dxcc, None)
return dxcc_data["flag"] if dxcc_data else None
@@ -113,11 +113,11 @@ def get_callsign_object_from_pyhamtools_callinfo(callsign, callinfo):
home_call = callinfo.get_homecall(callsign)
data = callinfo.get_all(callsign)
country = data["country"] if "country" in data else None
dxcc_id = data["adif"] if "adif" in data else None
continent = data["continent"] if "continent" in data else None
cq_zone = data["cqz"] if "cqz" in data else None
itu_zone = data["ituz"] if "ituz" in data else None
country = data.get("country", None)
dxcc_id = data.get("adif", None)
continent = data.get("continent", None)
cq_zone = data.get("cqz", None)
itu_zone = data.get("ituz", None)
lat = float(data["latitude"]) if "latitude" in data else None
lon = float(data["longitude"]) if "longitude" in data else None
grid = None