not1mm 24.11.21__py3-none-any.whl → 24.11.23__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 CHANGED
@@ -256,7 +256,7 @@ class MainWindow(QtWidgets.QMainWindow):
256
256
  self.actionNew_Database.triggered.connect(self.new_database)
257
257
  self.actionOpen_Database.triggered.connect(self.open_database)
258
258
 
259
- self.actionEdit_Macros.triggered.connect(self.edit_cw_macros)
259
+ self.actionEdit_Macros.triggered.connect(self.edit_macros)
260
260
 
261
261
  self.actionAbout.triggered.connect(self.show_about_dialog)
262
262
  self.actionHotKeys.triggered.connect(self.show_key_help)
@@ -659,7 +659,7 @@ class MainWindow(QtWidgets.QMainWindow):
659
659
  self.show_splash_msg("Loading contest.")
660
660
  self.load_contest()
661
661
  self.show_splash_msg("Reading macros.")
662
- self.read_cw_macros()
662
+ self.read_macros()
663
663
 
664
664
  self.show_splash_msg("Starting FlDigi watcher.")
665
665
  self.fldigi_watcher = FlDigiWatcher()
@@ -1627,6 +1627,7 @@ class MainWindow(QtWidgets.QMainWindow):
1627
1627
  cmd["COLUMNS"] = self.contest.columns
1628
1628
  if self.log_window:
1629
1629
  self.log_window.msg_from_main(cmd)
1630
+ self.read_macros()
1630
1631
 
1631
1632
  def check_for_new_cty(self) -> None:
1632
1633
  """
@@ -2804,7 +2805,7 @@ class MainWindow(QtWidgets.QMainWindow):
2804
2805
  """
2805
2806
  self.pref["run_state"] = self.radioButton_run.isChecked()
2806
2807
  self.write_preference()
2807
- self.read_cw_macros()
2808
+ self.read_macros()
2808
2809
  self.check_esm()
2809
2810
 
2810
2811
  def write_preference(self) -> None:
@@ -3351,7 +3352,7 @@ class MainWindow(QtWidgets.QMainWindow):
3351
3352
  self.set_band_indicator(band)
3352
3353
  self.set_window_title()
3353
3354
  self.clearinputs()
3354
- self.read_cw_macros()
3355
+ self.read_macros()
3355
3356
  return
3356
3357
  if mode in (
3357
3358
  "DIGI-U",
@@ -3372,7 +3373,7 @@ class MainWindow(QtWidgets.QMainWindow):
3372
3373
  self.set_band_indicator(band)
3373
3374
  self.set_window_title()
3374
3375
  self.clearinputs()
3375
- self.read_cw_macros()
3376
+ self.read_macros()
3376
3377
  return
3377
3378
  if mode == "SSB":
3378
3379
  if intended_freq:
@@ -3393,7 +3394,7 @@ class MainWindow(QtWidgets.QMainWindow):
3393
3394
  self.set_band_indicator(band)
3394
3395
  self.set_window_title()
3395
3396
  self.clearinputs()
3396
- self.read_cw_macros()
3397
+ self.read_macros()
3397
3398
 
3398
3399
  def check_callsign(self, callsign) -> None:
3399
3400
  """
@@ -3480,7 +3481,7 @@ class MainWindow(QtWidgets.QMainWindow):
3480
3481
  self.current_mode = "CW"
3481
3482
  self.sent.setText("599")
3482
3483
  self.receive.setText("599")
3483
- self.read_cw_macros()
3484
+ self.read_macros()
3484
3485
  if self.contest:
3485
3486
  if self.contest.name == "ICWC Medium Speed Test":
3486
3487
  self.contest.prefill(self)
@@ -3490,14 +3491,14 @@ class MainWindow(QtWidgets.QMainWindow):
3490
3491
  self.current_mode = "SSB"
3491
3492
  self.sent.setText("59")
3492
3493
  self.receive.setText("59")
3493
- self.read_cw_macros()
3494
+ self.read_macros()
3494
3495
  return
3495
3496
  if mode in ("RTTY", "DIGI-U", "DIGI-L"):
3496
3497
  if self.current_mode != "RTTY":
3497
3498
  self.current_mode = "RTTY"
3498
3499
  self.sent.setText("599")
3499
3500
  self.receive.setText("599")
3500
- self.read_cw_macros()
3501
+ self.read_macros()
3501
3502
 
3502
3503
  def get_opon(self) -> None:
3503
3504
  """
@@ -3664,18 +3665,13 @@ class MainWindow(QtWidgets.QMainWindow):
3664
3665
  except TypeError as err:
3665
3666
  logger.debug(f"{err=} {vfo=} {the_dict=}")
3666
3667
 
3667
- def edit_cw_macros(self) -> None:
3668
- """
3669
- Calls the default text editor to edit the CW macro file.
3670
-
3671
- Parameters
3672
- ----------
3673
- None
3674
-
3675
- Returns
3676
- -------
3677
- None
3678
- """
3668
+ def get_macro_filename(self):
3669
+ """"""
3670
+ # Have not1mm check in USER_DATA_PATH for the existence of a folder with the contests name.
3671
+ # If it exists, check to see if a cw/ssb/rtty macro files exists within it and load them before
3672
+ # falling back to the default ones.
3673
+ # If user selects menu option to edit the current macro file, make the previous checks, if the
3674
+ # specific one does not exist, copy the default to the contest directory and edit that copy.
3679
3675
  if self.radio_state.get("mode") in ("CW", "CW-L", "CW-R", "CWR"):
3680
3676
  macro_file = "cwmacros.txt"
3681
3677
  elif self.radio_state.get("mode") in (
@@ -3695,8 +3691,14 @@ class MainWindow(QtWidgets.QMainWindow):
3695
3691
  macro_file = "rttymacros.txt"
3696
3692
  else:
3697
3693
  macro_file = "ssbmacros.txt"
3694
+
3695
+ try:
3696
+ if not (fsutils.USER_DATA_PATH / self.contest.name).exists():
3697
+ os.mkdir(fsutils.USER_DATA_PATH / self.contest.name)
3698
+ except AttributeError:
3699
+ return ""
3700
+
3698
3701
  if not (fsutils.USER_DATA_PATH / macro_file).exists():
3699
- logger.debug("copying default macro file.")
3700
3702
  try:
3701
3703
  copyfile(
3702
3704
  fsutils.APP_DATA_PATH / macro_file,
@@ -3704,57 +3706,50 @@ class MainWindow(QtWidgets.QMainWindow):
3704
3706
  )
3705
3707
  except IOError as err:
3706
3708
  logger.critical(f"Error {err} copying macro file.")
3709
+
3710
+ if not (fsutils.USER_DATA_PATH / self.contest.name / macro_file).exists():
3711
+ try:
3712
+ copyfile(
3713
+ fsutils.APP_DATA_PATH / macro_file,
3714
+ fsutils.USER_DATA_PATH / self.contest.name / macro_file,
3715
+ )
3716
+ except IOError as err:
3717
+ logger.critical(f"Error {err} copying macro file.")
3718
+
3719
+ return fsutils.USER_DATA_PATH / self.contest.name / macro_file
3720
+
3721
+ def edit_macros(self) -> None:
3722
+ """
3723
+ Calls the default text editor to edit the CW macro file.
3724
+
3725
+ Parameters
3726
+ ----------
3727
+ None
3728
+
3729
+ Returns
3730
+ -------
3731
+ None
3732
+ """
3733
+
3734
+ macro_file = self.get_macro_filename()
3735
+
3707
3736
  try:
3708
- fsutils.openFileWithOS(fsutils.USER_DATA_PATH / macro_file)
3737
+ fsutils.openFileWithOS(macro_file)
3709
3738
  except FileNotFoundError | PermissionError | OSError as err:
3710
- logger.critical(
3711
- f"Could not open file {fsutils.USER_DATA_PATH / macro_file} {err}"
3712
- )
3713
- self.read_cw_macros()
3739
+ logger.critical(f"Could not open file {macro_file} {err}")
3740
+ self.read_macros()
3714
3741
 
3715
- def read_cw_macros(self) -> None:
3742
+ def read_macros(self) -> None:
3716
3743
  """
3717
3744
  Reads in the CW macros, firsts it checks to see if the file exists. If it does not,
3718
3745
  and this has been packaged with pyinstaller it will copy the default file from the
3719
3746
  temp directory this is running from... In theory.
3720
3747
  """
3721
3748
 
3722
- if self.radio_state.get("mode") in (
3723
- "CW",
3724
- "CW-L",
3725
- "CW-R",
3726
- ):
3727
- macro_file = "cwmacros.txt"
3728
- elif self.radio_state.get("mode") in (
3729
- "RTTY",
3730
- "RTTY-R",
3731
- "LSB-D",
3732
- "USB-D",
3733
- "AM-D",
3734
- "FM-D",
3735
- "DIGI-U",
3736
- "DIGI-L",
3737
- "RTTYR",
3738
- "PKTLSB",
3739
- "PKTUSB",
3740
- ):
3741
- macro_file = "rttymacros.txt"
3742
- else:
3743
- macro_file = "ssbmacros.txt"
3749
+ macro_file = self.get_macro_filename()
3744
3750
 
3745
- if not (fsutils.USER_DATA_PATH / macro_file).exists():
3746
- logger.debug("copying default macro file.")
3747
- try:
3748
- copyfile(
3749
- fsutils.APP_DATA_PATH / macro_file,
3750
- fsutils.USER_DATA_PATH / macro_file,
3751
- )
3752
- except IOError as err:
3753
- logger.critical(f"Error {err} copying macro file.")
3754
3751
  try:
3755
- with open(
3756
- fsutils.USER_DATA_PATH / macro_file, "r", encoding="utf-8"
3757
- ) as file_descriptor:
3752
+ with open(macro_file, "r", encoding="utf-8") as file_descriptor:
3758
3753
  for line in file_descriptor:
3759
3754
  mode, fkey, buttonname, cwtext = line.split("|")
3760
3755
  if mode.strip().upper() == "R" and self.pref.get("run_state"):
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.11.21"
3
+ __version__ = "24.11.23"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.11.21
3
+ Version: 24.11.23
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
@@ -238,6 +238,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
238
238
 
239
239
  ## Recent Changes (Polishing the Turd)
240
240
 
241
+ - [24-11-23] Made macros per contest.
241
242
  - [24-11-21] Merged PR from alduhoo setting CW Speed via rigctld, Added ESM and call history support for General Logging.
242
243
  - [24-11-19] Added ESM to Stew Perry, Phone Weekly, Medium Speed Test and JIDX.
243
244
  - [24-11-18] Accepted PR from dg9vh for the DARC XMAS Contest.
@@ -1,5 +1,5 @@
1
1
  not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- not1mm/__main__.py,sha256=gTvMiyHVY5BEFCOCKT7_q6IkcYu1BDU3treXZk3jQ_8,142394
2
+ not1mm/__main__.py,sha256=IKdrA6p-ScJtcuD9s0J4QsYNxqbobTJkIQs6nz4qw3o,142522
3
3
  not1mm/bandmap.py,sha256=X6mMHXS1kXBbUPZCaKgiVJ6Dz6DE6LEQqtEXfT3telg,30811
4
4
  not1mm/checkwindow.py,sha256=VFAcKYTcoWhmIf91chwY6tyao9FQMWPiUkgDDkkWaog,9670
5
5
  not1mm/fsutils.py,sha256=ukHKxKTeNKxKwqRaJjtzRShL4X5Xl0jRBbADyy3Ifp8,1701
@@ -114,7 +114,7 @@ not1mm/lib/plugin_common.py,sha256=AABdx9DoTT8Znrup7AkfmKGC22hshMsEypiMqV0iKw0,1
114
114
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
115
115
  not1mm/lib/settings.py,sha256=Xt0WE2ro_kUYdugQ0Pe1SQX07MHrJ0jyQqDqAKKqxuU,13564
116
116
  not1mm/lib/super_check_partial.py,sha256=hwT2NRwobu0PLDyw6ltmbmcAtGBD02CKGFbgGWjXMqA,2334
117
- not1mm/lib/version.py,sha256=2KuOTzQ3XUC08hkaFvx9RVIiA2YL9VANgy4nxwliSJQ,49
117
+ not1mm/lib/version.py,sha256=i-XV0bR64KuRtURdg5UiGO_HwzJh30A1goTNLNf275w,49
118
118
  not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
119
119
  not1mm/plugins/10_10_fall_cw.py,sha256=r2YkRNiMS_3hXrf3zeiijzW24roilyIXnwXwTd07X8M,11208
120
120
  not1mm/plugins/10_10_spring_cw.py,sha256=EBBcVgxDhtAK7cGHq9LOU6LhY9vSqlk7GEkApn3KRYM,11213
@@ -162,9 +162,9 @@ not1mm/plugins/ref_ssb.py,sha256=G2Gz4kApchmOZQVnBexEokSEvdb-mZWJAfyJ1D6JDGY,204
162
162
  not1mm/plugins/stew_perry_topband.py,sha256=Gy_vv6tgkR-3vmvsUVO0pVfHMkUJSxpt7G4secn0RH8,15084
163
163
  not1mm/plugins/weekly_rtty.py,sha256=PI0_AtEdZZKGAuKnP-b2EYn9xwCN1Ablk38trbNP3Rc,19603
164
164
  not1mm/plugins/winter_field_day.py,sha256=9w3tDL9ZWiENSTERc3vzDbBktvI7pnyNvlH6fDjAi08,14841
165
- not1mm-24.11.21.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
166
- not1mm-24.11.21.dist-info/METADATA,sha256=xa2JnhPq2yIm7akc8rqc6RMn53bqVd5LqqAoHIfevns,36614
167
- not1mm-24.11.21.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
168
- not1mm-24.11.21.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
169
- not1mm-24.11.21.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
170
- not1mm-24.11.21.dist-info/RECORD,,
165
+ not1mm-24.11.23.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
166
+ not1mm-24.11.23.dist-info/METADATA,sha256=7la-wqRZm6lciPrTOHi8B_ly4eoiBqCUowixz38RbSU,36652
167
+ not1mm-24.11.23.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
168
+ not1mm-24.11.23.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
169
+ not1mm-24.11.23.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
170
+ not1mm-24.11.23.dist-info/RECORD,,