mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Implement Parks n Peaks alert provider. Closes #56
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
@@ -105,6 +106,11 @@ class Alert:
|
||||
if self.dx_calls and not self.dx_names:
|
||||
self.dx_names = list(map(lambda c: lookup_helper.infer_name_from_callsign(c), self.dx_calls))
|
||||
|
||||
# Clean up comments
|
||||
if self.comment:
|
||||
comment = re.sub(r"\(de [A-Za-z0-9]*\)", "", self.comment)
|
||||
self.comment = comment.strip()
|
||||
|
||||
# Always create an ID based on a hash of every parameter *except* received_time. This is used as the index
|
||||
# to a map, which as a byproduct avoids us having multiple duplicate copies of the object that are identical
|
||||
# apart from that they were retrieved from the API at different times. Note that the simple Python hash()
|
||||
|
||||
Reference in New Issue
Block a user