mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
More ruff linter fixes
This commit is contained in:
+7
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user