not1mm 24.10.24.1__py3-none-any.whl → 24.10.26__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.
Files changed (51) hide show
  1. not1mm/__main__.py +9 -3
  2. not1mm/bandmap.py +6 -1
  3. not1mm/data/main.ui +23 -3
  4. not1mm/lib/version.py +1 -1
  5. not1mm/plugins/10_10_fall_cw.py +109 -82
  6. not1mm/plugins/10_10_spring_cw.py +109 -82
  7. not1mm/plugins/10_10_summer_phone.py +109 -82
  8. not1mm/plugins/10_10_winter_phone.py +109 -82
  9. not1mm/plugins/arrl_10m.py +109 -82
  10. not1mm/plugins/arrl_dx_cw.py +109 -82
  11. not1mm/plugins/arrl_dx_ssb.py +109 -82
  12. not1mm/plugins/arrl_field_day.py +109 -82
  13. not1mm/plugins/arrl_ss_cw.py +109 -82
  14. not1mm/plugins/arrl_ss_phone.py +109 -82
  15. not1mm/plugins/arrl_vhf_jan.py +109 -82
  16. not1mm/plugins/arrl_vhf_jun.py +109 -82
  17. not1mm/plugins/arrl_vhf_sep.py +109 -82
  18. not1mm/plugins/canada_day.py +109 -82
  19. not1mm/plugins/cq_160_cw.py +109 -74
  20. not1mm/plugins/cq_160_ssb.py +109 -74
  21. not1mm/plugins/cq_wpx_cw.py +109 -82
  22. not1mm/plugins/cq_wpx_rtty.py +109 -82
  23. not1mm/plugins/cq_wpx_ssb.py +109 -82
  24. not1mm/plugins/cq_ww_cw.py +115 -83
  25. not1mm/plugins/cq_ww_rtty.py +110 -73
  26. not1mm/plugins/cq_ww_ssb.py +109 -82
  27. not1mm/plugins/cwt.py +109 -82
  28. not1mm/plugins/general_logging.py +1 -1
  29. not1mm/plugins/helvetia.py +109 -82
  30. not1mm/plugins/iaru_fieldday_r1_cw.py +109 -82
  31. not1mm/plugins/iaru_fieldday_r1_ssb.py +109 -82
  32. not1mm/plugins/iaru_hf.py +109 -82
  33. not1mm/plugins/icwc_mst.py +109 -82
  34. not1mm/plugins/jidx_cw.py +74 -48
  35. not1mm/plugins/jidx_ph.py +74 -48
  36. not1mm/plugins/k1usn_sst.py +109 -82
  37. not1mm/plugins/naqp_cw.py +109 -82
  38. not1mm/plugins/naqp_rtty.py +109 -82
  39. not1mm/plugins/naqp_ssb.py +109 -82
  40. not1mm/plugins/phone_weekly_test.py +109 -82
  41. not1mm/plugins/ref_cw.py +109 -82
  42. not1mm/plugins/ref_ssb.py +109 -82
  43. not1mm/plugins/stew_perry_topband.py +109 -82
  44. not1mm/plugins/weekly_rtty.py +109 -82
  45. not1mm/plugins/winter_field_day.py +109 -82
  46. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/METADATA +3 -1
  47. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/RECORD +51 -51
  48. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/LICENSE +0 -0
  49. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/WHEEL +0 -0
  50. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/entry_points.txt +0 -0
  51. {not1mm-24.10.24.1.dist-info → not1mm-24.10.26.dist-info}/top_level.txt +0 -0
@@ -209,7 +209,16 @@ def adif(self):
209
209
  gen_adif(self, cabrillo_name, "CQ-160-CW")
210
210
 
211
211
 
212
- def cabrillo(self):
212
+ def output_cabrillo_line(line_to_output, ending, file_descriptor, file_encoding):
213
+ """"""
214
+ print(
215
+ line_to_output.encode(file_encoding, errors="ignore").decode(),
216
+ end=ending,
217
+ file=file_descriptor,
218
+ )
219
+
220
+
221
+ def cabrillo(self, file_encoding):
213
222
  """Generates Cabrillo file. Maybe."""
214
223
  # https://www.cw160.com/cabrillo.htm
215
224
  logger.debug("******Cabrillo*****")
@@ -226,125 +235,150 @@ def cabrillo(self):
226
235
  log = self.database.fetch_all_contacts_asc()
227
236
  try:
228
237
  with open(filename, "w", encoding="utf-8") as file_descriptor:
229
- print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
230
- print(
238
+ output_cabrillo_line(
239
+ "START-OF-LOG: 3.0",
240
+ "\r\n",
241
+ file_descriptor,
242
+ file_encoding,
243
+ )
244
+ output_cabrillo_line(
231
245
  f"CREATED-BY: Not1MM v{__version__}",
232
- end="\r\n",
233
- file=file_descriptor,
246
+ "\r\n",
247
+ file_descriptor,
248
+ file_encoding,
234
249
  )
235
- print(
250
+ output_cabrillo_line(
236
251
  f"CONTEST: {cabrillo_name}",
237
- end="\r\n",
238
- file=file_descriptor,
252
+ "\r\n",
253
+ file_descriptor,
254
+ file_encoding,
239
255
  )
240
256
  if self.station.get("Club", ""):
241
- print(
257
+ output_cabrillo_line(
242
258
  f"CLUB: {self.station.get('Club', '').upper()}",
243
- end="\r\n",
244
- file=file_descriptor,
259
+ "\r\n",
260
+ file_descriptor,
261
+ file_encoding,
245
262
  )
246
- print(
263
+ output_cabrillo_line(
247
264
  f"CALLSIGN: {self.station.get('Call','')}",
248
- end="\r\n",
249
- file=file_descriptor,
265
+ "\r\n",
266
+ file_descriptor,
267
+ file_encoding,
250
268
  )
251
- print(
269
+ output_cabrillo_line(
252
270
  f"LOCATION: {self.station.get('ARRLSection', '')}",
253
- end="\r\n",
254
- file=file_descriptor,
271
+ "\r\n",
272
+ file_descriptor,
273
+ file_encoding,
255
274
  )
256
-
257
- print(
275
+ output_cabrillo_line(
258
276
  f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
259
- end="\r\n",
260
- file=file_descriptor,
277
+ "\r\n",
278
+ file_descriptor,
279
+ file_encoding,
261
280
  )
262
- print(
281
+ output_cabrillo_line(
263
282
  f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
264
- end="\r\n",
265
- file=file_descriptor,
283
+ "\r\n",
284
+ file_descriptor,
285
+ file_encoding,
266
286
  )
267
- print(
287
+ output_cabrillo_line(
268
288
  f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
269
- end="\r\n",
270
- file=file_descriptor,
289
+ "\r\n",
290
+ file_descriptor,
291
+ file_encoding,
271
292
  )
272
- print(
293
+ output_cabrillo_line(
273
294
  f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
274
- end="\r\n",
275
- file=file_descriptor,
295
+ "\r\n",
296
+ file_descriptor,
297
+ file_encoding,
276
298
  )
277
- print(
299
+ output_cabrillo_line(
278
300
  f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
279
- end="\r\n",
280
- file=file_descriptor,
301
+ "\r\n",
302
+ file_descriptor,
303
+ file_encoding,
281
304
  )
282
305
  if self.contest_settings.get("OverlayCategory", "") != "N/A":
283
- print(
306
+ output_cabrillo_line(
284
307
  f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
285
- end="\r\n",
286
- file=file_descriptor,
308
+ "\r\n",
309
+ file_descriptor,
310
+ file_encoding,
287
311
  )
288
- print(
312
+ output_cabrillo_line(
289
313
  f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
290
- end="\r\n",
291
- file=file_descriptor,
314
+ "\r\n",
315
+ file_descriptor,
316
+ file_encoding,
292
317
  )
293
-
294
- print(
318
+ output_cabrillo_line(
295
319
  f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
296
- end="\r\n",
297
- file=file_descriptor,
320
+ "\r\n",
321
+ file_descriptor,
322
+ file_encoding,
298
323
  )
299
324
 
300
- print(
325
+ output_cabrillo_line(
301
326
  f"CLAIMED-SCORE: {calc_score(self)}",
302
- end="\r\n",
303
- file=file_descriptor,
327
+ "\r\n",
328
+ file_descriptor,
329
+ file_encoding,
304
330
  )
305
331
  ops = f"@{self.station.get('Call','')}"
306
332
  list_of_ops = self.database.get_ops()
307
333
  for op in list_of_ops:
308
334
  ops += f", {op.get('Operator', '')}"
309
- print(
335
+ output_cabrillo_line(
310
336
  f"OPERATORS: {ops}",
311
- end="\r\n",
312
- file=file_descriptor,
337
+ "\r\n",
338
+ file_descriptor,
339
+ file_encoding,
313
340
  )
314
- print(
341
+ output_cabrillo_line(
315
342
  f"NAME: {self.station.get('Name', '')}",
316
- end="\r\n",
317
- file=file_descriptor,
343
+ "\r\n",
344
+ file_descriptor,
345
+ file_encoding,
318
346
  )
319
- print(
347
+ output_cabrillo_line(
320
348
  f"ADDRESS: {self.station.get('Street1', '')}",
321
- end="\r\n",
322
- file=file_descriptor,
349
+ "\r\n",
350
+ file_descriptor,
351
+ file_encoding,
323
352
  )
324
- print(
353
+ output_cabrillo_line(
325
354
  f"ADDRESS-CITY: {self.station.get('City', '')}",
326
- end="\r\n",
327
- file=file_descriptor,
355
+ "\r\n",
356
+ file_descriptor,
357
+ file_encoding,
328
358
  )
329
- print(
359
+ output_cabrillo_line(
330
360
  f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
331
- end="\r\n",
332
- file=file_descriptor,
361
+ "\r\n",
362
+ file_descriptor,
363
+ file_encoding,
333
364
  )
334
- print(
365
+ output_cabrillo_line(
335
366
  f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
336
- end="\r\n",
337
- file=file_descriptor,
367
+ "\r\n",
368
+ file_descriptor,
369
+ file_encoding,
338
370
  )
339
- print(
371
+ output_cabrillo_line(
340
372
  f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
341
- end="\r\n",
342
- file=file_descriptor,
373
+ "\r\n",
374
+ file_descriptor,
375
+ file_encoding,
343
376
  )
344
- print(
377
+ output_cabrillo_line(
345
378
  f"EMAIL: {self.station.get('Email', '')}",
346
- end="\r\n",
347
- file=file_descriptor,
379
+ "\r\n",
380
+ file_descriptor,
381
+ file_encoding,
348
382
  )
349
383
  for contact in log:
350
384
  the_date_and_time = contact.get("TS", "")
@@ -355,7 +389,7 @@ def cabrillo(self):
355
389
 
356
390
  loggeddate = the_date_and_time[:10]
357
391
  loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
358
- print(
392
+ output_cabrillo_line(
359
393
  f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
360
394
  f"{contact.get('StationPrefix', '').ljust(13)} "
361
395
  f"{str(contact.get('SNT', '')).ljust(3)} "
@@ -363,10 +397,11 @@ def cabrillo(self):
363
397
  f"{contact.get('Call', '').ljust(13)} "
364
398
  f"{str(contact.get('RCV', '')).ljust(3)} "
365
399
  f"{str(contact.get('Exchange1', '')).ljust(6)}",
366
- end="\r\n",
367
- file=file_descriptor,
400
+ "\r\n",
401
+ file_descriptor,
402
+ file_encoding,
368
403
  )
369
- print("END-OF-LOG:", end="\r\n", file=file_descriptor)
404
+ output_cabrillo_line("END-OF-LOG:", "\r\n", file_descriptor, file_encoding)
370
405
  self.show_message_box(f"Cabrillo saved to: {filename}")
371
406
  except IOError as exception:
372
407
  logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)
@@ -209,7 +209,16 @@ def adif(self):
209
209
  gen_adif(self, cabrillo_name, "CQ-160-SSB")
210
210
 
211
211
 
212
- def cabrillo(self):
212
+ def output_cabrillo_line(line_to_output, ending, file_descriptor, file_encoding):
213
+ """"""
214
+ print(
215
+ line_to_output.encode(file_encoding, errors="ignore").decode(),
216
+ end=ending,
217
+ file=file_descriptor,
218
+ )
219
+
220
+
221
+ def cabrillo(self, file_encoding):
213
222
  """Generates Cabrillo file. Maybe."""
214
223
  # https://www.cw160.com/cabrillo.htm
215
224
  logger.debug("******Cabrillo*****")
@@ -226,125 +235,150 @@ def cabrillo(self):
226
235
  log = self.database.fetch_all_contacts_asc()
227
236
  try:
228
237
  with open(filename, "w", encoding="utf-8") as file_descriptor:
229
- print("START-OF-LOG: 3.0", end="\r\n", file=file_descriptor)
230
- print(
238
+ output_cabrillo_line(
239
+ "START-OF-LOG: 3.0",
240
+ "\r\n",
241
+ file_descriptor,
242
+ file_encoding,
243
+ )
244
+ output_cabrillo_line(
231
245
  f"CREATED-BY: Not1MM v{__version__}",
232
- end="\r\n",
233
- file=file_descriptor,
246
+ "\r\n",
247
+ file_descriptor,
248
+ file_encoding,
234
249
  )
235
- print(
250
+ output_cabrillo_line(
236
251
  f"CONTEST: {cabrillo_name}",
237
- end="\r\n",
238
- file=file_descriptor,
252
+ "\r\n",
253
+ file_descriptor,
254
+ file_encoding,
239
255
  )
240
256
  if self.station.get("Club", ""):
241
- print(
257
+ output_cabrillo_line(
242
258
  f"CLUB: {self.station.get('Club', '').upper()}",
243
- end="\r\n",
244
- file=file_descriptor,
259
+ "\r\n",
260
+ file_descriptor,
261
+ file_encoding,
245
262
  )
246
- print(
263
+ output_cabrillo_line(
247
264
  f"CALLSIGN: {self.station.get('Call','')}",
248
- end="\r\n",
249
- file=file_descriptor,
265
+ "\r\n",
266
+ file_descriptor,
267
+ file_encoding,
250
268
  )
251
- print(
269
+ output_cabrillo_line(
252
270
  f"LOCATION: {self.station.get('ARRLSection', '')}",
253
- end="\r\n",
254
- file=file_descriptor,
271
+ "\r\n",
272
+ file_descriptor,
273
+ file_encoding,
255
274
  )
256
-
257
- print(
275
+ output_cabrillo_line(
258
276
  f"CATEGORY-OPERATOR: {self.contest_settings.get('OperatorCategory','')}",
259
- end="\r\n",
260
- file=file_descriptor,
277
+ "\r\n",
278
+ file_descriptor,
279
+ file_encoding,
261
280
  )
262
- print(
281
+ output_cabrillo_line(
263
282
  f"CATEGORY-ASSISTED: {self.contest_settings.get('AssistedCategory','')}",
264
- end="\r\n",
265
- file=file_descriptor,
283
+ "\r\n",
284
+ file_descriptor,
285
+ file_encoding,
266
286
  )
267
- print(
287
+ output_cabrillo_line(
268
288
  f"CATEGORY-BAND: {self.contest_settings.get('BandCategory','')}",
269
- end="\r\n",
270
- file=file_descriptor,
289
+ "\r\n",
290
+ file_descriptor,
291
+ file_encoding,
271
292
  )
272
- print(
293
+ output_cabrillo_line(
273
294
  f"CATEGORY-MODE: {self.contest_settings.get('ModeCategory','')}",
274
- end="\r\n",
275
- file=file_descriptor,
295
+ "\r\n",
296
+ file_descriptor,
297
+ file_encoding,
276
298
  )
277
- print(
299
+ output_cabrillo_line(
278
300
  f"CATEGORY-TRANSMITTER: {self.contest_settings.get('TransmitterCategory','')}",
279
- end="\r\n",
280
- file=file_descriptor,
301
+ "\r\n",
302
+ file_descriptor,
303
+ file_encoding,
281
304
  )
282
305
  if self.contest_settings.get("OverlayCategory", "") != "N/A":
283
- print(
306
+ output_cabrillo_line(
284
307
  f"CATEGORY-OVERLAY: {self.contest_settings.get('OverlayCategory','')}",
285
- end="\r\n",
286
- file=file_descriptor,
308
+ "\r\n",
309
+ file_descriptor,
310
+ file_encoding,
287
311
  )
288
- print(
312
+ output_cabrillo_line(
289
313
  f"GRID-LOCATOR: {self.station.get('GridSquare','')}",
290
- end="\r\n",
291
- file=file_descriptor,
314
+ "\r\n",
315
+ file_descriptor,
316
+ file_encoding,
292
317
  )
293
-
294
- print(
318
+ output_cabrillo_line(
295
319
  f"CATEGORY-POWER: {self.contest_settings.get('PowerCategory','')}",
296
- end="\r\n",
297
- file=file_descriptor,
320
+ "\r\n",
321
+ file_descriptor,
322
+ file_encoding,
298
323
  )
299
324
 
300
- print(
325
+ output_cabrillo_line(
301
326
  f"CLAIMED-SCORE: {calc_score(self)}",
302
- end="\r\n",
303
- file=file_descriptor,
327
+ "\r\n",
328
+ file_descriptor,
329
+ file_encoding,
304
330
  )
305
331
  ops = f"@{self.station.get('Call','')}"
306
332
  list_of_ops = self.database.get_ops()
307
333
  for op in list_of_ops:
308
334
  ops += f", {op.get('Operator', '')}"
309
- print(
335
+ output_cabrillo_line(
310
336
  f"OPERATORS: {ops}",
311
- end="\r\n",
312
- file=file_descriptor,
337
+ "\r\n",
338
+ file_descriptor,
339
+ file_encoding,
313
340
  )
314
- print(
341
+ output_cabrillo_line(
315
342
  f"NAME: {self.station.get('Name', '')}",
316
- end="\r\n",
317
- file=file_descriptor,
343
+ "\r\n",
344
+ file_descriptor,
345
+ file_encoding,
318
346
  )
319
- print(
347
+ output_cabrillo_line(
320
348
  f"ADDRESS: {self.station.get('Street1', '')}",
321
- end="\r\n",
322
- file=file_descriptor,
349
+ "\r\n",
350
+ file_descriptor,
351
+ file_encoding,
323
352
  )
324
- print(
353
+ output_cabrillo_line(
325
354
  f"ADDRESS-CITY: {self.station.get('City', '')}",
326
- end="\r\n",
327
- file=file_descriptor,
355
+ "\r\n",
356
+ file_descriptor,
357
+ file_encoding,
328
358
  )
329
- print(
359
+ output_cabrillo_line(
330
360
  f"ADDRESS-STATE-PROVINCE: {self.station.get('State', '')}",
331
- end="\r\n",
332
- file=file_descriptor,
361
+ "\r\n",
362
+ file_descriptor,
363
+ file_encoding,
333
364
  )
334
- print(
365
+ output_cabrillo_line(
335
366
  f"ADDRESS-POSTALCODE: {self.station.get('Zip', '')}",
336
- end="\r\n",
337
- file=file_descriptor,
367
+ "\r\n",
368
+ file_descriptor,
369
+ file_encoding,
338
370
  )
339
- print(
371
+ output_cabrillo_line(
340
372
  f"ADDRESS-COUNTRY: {self.station.get('Country', '')}",
341
- end="\r\n",
342
- file=file_descriptor,
373
+ "\r\n",
374
+ file_descriptor,
375
+ file_encoding,
343
376
  )
344
- print(
377
+ output_cabrillo_line(
345
378
  f"EMAIL: {self.station.get('Email', '')}",
346
- end="\r\n",
347
- file=file_descriptor,
379
+ "\r\n",
380
+ file_descriptor,
381
+ file_encoding,
348
382
  )
349
383
  for contact in log:
350
384
  the_date_and_time = contact.get("TS", "")
@@ -355,7 +389,7 @@ def cabrillo(self):
355
389
 
356
390
  loggeddate = the_date_and_time[:10]
357
391
  loggedtime = the_date_and_time[11:13] + the_date_and_time[14:16]
358
- print(
392
+ output_cabrillo_line(
359
393
  f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
360
394
  f"{contact.get('StationPrefix', '').ljust(13)} "
361
395
  f"{str(contact.get('SNT', '')).ljust(3)} "
@@ -363,10 +397,11 @@ def cabrillo(self):
363
397
  f"{contact.get('Call', '').ljust(13)} "
364
398
  f"{str(contact.get('RCV', '')).ljust(3)} "
365
399
  f"{str(contact.get('Exchange1', '')).ljust(6)}",
366
- end="\r\n",
367
- file=file_descriptor,
400
+ "\r\n",
401
+ file_descriptor,
402
+ file_encoding,
368
403
  )
369
- print("END-OF-LOG:", end="\r\n", file=file_descriptor)
404
+ output_cabrillo_line("END-OF-LOG:", "\r\n", file_descriptor, file_encoding)
370
405
  self.show_message_box(f"Cabrillo saved to: {filename}")
371
406
  except IOError as exception:
372
407
  logger.critical("cabrillo: IO error: %s, writing to %s", exception, filename)