mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 02:21:42 +00:00
Refactor of caching & data storage part 7 #118
This commit is contained in:
@@ -23,14 +23,13 @@ class K0SWE(FileDownloadStaticDataProvider):
|
||||
for dxcc in dxcc_list:
|
||||
dxcc_map[dxcc["entityCode"]] = dxcc
|
||||
|
||||
# Precompile regex matches for DXCCs to improve efficiency when iterating through them
|
||||
for dxcc in dxcc_map.values():
|
||||
dxcc["_prefixRegexCompiled"] = re.compile(dxcc["prefixRegex"])
|
||||
|
||||
# Add to data store
|
||||
for k, v in dxcc_map.items():
|
||||
DATA_STORE.dxcc_data[k] = v
|
||||
|
||||
# Regenerate in-memory regex-to-DXCC-entity-code map.
|
||||
DATA_STORE.regenerateCallRegexToDXCCEntityMap()
|
||||
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user