not1mm 24.9.10.1__py3-none-any.whl → 24.9.11__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/lib/lookup.py CHANGED
@@ -323,7 +323,7 @@ class HamQTH:
323
323
  return
324
324
  logger.info("resultcode: %s", query_result.status_code)
325
325
  baseroot = xmltodict.parse(query_result.text)
326
- root = baseroot.get("HamQTH")
326
+ root = baseroot.get("HamQTH", {})
327
327
  session = root.get("session")
328
328
  if session:
329
329
  if session.get("session_id"):
@@ -344,55 +344,49 @@ class HamQTH:
344
344
  "error_text": False,
345
345
  }
346
346
  if self.session:
347
- payload = {"id": self.session, "callsign": call, "prg": "wfdlogger"}
347
+ payload = {"id": self.session, "callsign": call, "prg": "not1mm"}
348
348
  try:
349
349
  query_result = requests.get(self.url, params=payload, timeout=10.0)
350
350
  except requests.exceptions.Timeout:
351
351
  self.error = True
352
352
  return the_result
353
353
  logger.info("resultcode: %s", query_result.status_code)
354
- baseroot = xmltodict.parse(query_result.text)
355
- root = baseroot.get("HamQTH")
356
- search = root.get("search")
357
- session = root.get("session")
358
- if not search:
359
- if session:
360
- if session.get("error"):
361
- if session.get("error") == "Callsign not found":
362
- the_result["error_text"] = session.get("error")
363
- return the_result
364
- if session.get("error") == "Session does not exist or expired":
365
- self.getsession()
366
- query_result = requests.get(
367
- self.url, params=payload, timeout=10.0
368
- )
369
- the_result = self.parse_lookup(root)
370
- return the_result
371
354
 
372
- @lru_cache(maxsize=1000)
373
- def parse_lookup(self, root) -> dict:
374
- """
375
- Returns gridsquare and name for a callsign
376
- Or False for both if none found or error.
377
- """
378
- the_result = {
379
- "grid": False,
380
- "name": False,
381
- "nickname": False,
382
- "error_text": False,
383
- }
384
- session = root.get("session")
385
- search = root.get("search")
386
- if session:
387
- if session.get("error"):
388
- the_result["error_text"] = session.get("error")
389
- if search:
390
- if search.get("grid"):
391
- the_result["grid"] = search.get("grid")
392
- if search.get("nick"):
393
- the_result["nickname"] = search.get("nick")
394
- if search.get("adr_name"):
395
- the_result["name"] = search.get("adr_name")
355
+ query_dict = xmltodict.parse(query_result.text)
356
+
357
+ the_result["grid"] = (
358
+ query_dict.get("HamQTH", {}).get("search", {}).get("grid", False)
359
+ )
360
+ the_result["name"] = (
361
+ query_dict.get("HamQTH", {}).get("search", {}).get("name", False)
362
+ )
363
+ the_result["nickname"] = (
364
+ query_dict.get("HamQTH", {}).get("search", {}).get("nickname", False)
365
+ )
366
+ the_result["error_text"] = (
367
+ query_dict.get("HamQTH", {}).get("session", {}).get("error", False)
368
+ )
369
+
370
+ if the_result.get("error_text") == "Callsign not found":
371
+ return the_result
372
+ if the_result.get("error_text") == "Session does not exist or expired":
373
+ self.getsession()
374
+ query_result = requests.get(self.url, params=payload, timeout=10.0)
375
+ the_result["grid"] = (
376
+ query_dict.get("HamQTH", {}).get("search", {}).get("grid", False)
377
+ )
378
+ the_result["name"] = (
379
+ query_dict.get("HamQTH", {}).get("search", {}).get("name", False)
380
+ )
381
+ the_result["nickname"] = (
382
+ query_dict.get("HamQTH", {})
383
+ .get("search", {})
384
+ .get("nickname", False)
385
+ )
386
+ the_result["error_text"] = (
387
+ query_dict.get("HamQTH", {}).get("session", {}).get("error", False)
388
+ )
389
+
396
390
  return the_result
397
391
 
398
392
 
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.9.10.1"
3
+ __version__ = "24.9.11"
@@ -379,7 +379,7 @@ def cabrillo(self):
379
379
  for contact in log:
380
380
  the_date_and_time = contact.get("TS", "")
381
381
  themode = contact.get("Mode", "")
382
- if themode in ("LSB", "USB", "FM", "AM"):
382
+ if themode in ("LSB", "USB", "AM"):
383
383
  themode = "PH"
384
384
  if themode in (
385
385
  "FT8",
@@ -347,7 +347,7 @@ def cabrillo(self):
347
347
  for contact in log:
348
348
  the_date_and_time = contact.get("TS", "")
349
349
  themode = contact.get("Mode", "")
350
- if themode in ("LSB", "USB", "FM", "AM"):
350
+ if themode in ("LSB", "USB", "AM"):
351
351
  themode = "PH"
352
352
  if themode in (
353
353
  "FT8",
@@ -347,7 +347,7 @@ def cabrillo(self):
347
347
  for contact in log:
348
348
  the_date_and_time = contact.get("TS", "")
349
349
  themode = contact.get("Mode", "")
350
- if themode in ("LSB", "USB", "FM", "AM"):
350
+ if themode in ("LSB", "USB", "AM"):
351
351
  themode = "PH"
352
352
  if themode in (
353
353
  "FT8",
not1mm/test.py CHANGED
@@ -1,6 +1,13 @@
1
- import xmlrpc.client
1
+ import xmltodict
2
2
 
3
- target = "http://127.0.0.1:8421"
4
- server = xmlrpc.client.ServerProxy(target)
5
- adif = "<QSO_DATE:8>20150721<QSO_DATE_OFF:8>20150721<TIME_ON:4>1333<TIME_OFF:6>133436<CALL:5>N3FJP<FREQ:8>3.081500<MODE:0><RST_SENT:0><RST_RCVD:0><TX_PWR:0><NAME:5>Glenn<QTH:7>Bel Air<STATE:2>MD<VE_PROV:0><COUNTRY:13>United States<GRIDSQUARE:6>FM19tm<STX:0><SRX:0><SRX_STRING:0><STX_STRING:0><NOTES:0><IOTA:0><DXCC:0><QSL_VIA:0><QSLRDATE:0><QSLSDATE:0><eor>"
6
- response = server.log.add_record(adif)
3
+ # import xmlrpc.client
4
+
5
+ # target = "http://127.0.0.1:8421"
6
+ # server = xmlrpc.client.ServerProxy(target)
7
+ # adif = "<QSO_DATE:8>20150721<QSO_DATE_OFF:8>20150721<TIME_ON:4>1333<TIME_OFF:6>133436<CALL:5>N3FJP<FREQ:8>3.081500<MODE:0><RST_SENT:0><RST_RCVD:0><TX_PWR:0><NAME:5>Glenn<QTH:7>Bel Air<STATE:2>MD<VE_PROV:0><COUNTRY:13>United States<GRIDSQUARE:6>FM19tm<STX:0><SRX:0><SRX_STRING:0><STX_STRING:0><NOTES:0><IOTA:0><DXCC:0><QSL_VIA:0><QSLRDATE:0><QSLSDATE:0><eor>"
8
+ # response = server.log.add_record(adif)
9
+
10
+
11
+ xml = '<?xml version="1.0"?>\n<HamQTH version="2.8" xmlns="https://www.hamqth.com">\n <search>\n <callsign>K6GTE</callsign>\n <nick>Mike</nick>\n <qth>Anaheim</qth>\n <country>United States</country>\n <adif>291</adif>\n <itu>6</itu>\n <cq>3</cq>\n <grid>DM13AT</grid>\n <adr_name>Michael C Bridak</adr_name>\n <adr_street1>2854 W Bridgeport Ave</adr_street1>\n <adr_city>Anaheim</adr_city>\n <adr_zip>92804</adr_zip>\n <adr_country>United States</adr_country>\n <adr_adif>291</adr_adif>\n <us_state>CA</us_state>\n <us_county>Orange</us_county>\n <lotw>Y</lotw>\n <qsldirect>Y</qsldirect>\n <qsl>?</qsl>\n <eqsl>N</eqsl>\n <email>michael.bridak@gmail.com</email>\n <birth_year>1967</birth_year>\n <lic_year>2017</lic_year>\n <latitude>33.81</latitude>\n <longitude>-117.97</longitude>\n <continent>NA</continent>\n <utc_offset>-8</utc_offset>\n <picture>https://www.hamqth.com/userfiles/k/k6/k6gte/_header/header.jpg?ver=3</picture>\n </search>\n</HamQTH>'
12
+ result = xmltodict.parse(xml)
13
+ print(f"{result=}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.9.10.1
3
+ Version: 24.9.11
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,8 @@ 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] Fixed the HamQTH call lookups.
233
+ - [24-9-10-2] Removed mapping of FM to PH in the ARRL VHF Cabrillo logs
232
234
  - [24-9-10-1] ft8_watcher now used default WSJT-X Multicast address and port.
233
235
  - [24-9-10] Add WSJT FT8/4 and fldigi support to ARRL VHF.
234
236
  - [24-9-9] Add IARU R1 Fieldday CW and SSB.
@@ -5,7 +5,7 @@ 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
7
  not1mm/radio.py,sha256=eiB04LPMPBeMrBRI021Z7VXth66EOYb0Ujh11T9877c,3362
8
- not1mm/test.py,sha256=QE9lemU13glwB2yuBAuXXQHzADTW1vSX90HHu0F-Akg,496
8
+ not1mm/test.py,sha256=xbGtnhdoX16C6nrqzLDydqgQtiWxYWmZ2NN74DF-VLM,1736
9
9
  not1mm/vfo.py,sha256=IvmUQYMIPzLJw_BHQGis4J_IEW-vlBtdfxZLXPh7OzI,12335
10
10
  not1mm/voice_keying.py,sha256=sA3gw5_k7kShTg2qhG7HkKDM5M6KheJVRkAc_C7mxDk,3006
11
11
  not1mm/data/JetBrainsMono-Regular.ttf,sha256=UOHctAKY_PzCGh7zy-6f6egnCcSK0wzmF0csBqO9lDY,203952
@@ -102,7 +102,7 @@ not1mm/lib/edit_station.py,sha256=doL21Hs6jzIE43ohAopdFt_iqnRJZHFcqzcnCS0-iio,19
102
102
  not1mm/lib/fldigi_watcher.py,sha256=k_fAaJLdt4mwyKKnpiZrV-rSFtRbi2C8y1Dg3eyILIU,883
103
103
  not1mm/lib/ft8_watcher.py,sha256=npHTjO5mtg3lvYSK6G8BEMMrtZ_1M5xM6Q8NnEQ6MlI,4585
104
104
  not1mm/lib/ham_utility.py,sha256=uRErxCxZr8dfxzekPyett0e_BABDVOCvSUUTzXq6ctE,11790
105
- not1mm/lib/lookup.py,sha256=F2fl5QkMxaGSxl1XMWnLUub3T9Mt7LhCX4acOlAsks4,13952
105
+ not1mm/lib/lookup.py,sha256=i7ZF1bzJ_ofbE_r2OEEud0lKOOiDfeis8CVUo3s2pdI,13801
106
106
  not1mm/lib/multicast.py,sha256=bnFUNHyy82GmIb3_88EPBVVssj7-HzkJPaH671cK8Qw,3249
107
107
  not1mm/lib/n1mm.py,sha256=H54mpgJF0GAmKavM-nb5OAq2SJFWYkux4eMWWiSRxJc,6288
108
108
  not1mm/lib/new_contest.py,sha256=IznTDMq7yXHB6zBoGUEC_WDYPCPpsSZW4wwMJi16zK0,816
@@ -111,7 +111,7 @@ not1mm/lib/plugin_common.py,sha256=yefvcX61fXSjs__OPssJqVlZyg1AlcV1VDkl2MQP6kk,9
111
111
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
112
112
  not1mm/lib/settings.py,sha256=MWiKXbasaFbzeHTjfzTaTqbCBrIijudP_-0a5jNmUAA,9265
113
113
  not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
114
- not1mm/lib/version.py,sha256=FsT8NybU1I3-e0Sd5gaO4VWJIKAAhZz4pg_TeHhi4bY,50
114
+ not1mm/lib/version.py,sha256=PRDQULwkAoI16hhI1s6tqTEDizLTC5n4WBqgKX9RDzc,48
115
115
  not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
116
116
  not1mm/plugins/10_10_fall_cw.py,sha256=IttjX1yy4nDdACGsiYlPteFG8eVseX_WtoFio6bqHE8,10953
117
117
  not1mm/plugins/10_10_spring_cw.py,sha256=ThCptdM3dX4ywhoy2JRcOEyHSqcJolFaT7O_PYzM1Mg,10958
@@ -125,9 +125,9 @@ not1mm/plugins/arrl_field_day.py,sha256=pivtEK5j9sLpta12_wuUQYvs7MuiP3JfhlO-AOID
125
125
  not1mm/plugins/arrl_rtty_ru.py,sha256=hKUS4isjdXo3EYxQrsqsDupPp2chW8fpoWj0T1pTgJ4,7994
126
126
  not1mm/plugins/arrl_ss_cw.py,sha256=4yN68xZMuJRaSUfdiY4hafC07A3lifl5q6DEUZ-oYPQ,13080
127
127
  not1mm/plugins/arrl_ss_phone.py,sha256=Yzc5sNjrY8TlnozbYF6k8hbEamyDuUAD_3-BNqHgXqY,13068
128
- not1mm/plugins/arrl_vhf_jan.py,sha256=8unKMzQFLGovp_nwhwb-CQoTcrdybhO5ezy15-pup7Q,15610
129
- not1mm/plugins/arrl_vhf_jun.py,sha256=81of8nIKvmYoDdDA7ZA6xwaHIUhbKayutNWwrcyUGOo,14629
130
- not1mm/plugins/arrl_vhf_sep.py,sha256=4d4P6OSFHkEoheAjCrzrmR-2eOXH98FCyj-YXVBd2ks,14629
128
+ not1mm/plugins/arrl_vhf_jan.py,sha256=bSZM7NHa-B1tKY71Bh2VD6gATHw6xkwuLYxe9K8zk-Y,15604
129
+ not1mm/plugins/arrl_vhf_jun.py,sha256=B2nmz4nS3Al2v0Un2bey5ueGhfa4jN3l_nEsj1AZecc,14623
130
+ not1mm/plugins/arrl_vhf_sep.py,sha256=iG_Bt6JvmDSUYhmAoWYM0f8kuqWGblAn61DXclVTgXU,14623
131
131
  not1mm/plugins/canada_day.py,sha256=OVpcCl1Chse_zLHf6PayTrgawWM4W-pmrTw40Al-o9s,11998
132
132
  not1mm/plugins/cq_160_cw.py,sha256=5s6rIZdJEnmWe1SI06BEyz7p5vP0N2n9mI4l_mZ0icw,14139
133
133
  not1mm/plugins/cq_160_ssb.py,sha256=zIwSMAjHSt6W2edrDzVbyTf860JowHoFkU9BKO8Enag,14182
@@ -152,9 +152,9 @@ not1mm/plugins/ref_cw.py,sha256=aWjHHkqIKutjRUtzh09y5haFfnZK9poRQDWRQMDRxxU,1632
152
152
  not1mm/plugins/stew_perry_topband.py,sha256=CKBQbYl4ETxhXJd2dma4fg_C5pag_s7Nf61SCztZtqE,10668
153
153
  not1mm/plugins/weekly_rtty.py,sha256=DQcy3SY0Zn56EdlYGf3NxrRhTnkNa5IqRQPRQdKDSPs,14255
154
154
  not1mm/plugins/winter_field_day.py,sha256=4rcfRtobwjHO6BNL3WOTHzBmyyeuX79BNGBG8PfjrI8,10238
155
- not1mm-24.9.10.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
156
- not1mm-24.9.10.1.dist-info/METADATA,sha256=01uc-_drLCMliBrL12Y_2neEEpRBMnU-754H0O6Wucc,30714
157
- not1mm-24.9.10.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
158
- not1mm-24.9.10.1.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
159
- not1mm-24.9.10.1.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
160
- not1mm-24.9.10.1.dist-info/RECORD,,
155
+ not1mm-24.9.11.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
156
+ not1mm-24.9.11.dist-info/METADATA,sha256=5tjX7J_9Rn7ZKjVSSwYyBocTPmhPSJU2IoB8Zwx1FzU,30827
157
+ not1mm-24.9.11.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
158
+ not1mm-24.9.11.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
159
+ not1mm-24.9.11.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
160
+ not1mm-24.9.11.dist-info/RECORD,,