7
7
8
8
# pylint: disable=unused-import, c-extension-no-member, no-member, invalid-name, too-many-lines
9
9
10
- from datetime import datetime
10
+ from datetime import datetime , timezone
11
11
from decimal import Decimal
12
12
from json import JSONDecodeError , loads , dumps
13
13
from pathlib import Path
@@ -152,7 +152,8 @@ def get_like_calls(self, call: str) -> dict:
152
152
"""
153
153
try :
154
154
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;" ,
156
157
)
157
158
result = self .cursor .fetchall ()
158
159
return result
@@ -215,7 +216,8 @@ def getspots(self) -> list:
215
216
216
217
def getspotsinband (self , start : float , end : float ) -> list :
217
218
"""
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.
219
221
220
222
Parameters
221
223
----------
@@ -238,7 +240,8 @@ def get_next_spot(self, current: float, limit: float) -> dict:
238
240
def get_matching_spot (self , dx : str , start : float , end : float ) -> dict :
239
241
"""Return the first spot matching supplied dx partial call"""
240
242
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 } %';" ,
242
245
)
243
246
return self .cursor .fetchone ()
244
247
@@ -755,7 +758,7 @@ def receive(self):
755
758
comment = " " .join (parts [5 :- 1 ])
756
759
# spot = DxSpot()
757
760
spot = {}
758
- spot ["ts" ] = datetime .utcnow ( ).isoformat (" " )[:19 ]
761
+ spot ["ts" ] = datetime .now ( timezone . utc ).isoformat (" " )[:19 ]
759
762
spot ["callsign" ] = dx
760
763
spot ["spotter" ] = spotter
761
764
spot ["comment" ] = comment
0 commit comments