not1mm 24.9.11.1__py3-none-any.whl → 24.9.11.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- not1mm/__main__.py +64 -63
- not1mm/lib/lookup.py +24 -114
- not1mm/lib/version.py +1 -1
- not1mm/lookupservice.py +95 -0
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/METADATA +2 -1
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/RECORD +10 -9
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/LICENSE +0 -0
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/WHEEL +0 -0
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/entry_points.txt +0 -0
- {not1mm-24.9.11.1.dist-info → not1mm-24.9.11.2.dist-info}/top_level.txt +0 -0
not1mm/__main__.py
CHANGED
@@ -19,7 +19,6 @@ import os
|
|
19
19
|
import platform
|
20
20
|
import socket
|
21
21
|
import sys
|
22
|
-
import threading
|
23
22
|
import uuid
|
24
23
|
|
25
24
|
from json import dumps, loads
|
@@ -57,7 +56,6 @@ from not1mm.lib.ham_utility import (
|
|
57
56
|
reciprocol,
|
58
57
|
fakefreq,
|
59
58
|
)
|
60
|
-
from not1mm.lib.lookup import HamQTH, QRZlookup
|
61
59
|
from not1mm.lib.multicast import Multicast
|
62
60
|
from not1mm.lib.n1mm import N1MM
|
63
61
|
from not1mm.lib.new_contest import NewContest
|
@@ -76,6 +74,7 @@ from not1mm.bandmap import BandMapWindow
|
|
76
74
|
from not1mm.vfo import VfoWindow
|
77
75
|
from not1mm.radio import Radio
|
78
76
|
from not1mm.voice_keying import Voice
|
77
|
+
from not1mm.lookupservice import LookupService
|
79
78
|
|
80
79
|
poll_time = datetime.datetime.now()
|
81
80
|
|
@@ -172,6 +171,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
172
171
|
check_window = None
|
173
172
|
bandmap_window = None
|
174
173
|
vfo_window = None
|
174
|
+
lookup_service = None
|
175
175
|
|
176
176
|
def __init__(self, *args, **kwargs):
|
177
177
|
super().__init__(*args, **kwargs)
|
@@ -471,6 +471,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
471
471
|
except (IOError, JSONDecodeError, TypeError):
|
472
472
|
logging.CRITICAL("There was an error parsing the BigCity file.")
|
473
473
|
|
474
|
+
self.lookup_service = LookupService()
|
475
|
+
self.lookup_service.hide()
|
476
|
+
|
474
477
|
self.readpreferences()
|
475
478
|
|
476
479
|
self.voice_process = Voice()
|
@@ -1784,12 +1787,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
1784
1787
|
else:
|
1785
1788
|
text = self.callsign.text()
|
1786
1789
|
text = text.upper()
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
)
|
1792
|
-
_thethread.start()
|
1790
|
+
cmd = {}
|
1791
|
+
cmd["cmd"] = "LOOKUP_CALL"
|
1792
|
+
cmd["station"] = platform.node()
|
1793
|
+
cmd["call"] = text
|
1794
|
+
self.multicast_interface.send_as_json(cmd)
|
1793
1795
|
next_tab = self.tab_next.get(self.callsign)
|
1794
1796
|
next_tab.setFocus()
|
1795
1797
|
next_tab.deselect()
|
@@ -2411,18 +2413,18 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2411
2413
|
except (IOError, TypeError, ValueError) as exception:
|
2412
2414
|
logger.critical("Error: %s", exception)
|
2413
2415
|
|
2414
|
-
self.look_up = None
|
2415
|
-
if self.pref.get("useqrz"):
|
2416
|
-
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2416
|
+
# self.look_up = None
|
2417
|
+
# if self.pref.get("useqrz"):
|
2418
|
+
# self.look_up = QRZlookup(
|
2419
|
+
# self.pref.get("lookupusername"),
|
2420
|
+
# self.pref.get("lookuppassword"),
|
2421
|
+
# )
|
2420
2422
|
|
2421
|
-
if self.pref.get("usehamqth"):
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2423
|
+
# if self.pref.get("usehamqth"):
|
2424
|
+
# self.look_up = HamQTH(
|
2425
|
+
# self.pref.get("lookupusername"),
|
2426
|
+
# self.pref.get("lookuppassword"),
|
2427
|
+
# )
|
2426
2428
|
|
2427
2429
|
if self.pref.get("run_state"):
|
2428
2430
|
self.radioButton_run.setChecked(True)
|
@@ -2451,6 +2453,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2451
2453
|
)
|
2452
2454
|
self.multicast_interface.ready_read_connect(self.watch_udp)
|
2453
2455
|
|
2456
|
+
cmd = {}
|
2457
|
+
cmd["cmd"] = "REFRESH_LOOKUP"
|
2458
|
+
cmd["station"] = platform.node()
|
2459
|
+
self.multicast_interface.send_as_json(cmd)
|
2460
|
+
|
2454
2461
|
if self.pref.get("darkmode"):
|
2455
2462
|
self.actionDark_Mode_2.setChecked(True)
|
2456
2463
|
self.setDarkMode(True)
|
@@ -2627,6 +2634,39 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2627
2634
|
self.callsign.setText(json_data.get("call", ""))
|
2628
2635
|
self.callsign.setFocus()
|
2629
2636
|
|
2637
|
+
# '{"cmd": "LOOKUP_RESPONSE", "station": "fredo", "result": {"call": "K6GTE", "aliases": "KM6HQI", "dxcc": "291", "nickname": "Mike", "fname": "Michael C", "name": "Bridak", "addr1": "2854 W Bridgeport Ave", "addr2": "Anaheim", "state": "CA", "zip": "92804", "country": "United States", "lat": "33.825460", "lon": "-117.987510", "grid": "DM13at", "county": "Orange", "ccode": "271", "fips": "06059", "land": "United States", "efdate": "2021-01-13", "expdate": "2027-11-07", "class": "G", "codes": "HVIE", "email": "michael.bridak@gmail.com", "u_views": "3049", "bio": "7232", "biodate": "2023-04-10 17:56:55", "image": "https://cdn-xml.qrz.com/e/k6gte/qsl.png", "imageinfo": "285:545:99376", "moddate": "2021-04-08 21:41:07", "MSA": "5945", "AreaCode": "714", "TimeZone": "Pacific", "GMTOffset": "-8", "DST": "Y", "eqsl": "0", "mqsl": "1", "cqzone": "3", "ituzone": "6", "born": "1967", "lotw": "1", "user": "K6GTE", "geoloc": "geocode", "name_fmt": "Michael C \\"Mike\\" Bridak"}}'
|
2638
|
+
|
2639
|
+
if (
|
2640
|
+
json_data.get("cmd", "") == "LOOKUP_RESPONSE"
|
2641
|
+
and json_data.get("station", "") == platform.node()
|
2642
|
+
):
|
2643
|
+
|
2644
|
+
fname = json_data.get("result", {}).get("fname", "")
|
2645
|
+
name = json_data.get("result", {}).get("name", "")
|
2646
|
+
grid = json_data.get("result", {}).get("grid", "")
|
2647
|
+
error_text = json_data.get("result", {}).get("error_text", "")
|
2648
|
+
nickname = json_data.get("result", {}).get("nickname", "")
|
2649
|
+
|
2650
|
+
if self.contest:
|
2651
|
+
if "General Logging" in self.contest.name:
|
2652
|
+
if nickname:
|
2653
|
+
self.other_1.setText(nickname)
|
2654
|
+
elif fname:
|
2655
|
+
self.other_1.setText(fname)
|
2656
|
+
elif name:
|
2657
|
+
self.other_1.setText(name)
|
2658
|
+
|
2659
|
+
if grid:
|
2660
|
+
self.contact["GridSquare"] = grid
|
2661
|
+
# _theircountry = response.get("country", "")
|
2662
|
+
if self.station.get("GridSquare", ""):
|
2663
|
+
heading = bearing(self.station.get("GridSquare", ""), grid)
|
2664
|
+
kilometers = distance(self.station.get("GridSquare", ""), grid)
|
2665
|
+
self.heading_distance.setText(
|
2666
|
+
f"{grid} Hdg {heading}° LP {reciprocol(heading)}° / "
|
2667
|
+
f"distance {int(kilometers*0.621371)}mi {kilometers}km"
|
2668
|
+
)
|
2669
|
+
|
2630
2670
|
def dark_mode_state_changed(self) -> None:
|
2631
2671
|
"""Called when the Dark Mode menu state is changed."""
|
2632
2672
|
self.pref["darkmode"] = self.actionDark_Mode_2.isChecked()
|
@@ -2848,12 +2888,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
2848
2888
|
self.dupe_indicator.show()
|
2849
2889
|
else:
|
2850
2890
|
self.dupe_indicator.hide()
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
)
|
2856
|
-
_thethread.start()
|
2891
|
+
cmd = {}
|
2892
|
+
cmd["cmd"] = "LOOKUP_CALL"
|
2893
|
+
cmd["station"] = platform.node()
|
2894
|
+
cmd["call"] = stripped_text
|
2895
|
+
self.multicast_interface.send_as_json(cmd)
|
2857
2896
|
self.next_field.setFocus()
|
2858
2897
|
return
|
2859
2898
|
cmd = {}
|
@@ -3008,44 +3047,6 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
3008
3047
|
if self.contest:
|
3009
3048
|
self.contest.prefill(self)
|
3010
3049
|
|
3011
|
-
def check_callsign2(self, callsign) -> None:
|
3012
|
-
"""
|
3013
|
-
Check the callsign after it has been entered.
|
3014
|
-
Look up the callsign in the callsign database.
|
3015
|
-
Get the grid square and calculate the distance and heading.
|
3016
|
-
|
3017
|
-
Parameters
|
3018
|
-
----------
|
3019
|
-
callsign : str
|
3020
|
-
Callsign to check.
|
3021
|
-
|
3022
|
-
Returns
|
3023
|
-
-------
|
3024
|
-
None
|
3025
|
-
"""
|
3026
|
-
|
3027
|
-
callsign = callsign.strip()
|
3028
|
-
debug_lookup = f"{self.look_up}"
|
3029
|
-
logger.debug("%s, %s", callsign, debug_lookup)
|
3030
|
-
if hasattr(self.look_up, "session"):
|
3031
|
-
if self.look_up.session:
|
3032
|
-
response = self.look_up.lookup(callsign)
|
3033
|
-
debug_response = f"{response}"
|
3034
|
-
logger.debug("The Response: %s\n", debug_response)
|
3035
|
-
if response:
|
3036
|
-
theirgrid = response.get("grid", "")
|
3037
|
-
self.contact["GridSquare"] = theirgrid
|
3038
|
-
_theircountry = response.get("country", "")
|
3039
|
-
if self.station.get("GridSquare", ""):
|
3040
|
-
heading = bearing(self.station.get("GridSquare", ""), theirgrid)
|
3041
|
-
kilometers = distance(
|
3042
|
-
self.station.get("GridSquare", ""), theirgrid
|
3043
|
-
)
|
3044
|
-
self.heading_distance.setText(
|
3045
|
-
f"{theirgrid} Hdg {heading}° LP {reciprocol(heading)}° / "
|
3046
|
-
f"distance {int(kilometers*0.621371)}mi {kilometers}km"
|
3047
|
-
)
|
3048
|
-
|
3049
3050
|
def check_dupe(self, call: str) -> bool:
|
3050
3051
|
"""Checks if a callsign is a dupe on current band/mode."""
|
3051
3052
|
if self.contest is None:
|
not1mm/lib/lookup.py
CHANGED
@@ -151,18 +151,21 @@ class QRZlookup:
|
|
151
151
|
payload = {"username": self.username, "password": self.password}
|
152
152
|
query_result = requests.get(self.qrzurl, params=payload, timeout=10.0)
|
153
153
|
baseroot = xmltodict.parse(query_result.text)
|
154
|
-
root = baseroot.get("QRZDatabase")
|
155
|
-
|
156
|
-
|
154
|
+
root = baseroot.get("QRZDatabase", {})
|
155
|
+
self.session = (
|
156
|
+
baseroot.get("QRZDatabase", {}).get("Session", {}).get("Key", "")
|
157
|
+
)
|
158
|
+
self.expiration = (
|
159
|
+
baseroot.get("QRZDatabase", {}).get("Session", {}).get("SubExp", "")
|
160
|
+
)
|
161
|
+
self.error = (
|
162
|
+
baseroot.get("QRZDatabase", {}).get("Session", {}).get("Error", "")
|
163
|
+
)
|
164
|
+
self.message = (
|
165
|
+
baseroot.get("QRZDatabase", {}).get("Session", {}).get("Message", "")
|
166
|
+
)
|
167
|
+
|
157
168
|
logger.info("\n\n%s\n\n", root)
|
158
|
-
if session.get("Key"):
|
159
|
-
self.session = session.get("Key")
|
160
|
-
if session.get("SubExp"):
|
161
|
-
self.expiration = session.get("SubExp")
|
162
|
-
if session.get("Error"):
|
163
|
-
self.error = session.get("Error")
|
164
|
-
if session.get("Message"):
|
165
|
-
self.message = session.get("Message")
|
166
169
|
logger.info(
|
167
170
|
"key:%s error:%s message:%s",
|
168
171
|
self.session,
|
@@ -175,7 +178,7 @@ class QRZlookup:
|
|
175
178
|
self.error = f"{exception}"
|
176
179
|
|
177
180
|
@lru_cache(maxsize=1000)
|
178
|
-
def lookup(self, call: str) ->
|
181
|
+
def lookup(self, call: str) -> dict:
|
179
182
|
"""
|
180
183
|
Lookup a call on QRZ
|
181
184
|
"""
|
@@ -190,9 +193,9 @@ class QRZlookup:
|
|
190
193
|
return {"error": exception}
|
191
194
|
baseroot = xmltodict.parse(query_result.text)
|
192
195
|
logger.debug(f"xml lookup {baseroot}\n")
|
193
|
-
root = baseroot.get("QRZDatabase")
|
196
|
+
root = baseroot.get("QRZDatabase", {})
|
197
|
+
session = baseroot.get("QRZDatabase", {}).get("Session", {})
|
194
198
|
logger.info("\n\n%s\n\n", root)
|
195
|
-
session = root.get("Session")
|
196
199
|
if not session.get("Key"): # key expired get a new one
|
197
200
|
logger.info("no key, getting new one.")
|
198
201
|
self.getsession()
|
@@ -205,98 +208,6 @@ class QRZlookup:
|
|
205
208
|
root = baseroot.get("QRZDatabase")
|
206
209
|
return root.get("Callsign")
|
207
210
|
|
208
|
-
@lru_cache(maxsize=1000)
|
209
|
-
def parse_lookup(self, query_result):
|
210
|
-
"""
|
211
|
-
Returns gridsquare and name for a callsign looked up by qrz or hamdb.
|
212
|
-
Or False for both if none found or error.
|
213
|
-
|
214
|
-
<?xml version="1.0" encoding="utf-8"?>
|
215
|
-
<QRZDatabase version="1.34" xmlns="http://xmldata.qrz.com">
|
216
|
-
<Callsign>
|
217
|
-
<call>K6GTE</call>
|
218
|
-
<aliases>KM6HQI</aliases>
|
219
|
-
<dxcc>291</dxcc>
|
220
|
-
<nickname>Mike</nickname>
|
221
|
-
<fname>Michael C</fname>
|
222
|
-
<name>Bridak</name>
|
223
|
-
<addr1>2854 W Bridgeport Ave</addr1>
|
224
|
-
<addr2>Anaheim</addr2>
|
225
|
-
<state>CA</state>
|
226
|
-
<zip>92804</zip>
|
227
|
-
<country>United States</country>
|
228
|
-
<lat>33.825460</lat>
|
229
|
-
<lon>-117.987510</lon>
|
230
|
-
<grid>DM13at</grid>
|
231
|
-
<county>Orange</county>
|
232
|
-
<ccode>271</ccode>
|
233
|
-
<fips>06059</fips>
|
234
|
-
<land>United States</land>
|
235
|
-
<efdate>2021-01-13</efdate>
|
236
|
-
<expdate>2027-11-07</expdate>
|
237
|
-
<class>G</class>
|
238
|
-
<codes>HVIE</codes>
|
239
|
-
<email>michael.bridak@gmail.com</email>
|
240
|
-
<u_views>1569</u_views>
|
241
|
-
<bio>6399</bio>
|
242
|
-
<biodate>2022-02-26 00:51:44</biodate>
|
243
|
-
<image>https://cdn-xml.qrz.com/e/k6gte/qsl.png</image>
|
244
|
-
<imageinfo>285:545:99376</imageinfo>
|
245
|
-
<moddate>2021-04-08 21:41:07</moddate>
|
246
|
-
<MSA>5945</MSA>
|
247
|
-
<AreaCode>714</AreaCode>
|
248
|
-
<TimeZone>Pacific</TimeZone>
|
249
|
-
<GMTOffset>-8</GMTOffset>
|
250
|
-
<DST>Y</DST>
|
251
|
-
<eqsl>0</eqsl>
|
252
|
-
<mqsl>1</mqsl>
|
253
|
-
<cqzone>3</cqzone>
|
254
|
-
<ituzone>6</ituzone>
|
255
|
-
<born>1967</born>
|
256
|
-
<lotw>1</lotw>
|
257
|
-
<user>K6GTE</user>
|
258
|
-
<geoloc>geocode</geoloc>
|
259
|
-
<name_fmt>Michael C "Mike" Bridak</name_fmt>
|
260
|
-
</Callsign>
|
261
|
-
<Session>
|
262
|
-
<Key>42d5c9736525b485e8edb782b101c74b</Key>
|
263
|
-
<Count>4140</Count>
|
264
|
-
<SubExp>Tue Feb 21 07:01:49 2023</SubExp>
|
265
|
-
<GMTime>Sun May 1 20:00:36 2022</GMTime>
|
266
|
-
<Remark>cpu: 0.022s</Remark>
|
267
|
-
</Session>
|
268
|
-
</QRZDatabase>
|
269
|
-
|
270
|
-
"""
|
271
|
-
logger.info("QRZlookup-parse_lookup:")
|
272
|
-
grid = False
|
273
|
-
name = False
|
274
|
-
error_text = False
|
275
|
-
nickname = False
|
276
|
-
if query_result.status_code == 200:
|
277
|
-
baseroot = xmltodict.parse(query_result.text)
|
278
|
-
root = baseroot.get("QRZDatabase")
|
279
|
-
session = root.get("Session")
|
280
|
-
callsign = root.get("Callsign")
|
281
|
-
logger.info("\n\n%s\n\n", root)
|
282
|
-
if session.get("Error"):
|
283
|
-
error_text = session.get("Error")
|
284
|
-
self.error = error_text
|
285
|
-
if callsign:
|
286
|
-
if callsign.get("grid"):
|
287
|
-
grid = callsign.get("grid")
|
288
|
-
if callsign.get("fname"):
|
289
|
-
name = callsign.get("fname")
|
290
|
-
if callsign.get("name"):
|
291
|
-
if not name:
|
292
|
-
name = callsign.get("name")
|
293
|
-
else:
|
294
|
-
name = f"{name} {callsign.get('name')}"
|
295
|
-
if callsign.get("nickname"):
|
296
|
-
nickname = callsign.get("nickname")
|
297
|
-
logger.info("%s %s %s %s", grid, name, nickname, error_text)
|
298
|
-
return grid, name, nickname, error_text
|
299
|
-
|
300
211
|
|
301
212
|
class HamQTH:
|
302
213
|
"""HamQTH lookup"""
|
@@ -333,7 +244,7 @@ class HamQTH:
|
|
333
244
|
logger.info("session: %s", self.session)
|
334
245
|
|
335
246
|
@lru_cache(maxsize=1000)
|
336
|
-
def lookup(self, call: str) ->
|
247
|
+
def lookup(self, call: str) -> dict:
|
337
248
|
"""
|
338
249
|
Lookup a call on HamQTH
|
339
250
|
"""
|
@@ -353,15 +264,14 @@ class HamQTH:
|
|
353
264
|
logger.info("resultcode: %s", query_result.status_code)
|
354
265
|
|
355
266
|
query_dict = xmltodict.parse(query_result.text)
|
356
|
-
|
357
267
|
the_result["grid"] = (
|
358
268
|
query_dict.get("HamQTH", {}).get("search", {}).get("grid", False)
|
359
269
|
)
|
360
270
|
the_result["name"] = (
|
361
|
-
query_dict.get("HamQTH", {}).get("search", {}).get("
|
271
|
+
query_dict.get("HamQTH", {}).get("search", {}).get("adr_name", False)
|
362
272
|
)
|
363
273
|
the_result["nickname"] = (
|
364
|
-
query_dict.get("HamQTH", {}).get("search", {}).get("
|
274
|
+
query_dict.get("HamQTH", {}).get("search", {}).get("nick", False)
|
365
275
|
)
|
366
276
|
the_result["error_text"] = (
|
367
277
|
query_dict.get("HamQTH", {}).get("session", {}).get("error", False)
|
@@ -376,12 +286,12 @@ class HamQTH:
|
|
376
286
|
query_dict.get("HamQTH", {}).get("search", {}).get("grid", False)
|
377
287
|
)
|
378
288
|
the_result["name"] = (
|
379
|
-
query_dict.get("HamQTH", {}).get("search", {}).get("name", False)
|
380
|
-
)
|
381
|
-
the_result["nickname"] = (
|
382
289
|
query_dict.get("HamQTH", {})
|
383
290
|
.get("search", {})
|
384
|
-
.get("
|
291
|
+
.get("adr_name", False)
|
292
|
+
)
|
293
|
+
the_result["nickname"] = (
|
294
|
+
query_dict.get("HamQTH", {}).get("search", {}).get("nick", False)
|
385
295
|
)
|
386
296
|
the_result["error_text"] = (
|
387
297
|
query_dict.get("HamQTH", {}).get("session", {}).get("error", False)
|
not1mm/lib/version.py
CHANGED
not1mm/lookupservice.py
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
not1mm Contest logger
|
4
|
+
Email: michael.bridak@gmail.com
|
5
|
+
GPL V3
|
6
|
+
Class: BandMapWindow
|
7
|
+
Purpose: Onscreen widget to show realtime spots from an AR cluster.
|
8
|
+
"""
|
9
|
+
|
10
|
+
# pylint: disable=unused-import, c-extension-no-member, no-member, invalid-name, too-many-lines
|
11
|
+
# pylint: disable=logging-fstring-interpolation, line-too-long, no-name-in-module
|
12
|
+
|
13
|
+
import logging
|
14
|
+
import os
|
15
|
+
import platform
|
16
|
+
from json import loads
|
17
|
+
|
18
|
+
from PyQt6.QtWidgets import QDockWidget
|
19
|
+
|
20
|
+
import not1mm.fsutils as fsutils
|
21
|
+
from not1mm.lib.multicast import Multicast
|
22
|
+
from not1mm.lib.lookup import QRZlookup, HamQTH
|
23
|
+
|
24
|
+
logger = logging.getLogger(__name__)
|
25
|
+
|
26
|
+
|
27
|
+
class LookupService(QDockWidget):
|
28
|
+
"""The Lookup Service class."""
|
29
|
+
|
30
|
+
multicast_interface = None
|
31
|
+
|
32
|
+
def __init__(self):
|
33
|
+
super().__init__()
|
34
|
+
self._udpwatch = None
|
35
|
+
|
36
|
+
self.settings = self.get_settings()
|
37
|
+
self.look_up = None
|
38
|
+
if self.settings.get("useqrz"):
|
39
|
+
self.look_up = QRZlookup(
|
40
|
+
self.settings.get("lookupusername"),
|
41
|
+
self.settings.get("lookuppassword"),
|
42
|
+
)
|
43
|
+
|
44
|
+
if self.settings.get("usehamqth"):
|
45
|
+
self.look_up = HamQTH(
|
46
|
+
self.settings.get("lookupusername"),
|
47
|
+
self.settings.get("lookuppassword"),
|
48
|
+
)
|
49
|
+
|
50
|
+
self.multicast_interface = Multicast(
|
51
|
+
self.settings.get("multicast_group", "239.1.1.1"),
|
52
|
+
self.settings.get("multicast_port", 2239),
|
53
|
+
self.settings.get("interface_ip", "0.0.0.0"),
|
54
|
+
)
|
55
|
+
self.multicast_interface.ready_read_connect(self.watch_udp)
|
56
|
+
|
57
|
+
def get_settings(self) -> dict:
|
58
|
+
"""Get the settings."""
|
59
|
+
if os.path.exists(fsutils.CONFIG_FILE):
|
60
|
+
with open(fsutils.CONFIG_FILE, "rt", encoding="utf-8") as file_descriptor:
|
61
|
+
return loads(file_descriptor.read())
|
62
|
+
|
63
|
+
def watch_udp(self):
|
64
|
+
"""doc"""
|
65
|
+
while self.multicast_interface.server_udp.hasPendingDatagrams():
|
66
|
+
packet = self.multicast_interface.read_datagram_as_json()
|
67
|
+
|
68
|
+
if packet.get("station", "") != platform.node():
|
69
|
+
continue
|
70
|
+
if packet.get("cmd", "") == "LOOKUP_CALL":
|
71
|
+
if self.look_up:
|
72
|
+
call = packet.get("call", "")
|
73
|
+
if call:
|
74
|
+
result = self.look_up.lookup(call)
|
75
|
+
cmd = {}
|
76
|
+
cmd["cmd"] = "LOOKUP_RESPONSE"
|
77
|
+
cmd["station"] = platform.node()
|
78
|
+
cmd["result"] = result
|
79
|
+
self.multicast_interface.send_as_json(cmd)
|
80
|
+
continue
|
81
|
+
|
82
|
+
if packet.get("cmd", "") == "REFRESH_LOOKUP":
|
83
|
+
self.settings = self.get_settings()
|
84
|
+
self.look_up = None
|
85
|
+
if self.settings.get("useqrz"):
|
86
|
+
self.look_up = QRZlookup(
|
87
|
+
self.settings.get("lookupusername"),
|
88
|
+
self.settings.get("lookuppassword"),
|
89
|
+
)
|
90
|
+
|
91
|
+
if self.settings.get("usehamqth"):
|
92
|
+
self.look_up = HamQTH(
|
93
|
+
self.settings.get("lookupusername"),
|
94
|
+
self.settings.get("lookuppassword"),
|
95
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: not1mm
|
3
|
-
Version: 24.9.11.
|
3
|
+
Version: 24.9.11.2
|
4
4
|
Summary: NOT1MM Logger
|
5
5
|
Author-email: Michael Bridak <michael.bridak@gmail.com>
|
6
6
|
Project-URL: Homepage, https://github.com/mbridak/not1mm
|
@@ -229,6 +229,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
|
|
229
229
|
|
230
230
|
## Recent Changes
|
231
231
|
|
232
|
+
- [24-9-11-2] Removed all the sketchy threaded call lookups. They're now implimented as a multicast service.
|
232
233
|
- [24-9-11-1] Fixed high clock cycle usage from the FlDigiWatcher class.
|
233
234
|
- [24-9-11] Fixed the HamQTH call lookups.
|
234
235
|
- [24-9-10-2] Removed mapping of FM to PH in the ARRL VHF Cabrillo logs
|
@@ -1,9 +1,10 @@
|
|
1
1
|
not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
not1mm/__main__.py,sha256=
|
2
|
+
not1mm/__main__.py,sha256=R-FYAFvw-6ZcTDezseXene4LPMq7qlKVn_YIjUXSvhE,125870
|
3
3
|
not1mm/bandmap.py,sha256=1b5tXCfGTnpqqn6hPNt7zRA8SmuwSXzSwNHZXhCRt70,31434
|
4
4
|
not1mm/checkwindow.py,sha256=aI-nr8OF90IWV7R_XRdmitvBJ9M85evCs72HoU3Jnvc,10374
|
5
5
|
not1mm/fsutils.py,sha256=ukHKxKTeNKxKwqRaJjtzRShL4X5Xl0jRBbADyy3Ifp8,1701
|
6
6
|
not1mm/logwindow.py,sha256=pwhiwolmGnW01LF4sjlu3ywLsgfxL6KuGuKuYKYmgeY,44403
|
7
|
+
not1mm/lookupservice.py,sha256=TlFPNDdiBSeDVltKrjqaUqQYOBLeXXWnj98UTAiohH4,3251
|
7
8
|
not1mm/radio.py,sha256=eiB04LPMPBeMrBRI021Z7VXth66EOYb0Ujh11T9877c,3362
|
8
9
|
not1mm/test.py,sha256=xbGtnhdoX16C6nrqzLDydqgQtiWxYWmZ2NN74DF-VLM,1736
|
9
10
|
not1mm/vfo.py,sha256=IvmUQYMIPzLJw_BHQGis4J_IEW-vlBtdfxZLXPh7OzI,12335
|
@@ -102,7 +103,7 @@ not1mm/lib/edit_station.py,sha256=doL21Hs6jzIE43ohAopdFt_iqnRJZHFcqzcnCS0-iio,19
|
|
102
103
|
not1mm/lib/fldigi_watcher.py,sha256=reZz3fZLDoJVVZhJD9nIssk2aczCzadDSQTVu-5mTCM,919
|
103
104
|
not1mm/lib/ft8_watcher.py,sha256=npHTjO5mtg3lvYSK6G8BEMMrtZ_1M5xM6Q8NnEQ6MlI,4585
|
104
105
|
not1mm/lib/ham_utility.py,sha256=uRErxCxZr8dfxzekPyett0e_BABDVOCvSUUTzXq6ctE,11790
|
105
|
-
not1mm/lib/lookup.py,sha256=
|
106
|
+
not1mm/lib/lookup.py,sha256=CDIEhnOnmfBIuDQ6xw1lo1uKSlDYaDZNZP-d8l_GFvQ,10675
|
106
107
|
not1mm/lib/multicast.py,sha256=bnFUNHyy82GmIb3_88EPBVVssj7-HzkJPaH671cK8Qw,3249
|
107
108
|
not1mm/lib/n1mm.py,sha256=H54mpgJF0GAmKavM-nb5OAq2SJFWYkux4eMWWiSRxJc,6288
|
108
109
|
not1mm/lib/new_contest.py,sha256=IznTDMq7yXHB6zBoGUEC_WDYPCPpsSZW4wwMJi16zK0,816
|
@@ -111,7 +112,7 @@ not1mm/lib/plugin_common.py,sha256=yefvcX61fXSjs__OPssJqVlZyg1AlcV1VDkl2MQP6kk,9
|
|
111
112
|
not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
|
112
113
|
not1mm/lib/settings.py,sha256=MWiKXbasaFbzeHTjfzTaTqbCBrIijudP_-0a5jNmUAA,9265
|
113
114
|
not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
|
114
|
-
not1mm/lib/version.py,sha256=
|
115
|
+
not1mm/lib/version.py,sha256=dq5oCcglqOILCq1oYnSj0MHS5aDa4S753P-hs3Bb1wg,50
|
115
116
|
not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
|
116
117
|
not1mm/plugins/10_10_fall_cw.py,sha256=IttjX1yy4nDdACGsiYlPteFG8eVseX_WtoFio6bqHE8,10953
|
117
118
|
not1mm/plugins/10_10_spring_cw.py,sha256=ThCptdM3dX4ywhoy2JRcOEyHSqcJolFaT7O_PYzM1Mg,10958
|
@@ -152,9 +153,9 @@ not1mm/plugins/ref_cw.py,sha256=aWjHHkqIKutjRUtzh09y5haFfnZK9poRQDWRQMDRxxU,1632
|
|
152
153
|
not1mm/plugins/stew_perry_topband.py,sha256=CKBQbYl4ETxhXJd2dma4fg_C5pag_s7Nf61SCztZtqE,10668
|
153
154
|
not1mm/plugins/weekly_rtty.py,sha256=DQcy3SY0Zn56EdlYGf3NxrRhTnkNa5IqRQPRQdKDSPs,14255
|
154
155
|
not1mm/plugins/winter_field_day.py,sha256=4rcfRtobwjHO6BNL3WOTHzBmyyeuX79BNGBG8PfjrI8,10238
|
155
|
-
not1mm-24.9.11.
|
156
|
-
not1mm-24.9.11.
|
157
|
-
not1mm-24.9.11.
|
158
|
-
not1mm-24.9.11.
|
159
|
-
not1mm-24.9.11.
|
160
|
-
not1mm-24.9.11.
|
156
|
+
not1mm-24.9.11.2.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
157
|
+
not1mm-24.9.11.2.dist-info/METADATA,sha256=yRXam7ie0CbKMau-UQcDj2nPiJePdBrzHQMPQPFUMoI,31011
|
158
|
+
not1mm-24.9.11.2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
159
|
+
not1mm-24.9.11.2.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
|
160
|
+
not1mm-24.9.11.2.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
|
161
|
+
not1mm-24.9.11.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|