Skip to content

Commit 884a36a

Browse files
committed
remove deprecated code.
1 parent 88b8b3f commit 884a36a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

not1mm/bandmap.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# pylint: disable=unused-import, c-extension-no-member, no-member, invalid-name, too-many-lines
99

10-
from datetime import datetime
10+
from datetime import datetime, timezone
1111
from decimal import Decimal
1212
from json import JSONDecodeError, loads, dumps
1313
from pathlib import Path
@@ -152,7 +152,8 @@ def get_like_calls(self, call: str) -> dict:
152152
"""
153153
try:
154154
self.cursor.execute(
155-
f"select distinct callsign from spots where callsign like '%{call}%' ORDER by callsign ASC;"
155+
"select distinct callsign from spots where callsign like ",
156+
f"'%{call}%' ORDER by callsign ASC;",
156157
)
157158
result = self.cursor.fetchall()
158159
return result
@@ -215,7 +216,8 @@ def getspots(self) -> list:
215216

216217
def getspotsinband(self, start: float, end: float) -> list:
217218
"""
218-
Returns spots in a list of dicts where the spotted frequency is in the range defined, in ascending order.
219+
Returns spots in a list of dicts where the spotted frequency
220+
is in the range defined, in ascending order.
219221
220222
Parameters
221223
----------
@@ -238,7 +240,8 @@ def get_next_spot(self, current: float, limit: float) -> dict:
238240
def get_matching_spot(self, dx: str, start: float, end: float) -> dict:
239241
"""Return the first spot matching supplied dx partial call"""
240242
self.cursor.execute(
241-
f"select * from spots where freq >= {start} and freq <= {end} and callsign like '%{dx}%';"
243+
f"select * from spots where freq >= {start} ",
244+
f"and freq <= {end} and callsign like '%{dx}%';",
242245
)
243246
return self.cursor.fetchone()
244247

@@ -755,7 +758,7 @@ def receive(self):
755758
comment = " ".join(parts[5:-1])
756759
# spot = DxSpot()
757760
spot = {}
758-
spot["ts"] = datetime.utcnow().isoformat(" ")[:19]
761+
spot["ts"] = datetime.now(timezone.utc).isoformat(" ")[:19]
759762
spot["callsign"] = dx
760763
spot["spotter"] = spotter
761764
spot["comment"] = comment

0 commit comments

Comments
 (0)