not1mm 24.4.9.4__py3-none-any.whl → 24.4.17__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/checkwindow.py CHANGED
@@ -258,39 +258,43 @@ class CheckWindow(QDockWidget):
258
258
  filter(lambda x: x, [x.get("callsign", None) for x in spots]),
259
259
  )
260
260
 
261
- def populate_layout(self, layout, call_list):
261
+ def populate_layout(self, layout, call_list) -> None:
262
+ """Apply blackmagic to a layout."""
262
263
  for i in reversed(range(layout.count())):
263
264
  if layout.itemAt(i).widget():
264
265
  layout.itemAt(i).widget().setParent(None)
265
266
  else:
266
267
  layout.removeItem(layout.itemAt(i))
267
- labels = []
268
+ call_items = []
268
269
  for call in call_list:
269
270
  if call:
270
271
  if self.call:
271
272
  label_text = ""
273
+ diff_score = 0
272
274
  for tag, i1, i2, j1, j2 in Levenshtein.opcodes(call, self.call):
273
- # logger.debug('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(
274
- # tag, i1, i2, j1, j2, call[i1:i2], self.call[j1:j2]))
275
275
  if tag == "equal":
276
276
  label_text += call[i1:i2]
277
277
  continue
278
278
  elif tag == "replace":
279
279
  label_text += f"<span style='background-color: {self.character_remove_color};'>{call[i1:i2]}</span>"
280
+ diff_score += max((i2 - i1), (j2 - j1)) * (
281
+ len(call) + 1 - i2
282
+ )
280
283
  elif tag == "insert" or tag == "delete":
281
284
  label_text += f"<span style='background-color: {self.character_add_color};'>{call[i1:i2]}</span>"
282
- labels.append(
283
- (
284
- Levenshtein.hamming(call, self.call),
285
- CallLabel(
286
- label_text, call=call, callback=self.item_clicked
287
- ),
288
- )
289
- )
290
-
291
- for _, label in sorted(labels, key=lambda x: x[0]):
285
+ diff_score += max((i2 - i1), (j2 - j1)) * (len(call) - i2)
286
+ call_items.append((diff_score, label_text, call))
287
+
288
+ call_items = sorted(call_items, key=lambda x: x[0])
289
+ for i in reversed(range(layout.count())):
290
+ if layout.itemAt(i).widget():
291
+ layout.itemAt(i).widget().setParent(None)
292
+ else:
293
+ layout.removeItem(layout.itemAt(i))
294
+
295
+ for _, label_text, call in call_items:
296
+ label = CallLabel(label_text, call=call, callback=self.item_clicked)
292
297
  layout.addWidget(label)
293
- # top aligns
294
298
  layout.addStretch(0)
295
299
 
296
300
 
@@ -307,6 +311,6 @@ class CallLabel(QLabel):
307
311
  self.call = call
308
312
  self.callback = callback
309
313
 
310
- def mouseDoubleClickEvent(self, e: QMouseEvent) -> None:
314
+ def mouseReleaseEvent(self, e: QMouseEvent) -> None:
311
315
  if self.call and self.callback:
312
316
  self.callback(self.call)
not1mm/data/settings.ui CHANGED
@@ -1201,7 +1201,7 @@
1201
1201
  <string>club name</string>
1202
1202
  </property>
1203
1203
  <property name="placeholderText">
1204
- <string>Americal Radio Relay League</string>
1204
+ <string>American Radio Relay League</string>
1205
1205
  </property>
1206
1206
  </widget>
1207
1207
  </item>
not1mm/fsutils.py CHANGED
@@ -11,27 +11,21 @@ import platform
11
11
  import sys
12
12
  import subprocess
13
13
  from pathlib import Path
14
-
15
14
  from appdata import AppDataPaths
16
15
 
17
16
  WORKING_PATH = Path(os.path.dirname(os.path.abspath(__file__)))
18
-
19
17
  MODULE_PATH = WORKING_PATH
20
-
21
-
22
18
  APP_DATA_PATH = MODULE_PATH / "data"
23
- _app_paths = AppDataPaths(name="not1mm")
24
- _app_paths.setup()
25
-
26
19
  DATA_PATH = os.environ.get("XDG_DATA_HOME", str(Path.home() / ".local" / "share"))
27
20
  DATA_PATH += "/not1mm"
28
21
  USER_DATA_PATH = Path(DATA_PATH)
29
- LOG_FILE = USER_DATA_PATH / "application.log"
30
22
  _CONFIG_PATH = os.environ.get("XDG_CONFIG_HOME", str(Path.home() / ".config"))
31
23
  _CONFIG_PATH += "/not1mm"
32
24
  CONFIG_PATH = Path(_CONFIG_PATH)
33
25
  CONFIG_FILE = CONFIG_PATH / "not1mm.json"
26
+ LOG_FILE = USER_DATA_PATH / "not1mm_debug.log"
34
27
 
28
+ # Create directories if they do not exist on Linux systems
35
29
  if platform.system() not in ["Windows", "Darwin"]:
36
30
  try:
37
31
  os.mkdir(CONFIG_PATH)
@@ -42,15 +36,16 @@ if platform.system() not in ["Windows", "Darwin"]:
42
36
  except FileExistsError:
43
37
  ...
44
38
 
39
+ # Define and create directories if they do not exist on Windows or Mac systems
45
40
  if platform.system() in ["Windows", "Darwin"]:
41
+ _app_paths = AppDataPaths(name="not1mm")
42
+ _app_paths.setup()
46
43
  LOG_FILE = _app_paths.get_log_file_path(name="appplication.log")
47
44
  _DATA_PATH = Path(_app_paths.app_data_path)
48
45
  USER_DATA_PATH = _DATA_PATH
49
46
  CONFIG_PATH = USER_DATA_PATH
50
47
  CONFIG_FILE = CONFIG_PATH / "not1mm.json"
51
48
 
52
- DARK_STYLESHEET = ""
53
-
54
49
 
55
50
  def openFileWithOS(file):
56
51
  """Open a file with the default program for that OS."""
@@ -60,4 +55,3 @@ def openFileWithOS(file):
60
55
  subprocess.Popen(["open", file])
61
56
  else:
62
57
  subprocess.Popen(["xdg-open", file])
63
- # os.system(f"xdg-open {fsutils.USER_DATA_PATH / macro_file}")
not1mm/lib/settings.py CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  import logging
4
4
  from PyQt6 import QtWidgets, uic
5
- import sounddevice as sd
5
+
6
+ try:
7
+ import sounddevice as sd
8
+ except OSError as exception:
9
+ print(exception)
10
+ print("portaudio is not installed")
11
+ sd = None
6
12
 
7
13
 
8
14
  class Settings(QtWidgets.QDialog):
@@ -15,7 +21,10 @@ class Settings(QtWidgets.QDialog):
15
21
  uic.loadUi(app_data_path / "configuration.ui", self)
16
22
  self.buttonBox.accepted.connect(self.save_changes)
17
23
  self.preference = pref
18
- self.devices = sd.query_devices()
24
+ if sd:
25
+ self.devices = sd.query_devices()
26
+ else:
27
+ self.devices = []
19
28
  self.setup()
20
29
 
21
30
  def setup(self):
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.4.9.4"
3
+ __version__ = "24.4.17"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.4.9.4
3
+ Version: 24.4.17
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
@@ -177,6 +177,8 @@ I wish to thank those who've contributed to the project.
177
177
 
178
178
  ## Recent Changes
179
179
 
180
+ - [24-4-17] Trap OSError if no sound device. Stop fsutils/appdata from creating useless .not1mm and .username folder structures on Linux platforms.
181
+ - [24-4-15] checkwindow.py Tighter results. Changed the call selection to use a single click.
180
182
  - [24-4-9-4] Check for portaudio instead of crash boom. Removed empty dockwidget. Tested on Plasma 6.
181
183
  - [24-4-9-3] Ugh. It's not a real day unless you forget to test.
182
184
  - [24-4-9-2] Put back the floatable dock widgets, 'cause Wayland strikes again.
@@ -224,7 +226,7 @@ pip install -U not1mm
224
226
  ```bash
225
227
  sudo apt update
226
228
  sudo apt upgrade
227
- sudo apt install -y libportaudio2 pipx
229
+ sudo apt install -y libportaudio2 pipx libxcb-cursor0
228
230
  pipx install not1mm
229
231
  pipx ensurepath
230
232
  ```
@@ -1,8 +1,8 @@
1
1
  not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  not1mm/__main__.py,sha256=Lnwp-STJRcTvjH65oYBTIHcjQ-l0tN0pVsRJylkLJds,123143
3
3
  not1mm/bandmap.py,sha256=3kmRYItrBqpjudFb2NnkGNJpDWkwOpGPQbKwHmYnQ-o,34021
4
- not1mm/checkwindow.py,sha256=2RLnn3xrFH1EA3UEUU3_Y1UGWvvdQFgLTCM1Wd0WIjM,10160
5
- not1mm/fsutils.py,sha256=Li8Tq9K7c_q7onOHOQ7u1dOOFfhIIz5Aj2LKuQtGOO4,1652
4
+ not1mm/checkwindow.py,sha256=JiVjJO2RJlFDybeVnBQ8yi-1DnS5aiWs2QTHp_bbn5M,10381
5
+ not1mm/fsutils.py,sha256=ukHKxKTeNKxKwqRaJjtzRShL4X5Xl0jRBbADyy3Ifp8,1701
6
6
  not1mm/logwindow.py,sha256=UcO8mgs_E7ier2gg_1ESTaRxABEvcpCwKmSibm7hl74,44603
7
7
  not1mm/vfo.py,sha256=pRRj0XTbeTU9noo3nC1dbg26VYj6gHEw_srUDbyYqC0,12169
8
8
  not1mm/data/JetBrainsMono-Regular.ttf,sha256=UOHctAKY_PzCGh7zy-6f6egnCcSK0wzmF0csBqO9lDY,203952
@@ -35,7 +35,7 @@ not1mm/data/radio_green.png,sha256=PXlvRI2x0C8yLVkxRwrZe6tex8k9GtM-1Cj2Vy6KP7o,1
35
35
  not1mm/data/radio_grey.png,sha256=9eOtMHDpQvRYY29D7_vPeacWbwotRXZTMm8EiHE9TW0,1258
36
36
  not1mm/data/radio_red.png,sha256=QvkMk7thd_hCEIyK5xGAG4xVVXivl39nwOfD8USDI20,957
37
37
  not1mm/data/reddot.png,sha256=M33jEMoU8W4rQ4_MVyzzKxDPDte1ypKBch5VnUMNLKE,565
38
- not1mm/data/settings.ui,sha256=7r4aZwxKUHQGm8NLQGLINurGMvT_5VMU9p2dznW25bA,40028
38
+ not1mm/data/settings.ui,sha256=Yvv86OgXS8S3RmM16biDmvS7gp-1FssKoEjmrHy3SSk,40028
39
39
  not1mm/data/ssbmacros.txt,sha256=0Qccj4y0nlK-w5da9a9ti-jILkURtwztoDuL_D0pEJM,470
40
40
  not1mm/data/vfo.ui,sha256=ixer0pVVr8o21j_AmBA3J1OEGd96EXVFhkoNhqIQG10,2054
41
41
  not1mm/data/phonetics/0.wav,sha256=0OpYiR-3MK6fVHE6MB-HeOxSAPiDNMjqvx5JcIZtsQk,42590
@@ -103,9 +103,9 @@ not1mm/lib/n1mm.py,sha256=V1NiNyOHaPNYKe_vRsq44O1R42N8uS5PlfRa5Db4Tv0,5712
103
103
  not1mm/lib/new_contest.py,sha256=IznTDMq7yXHB6zBoGUEC_WDYPCPpsSZW4wwMJi16zK0,816
104
104
  not1mm/lib/plugin_common.py,sha256=AAKBPCXzTWZJb-h08uPNnHVG7bSCg7kwukc211gFivY,8605
105
105
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
106
- not1mm/lib/settings.py,sha256=tlXlJUUZP0IFwIDc9DboM5_1by_tHNtMXvyJ0E7B6RI,8877
106
+ not1mm/lib/settings.py,sha256=i4Za_BZDl9UotB10o8sjIkzRdR0493rMI5VaQltUZHA,9054
107
107
  not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
108
- not1mm/lib/version.py,sha256=06fmfLwWI9hb-A27faMR1y0sqUnEMb0YBGRYHJWMbzk,49
108
+ not1mm/lib/version.py,sha256=lp8En1g4BUa0u7XbiLsPUscE8NtGX9YMYd2kh52bs_M,48
109
109
  not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
110
110
  not1mm/plugins/10_10_fall_cw.py,sha256=fUjfwjuscDjicXIxsO0JHh7xTR9Vu0iPsrOLb896Qak,10873
111
111
  not1mm/plugins/10_10_spring_cw.py,sha256=WNaJP5mBQfaB6SxnFI0Vawt3AKDr94tKVtAK-EVhtUY,10878
@@ -139,9 +139,9 @@ not1mm/plugins/naqp_ssb.py,sha256=IWksulcb2_DxlkeW0h3048t8I-u00G_67KBVKkp-TV4,11
139
139
  not1mm/plugins/phone_weekly_test.py,sha256=gCX0ESUoiQzDp9puwibt9-dRembNsiuEeBdawCVvjHA,12316
140
140
  not1mm/plugins/stew_perry_topband.py,sha256=DIMI3mGMKokXXb9pPLqdhBI6JVnnIs7ZnAL23nFmshE,10588
141
141
  not1mm/plugins/winter_field_day.py,sha256=4rcfRtobwjHO6BNL3WOTHzBmyyeuX79BNGBG8PfjrI8,10238
142
- not1mm-24.4.9.4.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
143
- not1mm-24.4.9.4.dist-info/METADATA,sha256=HYDIoFIrNwJg0iEXvSwr3atwoVaNk9xtvWLN7wwbWOA,27317
144
- not1mm-24.4.9.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
145
- not1mm-24.4.9.4.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
146
- not1mm-24.4.9.4.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
147
- not1mm-24.4.9.4.dist-info/RECORD,,
142
+ not1mm-24.4.17.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
143
+ not1mm-24.4.17.dist-info/METADATA,sha256=ukzMJCzVTz35GsO7Fw9cV5dL5DjnwDqKZ9DJnna9m9Q,27573
144
+ not1mm-24.4.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
145
+ not1mm-24.4.17.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
146
+ not1mm-24.4.17.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
147
+ not1mm-24.4.17.dist-info/RECORD,,