not1mm 23.9.3.1__py3-none-any.whl → 23.10.31__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
@@ -101,9 +101,12 @@ def check_process(name: str) -> bool:
101
101
  Bool
102
102
  """
103
103
  for proc in psutil.process_iter():
104
- if len(proc.cmdline()) == 2:
105
- if name in proc.cmdline()[1]:
106
- return True
104
+ try:
105
+ if len(proc.cmdline()) == 2:
106
+ if name in proc.cmdline()[1]:
107
+ return True
108
+ except (psutil.NoSuchProcess, psutil.ZombieProcess):
109
+ continue
107
110
  return False
108
111
 
109
112
 
@@ -257,6 +260,11 @@ class MainWindow(QtWidgets.QMainWindow):
257
260
  self.leftdot.setPixmap(self.greendot)
258
261
  self.rightdot.setPixmap(self.reddot)
259
262
 
263
+ self.radio_grey = QtGui.QPixmap(icon_path + "radio_grey.png")
264
+ self.radio_red = QtGui.QPixmap(icon_path + "radio_red.png")
265
+ self.radio_green = QtGui.QPixmap(icon_path + "radio_green.png")
266
+ self.radio_icon.setPixmap(self.radio_grey)
267
+
260
268
  self.F1.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
261
269
  self.F1.customContextMenuRequested.connect(self.edit_F1)
262
270
  self.F1.clicked.connect(self.sendf1)
@@ -373,6 +381,14 @@ class MainWindow(QtWidgets.QMainWindow):
373
381
  "You can udate to the current version by using:\npip install -U not1mm"
374
382
  )
375
383
 
384
+ def set_radio_icon(self, state: int) -> None:
385
+ """change CAT icon state"""
386
+ displaystate = [self.radio_grey, self.radio_red, self.radio_green]
387
+ try:
388
+ self.radio_icon.setPixmap(displaystate[state])
389
+ except (IndexError, TypeError) as err:
390
+ logger.debug(err)
391
+
376
392
  def toggle_cw_entry(self) -> None:
377
393
  """Toggle the CW entry field on and off."""
378
394
  self.cw_entry_visible = not self.cw_entry_visible
@@ -837,15 +853,7 @@ class MainWindow(QtWidgets.QMainWindow):
837
853
  try:
838
854
  cty = notctyparser.BigCty(WORKING_PATH + "/data/cty.json")
839
855
  update_available = cty.check_update()
840
- except AttributeError as the_error:
841
- logger.debug("cty parser returned an error: %s", the_error)
842
- return
843
- except ValueError as the_error:
844
- print("cty parser returned an error: %s", the_error)
845
- logger.debug("cty parser returned an error: %s", the_error)
846
- return
847
- except locale.Error as the_error:
848
- print("cty parser returned an error: %s", the_error)
856
+ except (AttributeError, ValueError, locale.Error) as the_error:
849
857
  logger.debug("cty parser returned an error: %s", the_error)
850
858
  return
851
859
  logger.debug("Newer cty file available %s", str(update_available))
@@ -1879,6 +1887,7 @@ class MainWindow(QtWidgets.QMainWindow):
1879
1887
  self.pref.get("CAT_ip", "127.0.0.1"),
1880
1888
  int(self.pref.get("CAT_port", 12345)),
1881
1889
  )
1890
+
1882
1891
  if self.pref.get("userigctld", False):
1883
1892
  logger.debug(
1884
1893
  "Using rigctld: %s",
@@ -2320,10 +2329,13 @@ class MainWindow(QtWidgets.QMainWindow):
2320
2329
 
2321
2330
  def poll_radio(self) -> None:
2322
2331
  """stub"""
2332
+ self.set_radio_icon(0)
2323
2333
  if self.rig_control:
2324
2334
  if self.rig_control.online is False:
2335
+ self.set_radio_icon(1)
2325
2336
  self.rig_control.reinit()
2326
2337
  if self.rig_control.online:
2338
+ self.set_radio_icon(2)
2327
2339
  info_dirty = False
2328
2340
  vfo = self.rig_control.get_vfo()
2329
2341
  mode = self.rig_control.get_mode()
not1mm/bandmap.py CHANGED
@@ -737,7 +737,7 @@ class MainWindow(QtWidgets.QMainWindow):
737
737
  self.send_command("set dx extension Name CTY State Section")
738
738
  self.send_command("set dx mode " + PREF.get("cluster_mode", "OPEN"))
739
739
  return
740
- if "call:" in data:
740
+ if "call:" in data or "callsign:" in data:
741
741
  self.send_command(self.callsignField.text())
742
742
  self.send_command(PREF.get("cluster_filter", ""))
743
743
  self.send_command("set dx extension Name CTY State Section")