not1mm 24.4.9.3__py3-none-any.whl → 24.4.15__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
@@ -28,7 +28,13 @@ from shutil import copyfile
28
28
 
29
29
  import notctyparser
30
30
  import psutil
31
- import sounddevice as sd
31
+
32
+ try:
33
+ import sounddevice as sd
34
+ except OSError as exception:
35
+ print(exception)
36
+ print("portaudio is not installed")
37
+ sd = None
32
38
  import soundfile as sf
33
39
  from PyQt6 import QtCore, QtGui, QtWidgets, uic
34
40
  from PyQt6.QtCore import QDir, Qt
@@ -200,8 +206,6 @@ class MainWindow(QtWidgets.QMainWindow):
200
206
  self.setCorner(Qt.Corner.BottomLeftCorner, Qt.DockWidgetArea.LeftDockWidgetArea)
201
207
  data_path = fsutils.APP_DATA_PATH / "main.ui"
202
208
  uic.loadUi(data_path, self)
203
- self.dockwidget = QtWidgets.QDockWidget(self)
204
- self.dockwidget.setAllowedAreas(Qt.DockWidgetArea.AllDockWidgetAreas)
205
209
  self.cw_entry.hide()
206
210
  self.leftdot.hide()
207
211
  self.rightdot.hide()
@@ -2269,6 +2273,9 @@ class MainWindow(QtWidgets.QMainWindow):
2269
2273
  """
2270
2274
 
2271
2275
  logger.debug("Voicing: %s", the_string)
2276
+ if sd is None:
2277
+ logger.warning("Sounddevice/portaudio not installed.")
2278
+ return
2272
2279
  op_path = fsutils.USER_DATA_PATH / self.current_op
2273
2280
  if "[" in the_string:
2274
2281
  sub_string = the_string.strip("[]").lower()
not1mm/checkwindow.py CHANGED
@@ -12,7 +12,7 @@ import queue
12
12
  from json import loads
13
13
  import Levenshtein
14
14
 
15
- from PyQt6 import QtGui, uic, QtCore
15
+ from PyQt6 import QtGui, uic
16
16
  from PyQt6.QtWidgets import QLabel, QVBoxLayout, QWidget, QDockWidget
17
17
  from PyQt6.QtGui import QMouseEvent, QColorConstants
18
18
 
@@ -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/main.ui CHANGED
@@ -31,6 +31,16 @@
31
31
  <property name="windowTitle">
32
32
  <string>Not1MM</string>
33
33
  </property>
34
+ <property name="windowIcon">
35
+ <iconset>
36
+ <normaloff>k6gte.not1mm-32.png</normaloff>k6gte.not1mm-32.png</iconset>
37
+ </property>
38
+ <property name="iconSize">
39
+ <size>
40
+ <width>32</width>
41
+ <height>32</height>
42
+ </size>
43
+ </property>
34
44
  <widget class="QWidget" name="centralwidget">
35
45
  <property name="enabled">
36
46
  <bool>true</bool>
@@ -1282,7 +1292,7 @@
1282
1292
  <x>0</x>
1283
1293
  <y>0</y>
1284
1294
  <width>878</width>
1285
- <height>30</height>
1295
+ <height>25</height>
1286
1296
  </rect>
1287
1297
  </property>
1288
1298
  <property name="nativeMenuBar">
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.4.9.3"
3
+ __version__ = "24.4.15"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: not1mm
3
- Version: 24.4.9.3
3
+ Version: 24.4.15
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
@@ -33,7 +33,7 @@ Requires-Dist: Levenshtein
33
33
  # Not1MM
34
34
 
35
35
  ![logo](https://github.com/mbridak/not1mm/raw/master/not1mm/data/k6gte.not1mm.svg)
36
-
36
+
37
37
  The worlds #1 unfinished contest logger <sup>*According to my daughter Corinna.<sup>
38
38
 
39
39
  [![PyPI](https://img.shields.io/pypi/v/not1mm)](https://pypi.org/project/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-15] checkwindow.py Tighter results. Changed the call selection to use a single click.
181
+ - [24-4-9-4] Check for portaudio instead of crash boom. Removed empty dockwidget. Tested on Plasma 6.
180
182
  - [24-4-9-3] Ugh. It's not a real day unless you forget to test.
181
183
  - [24-4-9-2] Put back the floatable dock widgets, 'cause Wayland strikes again.
182
184
  - [24-4-9-1] Removed DockWidgetFloatable from the dock widgets since my wee brain can't figure out how to add a dragable window frame to them once they are floating. Added a minimum size for the VFO LCD digits. Defaulted bandmap window to the right.
@@ -1,7 +1,7 @@
1
1
  not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- not1mm/__main__.py,sha256=kESgRlZ5anG7tkUX44ehb4IJ--607ZeatMFm7EA9QtA,123052
2
+ not1mm/__main__.py,sha256=Lnwp-STJRcTvjH65oYBTIHcjQ-l0tN0pVsRJylkLJds,123143
3
3
  not1mm/bandmap.py,sha256=3kmRYItrBqpjudFb2NnkGNJpDWkwOpGPQbKwHmYnQ-o,34021
4
- not1mm/checkwindow.py,sha256=KCXtUEha4hzC87t7_0bDQtZZ0CHGB75JDLkxhK0ot8c,10168
4
+ not1mm/checkwindow.py,sha256=JiVjJO2RJlFDybeVnBQ8yi-1DnS5aiWs2QTHp_bbn5M,10381
5
5
  not1mm/fsutils.py,sha256=Li8Tq9K7c_q7onOHOQ7u1dOOFfhIIz5Aj2LKuQtGOO4,1652
6
6
  not1mm/logwindow.py,sha256=UcO8mgs_E7ier2gg_1ESTaRxABEvcpCwKmSibm7hl74,44603
7
7
  not1mm/vfo.py,sha256=pRRj0XTbeTU9noo3nC1dbg26VYj6gHEw_srUDbyYqC0,12169
@@ -26,7 +26,7 @@ not1mm/data/k6gte.not1mm-32.png,sha256=XdTsCa3xqwTfn26Ga7RwO_Vlbg_77RKkSc8bMxVcC
26
26
  not1mm/data/k6gte.not1mm-64.png,sha256=6ku45Gq1g5ezh04F07osoKRtanb3e4kbx5XdIEh3N90,2925
27
27
  not1mm/data/logwindow.ui,sha256=vfkNdzJgFs3tTOBKLDavF2zVMvNHWOZ82fAErRi6pQY,1436
28
28
  not1mm/data/logwindowx.ui,sha256=9FzDJtLRpagvAWcDjFdB9NnvNZ4bVxdTNHy1Jit2ido,1610
29
- not1mm/data/main.ui,sha256=imj6FbVeYxz90Z4MuTy730GFjpeT0OYs7TvzybmcSY8,54341
29
+ not1mm/data/main.ui,sha256=wtfBeYdgv0VYuwlXx6WlKbKkrML_zeiSx79866Wi6cM,54585
30
30
  not1mm/data/new_contest.ui,sha256=Xubngdbs_V_-o8huXzKOOaQOfj1NSXu9giIcaL4d0qk,21823
31
31
  not1mm/data/not1mm.html,sha256=c9-mfjMwDt4f5pySUruz2gREW33CQ2_rCddM2z5CZQo,23273
32
32
  not1mm/data/opon.ui,sha256=mC4OhoVIfR1H9IqHAKXliPMm8VOVmxSEadpsFQ7XnS4,2247
@@ -105,7 +105,7 @@ not1mm/lib/plugin_common.py,sha256=AAKBPCXzTWZJb-h08uPNnHVG7bSCg7kwukc211gFivY,8
105
105
  not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
106
106
  not1mm/lib/settings.py,sha256=tlXlJUUZP0IFwIDc9DboM5_1by_tHNtMXvyJ0E7B6RI,8877
107
107
  not1mm/lib/super_check_partial.py,sha256=p5l3u2ZOCBtlWgbvskC50FpuoaIpR07tfC6zTdRWbh4,2334
108
- not1mm/lib/version.py,sha256=Gc69ESUhK0ko2hO1rFw8gz_rByjHtndpt2mrkFMoEio,49
108
+ not1mm/lib/version.py,sha256=TGgIZBlA1udqoabl-Uu2ILq7aYZGkkUWLKSGmHeX38c,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.3.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
143
- not1mm-24.4.9.3.dist-info/METADATA,sha256=t9B0Fw59uqPBa9VR6tqn7VS6QNfkOTYby9G8llm2RHc,27216
144
- not1mm-24.4.9.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
145
- not1mm-24.4.9.3.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
146
- not1mm-24.4.9.3.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
147
- not1mm-24.4.9.3.dist-info/RECORD,,
142
+ not1mm-24.4.15.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
143
+ not1mm-24.4.15.dist-info/METADATA,sha256=wggnagX-HKqQtkzyr6t0TyX74cpcRmUEKZfCo1IXsHQ,27410
144
+ not1mm-24.4.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
145
+ not1mm-24.4.15.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
146
+ not1mm-24.4.15.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
147
+ not1mm-24.4.15.dist-info/RECORD,,