not1mm 24.9.11.1__py3-none-any.whl → 24.9.12__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/data/main.ui CHANGED
@@ -9,8 +9,8 @@
9
9
  <rect>
10
10
  <x>0</x>
11
11
  <y>0</y>
12
- <width>768</width>
13
- <height>265</height>
12
+ <width>855</width>
13
+ <height>465</height>
14
14
  </rect>
15
15
  </property>
16
16
  <property name="sizePolicy">
@@ -21,7 +21,7 @@
21
21
  </property>
22
22
  <property name="font">
23
23
  <font>
24
- <family>JetBrains Mono</family>
24
+ <family>JetBrains Mono ExtraLight</family>
25
25
  <pointsize>11</pointsize>
26
26
  </font>
27
27
  </property>
@@ -602,7 +602,7 @@
602
602
  <widget class="QLineEdit" name="callsign">
603
603
  <property name="font">
604
604
  <font>
605
- <family>JetBrains Mono</family>
605
+ <family>JetBrains Mono ExtraLight</family>
606
606
  <pointsize>20</pointsize>
607
607
  </font>
608
608
  </property>
@@ -640,7 +640,7 @@
640
640
  <widget class="QLineEdit" name="sent">
641
641
  <property name="font">
642
642
  <font>
643
- <family>JetBrains Mono</family>
643
+ <family>JetBrains Mono ExtraLight</family>
644
644
  <pointsize>20</pointsize>
645
645
  </font>
646
646
  </property>
@@ -675,7 +675,7 @@
675
675
  <widget class="QLineEdit" name="receive">
676
676
  <property name="font">
677
677
  <font>
678
- <family>JetBrains Mono</family>
678
+ <family>JetBrains Mono ExtraLight</family>
679
679
  <pointsize>20</pointsize>
680
680
  </font>
681
681
  </property>
@@ -710,7 +710,7 @@
710
710
  <widget class="QLineEdit" name="other_1">
711
711
  <property name="font">
712
712
  <font>
713
- <family>JetBrains Mono</family>
713
+ <family>JetBrains Mono ExtraLight</family>
714
714
  <pointsize>20</pointsize>
715
715
  </font>
716
716
  </property>
@@ -751,7 +751,7 @@
751
751
  <widget class="QLineEdit" name="other_2">
752
752
  <property name="font">
753
753
  <font>
754
- <family>JetBrains Mono</family>
754
+ <family>JetBrains Mono ExtraLight</family>
755
755
  <pointsize>20</pointsize>
756
756
  </font>
757
757
  </property>
@@ -873,7 +873,7 @@
873
873
  </property>
874
874
  <property name="font">
875
875
  <font>
876
- <family>JetBrains Mono</family>
876
+ <family>JetBrains Mono ExtraLight</family>
877
877
  <pointsize>20</pointsize>
878
878
  <bold>true</bold>
879
879
  </font>
@@ -1301,7 +1301,7 @@
1301
1301
  <widget class="QMenu" name="menuFile">
1302
1302
  <property name="font">
1303
1303
  <font>
1304
- <family>JetBrains Mono</family>
1304
+ <family>JetBrains Mono ExtraLight</family>
1305
1305
  <pointsize>11</pointsize>
1306
1306
  </font>
1307
1307
  </property>
@@ -1374,7 +1374,7 @@
1374
1374
  </property>
1375
1375
  <property name="font">
1376
1376
  <font>
1377
- <family>JetBrains Mono</family>
1377
+ <family>JetBrains Mono ExtraLight</family>
1378
1378
  </font>
1379
1379
  </property>
1380
1380
  <property name="autoRepeat">
@@ -1405,7 +1405,7 @@
1405
1405
  </property>
1406
1406
  <property name="font">
1407
1407
  <font>
1408
- <family>JetBrains Mono</family>
1408
+ <family>JetBrains Mono ExtraLight</family>
1409
1409
  </font>
1410
1410
  </property>
1411
1411
  <property name="autoRepeat">
@@ -1430,7 +1430,7 @@
1430
1430
  </property>
1431
1431
  <property name="font">
1432
1432
  <font>
1433
- <family>JetBrains Mono</family>
1433
+ <family>JetBrains Mono ExtraLight</family>
1434
1434
  </font>
1435
1435
  </property>
1436
1436
  <property name="autoRepeat">
@@ -1455,7 +1455,7 @@
1455
1455
  </property>
1456
1456
  <property name="font">
1457
1457
  <font>
1458
- <family>JetBrains Mono</family>
1458
+ <family>JetBrains Mono ExtraLight</family>
1459
1459
  </font>
1460
1460
  </property>
1461
1461
  </action>
@@ -1471,7 +1471,7 @@
1471
1471
  </property>
1472
1472
  <property name="font">
1473
1473
  <font>
1474
- <family>JetBrains Mono</family>
1474
+ <family>JetBrains Mono ExtraLight</family>
1475
1475
  </font>
1476
1476
  </property>
1477
1477
  <property name="autoRepeat">
@@ -1490,7 +1490,7 @@
1490
1490
  </property>
1491
1491
  <property name="font">
1492
1492
  <font>
1493
- <family>JetBrains Mono</family>
1493
+ <family>JetBrains Mono ExtraLight</family>
1494
1494
  </font>
1495
1495
  </property>
1496
1496
  <property name="autoRepeat">
@@ -1509,7 +1509,7 @@
1509
1509
  </property>
1510
1510
  <property name="font">
1511
1511
  <font>
1512
- <family>JetBrains Mono</family>
1512
+ <family>JetBrains Mono ExtraLight</family>
1513
1513
  </font>
1514
1514
  </property>
1515
1515
  </action>
@@ -1519,7 +1519,7 @@
1519
1519
  </property>
1520
1520
  <property name="font">
1521
1521
  <font>
1522
- <family>JetBrains Mono</family>
1522
+ <family>JetBrains Mono ExtraLight</family>
1523
1523
  </font>
1524
1524
  </property>
1525
1525
  <property name="autoRepeat">
@@ -1538,7 +1538,7 @@
1538
1538
  </property>
1539
1539
  <property name="font">
1540
1540
  <font>
1541
- <family>JetBrains Mono</family>
1541
+ <family>JetBrains Mono ExtraLight</family>
1542
1542
  </font>
1543
1543
  </property>
1544
1544
  <property name="autoRepeat">
@@ -1560,7 +1560,7 @@
1560
1560
  </property>
1561
1561
  <property name="font">
1562
1562
  <font>
1563
- <family>JetBrains Mono</family>
1563
+ <family>JetBrains Mono ExtraLight</family>
1564
1564
  </font>
1565
1565
  </property>
1566
1566
  <property name="autoRepeat">
@@ -1579,7 +1579,7 @@
1579
1579
  </property>
1580
1580
  <property name="font">
1581
1581
  <font>
1582
- <family>JetBrains Mono</family>
1582
+ <family>JetBrains Mono ExtraLight</family>
1583
1583
  </font>
1584
1584
  </property>
1585
1585
  <property name="shortcut">
@@ -1601,7 +1601,7 @@
1601
1601
  </property>
1602
1602
  <property name="font">
1603
1603
  <font>
1604
- <family>JetBrains Mono</family>
1604
+ <family>JetBrains Mono ExtraLight</family>
1605
1605
  </font>
1606
1606
  </property>
1607
1607
  <property name="autoRepeat">
@@ -1620,7 +1620,7 @@
1620
1620
  </property>
1621
1621
  <property name="font">
1622
1622
  <font>
1623
- <family>JetBrains Mono</family>
1623
+ <family>JetBrains Mono ExtraLight</family>
1624
1624
  </font>
1625
1625
  </property>
1626
1626
  <property name="autoRepeat">
@@ -1639,7 +1639,7 @@
1639
1639
  </property>
1640
1640
  <property name="font">
1641
1641
  <font>
1642
- <family>JetBrains Mono</family>
1642
+ <family>JetBrains Mono ExtraLight</family>
1643
1643
  </font>
1644
1644
  </property>
1645
1645
  <property name="autoRepeat">
@@ -1658,7 +1658,7 @@
1658
1658
  </property>
1659
1659
  <property name="font">
1660
1660
  <font>
1661
- <family>JetBrains Mono</family>
1661
+ <family>JetBrains Mono ExtraLight</family>
1662
1662
  </font>
1663
1663
  </property>
1664
1664
  <property name="autoRepeat">
@@ -1677,7 +1677,7 @@
1677
1677
  </property>
1678
1678
  <property name="font">
1679
1679
  <font>
1680
- <family>JetBrains Mono</family>
1680
+ <family>JetBrains Mono ExtraLight</family>
1681
1681
  </font>
1682
1682
  </property>
1683
1683
  <property name="autoRepeat">
@@ -1696,7 +1696,7 @@
1696
1696
  </property>
1697
1697
  <property name="font">
1698
1698
  <font>
1699
- <family>JetBrains Mono</family>
1699
+ <family>JetBrains Mono ExtraLight</family>
1700
1700
  </font>
1701
1701
  </property>
1702
1702
  <property name="autoRepeat">
@@ -1715,7 +1715,7 @@
1715
1715
  </property>
1716
1716
  <property name="font">
1717
1717
  <font>
1718
- <family>JetBrains Mono</family>
1718
+ <family>JetBrains Mono ExtraLight</family>
1719
1719
  </font>
1720
1720
  </property>
1721
1721
  </action>
@@ -1728,7 +1728,7 @@
1728
1728
  </property>
1729
1729
  <property name="font">
1730
1730
  <font>
1731
- <family>JetBrains Mono</family>
1731
+ <family>JetBrains Mono ExtraLight</family>
1732
1732
  </font>
1733
1733
  </property>
1734
1734
  </action>
@@ -1743,7 +1743,7 @@
1743
1743
  </property>
1744
1744
  <property name="font">
1745
1745
  <font>
1746
- <family>JetBrains Mono</family>
1746
+ <family>JetBrains Mono ExtraLight</family>
1747
1747
  </font>
1748
1748
  </property>
1749
1749
  </action>
@@ -1758,7 +1758,7 @@
1758
1758
  </property>
1759
1759
  <property name="font">
1760
1760
  <font>
1761
- <family>JetBrains Mono</family>
1761
+ <family>JetBrains Mono ExtraLight</family>
1762
1762
  </font>
1763
1763
  </property>
1764
1764
  </action>
@@ -1776,7 +1776,7 @@
1776
1776
  </property>
1777
1777
  <property name="font">
1778
1778
  <font>
1779
- <family>JetBrains Mono</family>
1779
+ <family>JetBrains Mono ExtraLight</family>
1780
1780
  </font>
1781
1781
  </property>
1782
1782
  </action>
@@ -1789,7 +1789,7 @@
1789
1789
  </property>
1790
1790
  <property name="font">
1791
1791
  <font>
1792
- <family>JetBrains Mono</family>
1792
+ <family>JetBrains Mono ExtraLight</family>
1793
1793
  </font>
1794
1794
  </property>
1795
1795
  </action>
@@ -1802,7 +1802,7 @@
1802
1802
  </property>
1803
1803
  <property name="font">
1804
1804
  <font>
1805
- <family>JetBrains Mono</family>
1805
+ <family>JetBrains Mono ExtraLight</family>
1806
1806
  </font>
1807
1807
  </property>
1808
1808
  </action>
@@ -12,7 +12,7 @@
12
12
  </property>
13
13
  <property name="font">
14
14
  <font>
15
- <family>JetBrains Mono</family>
15
+ <family>JetBrains Mono ExtraLight</family>
16
16
  </font>
17
17
  </property>
18
18
  <property name="windowTitle">
@@ -166,7 +166,7 @@
166
166
  <widget class="QLabel" name="title">
167
167
  <property name="font">
168
168
  <font>
169
- <family>JetBrains Mono</family>
169
+ <family>JetBrains Mono ExtraLight</family>
170
170
  <pointsize>14</pointsize>
171
171
  <bold>true</bold>
172
172
  </font>
not1mm/data/opon.ui CHANGED
@@ -12,7 +12,7 @@
12
12
  </property>
13
13
  <property name="font">
14
14
  <font>
15
- <family>JetBrains Mono</family>
15
+ <family>JetBrains Mono ExtraLight</family>
16
16
  </font>
17
17
  </property>
18
18
  <property name="windowTitle">
@@ -10,6 +10,11 @@
10
10
  <height>246</height>
11
11
  </rect>
12
12
  </property>
13
+ <property name="font">
14
+ <font>
15
+ <family>JetBrains Mono ExtraLight</family>
16
+ </font>
17
+ </property>
13
18
  <property name="windowTitle">
14
19
  <string>Choose a Contest</string>
15
20
  </property>
not1mm/data/settings.ui CHANGED
@@ -12,7 +12,7 @@
12
12
  </property>
13
13
  <property name="font">
14
14
  <font>
15
- <family>JetBrains Mono</family>
15
+ <family>JetBrains Mono ExtraLight</family>
16
16
  </font>
17
17
  </property>
18
18
  <property name="windowTitle">
not1mm/data/vfo.ui CHANGED
@@ -12,7 +12,7 @@
12
12
  </property>
13
13
  <property name="font">
14
14
  <font>
15
- <family>JetBrains Mono</family>
15
+ <family>JetBrains Mono ExtraLight</family>
16
16
  </font>
17
17
  </property>
18
18
  <property name="features">
@@ -42,7 +42,7 @@
42
42
  </property>
43
43
  <property name="font">
44
44
  <font>
45
- <family>JetBrains Mono</family>
45
+ <family>JetBrains Mono ExtraLight</family>
46
46
  <pointsize>25</pointsize>
47
47
  </font>
48
48
  </property>
not1mm/lib/ft8_watcher.py CHANGED
@@ -138,6 +138,6 @@ class FT8Watcher:
138
138
  if tag == ["EOR>"]:
139
139
  break
140
140
  self.datadict[tag[0]] = tag[1].split(">")[1].strip()
141
-
141
+ # print(f"\n{self.datadict}\n")
142
142
  if self.callback:
143
143
  self.callback(self.datadict)
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
- if root:
156
- session = root.get("Session")
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) -> tuple:
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) -> tuple:
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("name", False)
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("nickname", False)
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("nickname", False)
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
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.9.11.1"
3
+ __version__ = "24.9.12"
@@ -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
+ )