not1mm 24.3.16__py3-none-any.whl → 24.3.24__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 (68) hide show
  1. not1mm/__main__.py +288 -124
  2. not1mm/bandmap.py +207 -191
  3. not1mm/checkwindow.py +62 -109
  4. not1mm/data/MASTER.SCP +1077 -749
  5. not1mm/data/bandmap.ui +4 -4
  6. not1mm/data/checkwindow.ui +9 -16
  7. not1mm/data/cty.json +1 -1
  8. not1mm/data/logwindow.ui +16 -11
  9. not1mm/data/main.ui +16 -6
  10. not1mm/data/vfo.ui +64 -52
  11. not1mm/fsutils.py +63 -0
  12. not1mm/lib/about.py +4 -2
  13. not1mm/lib/cat_interface.py +1 -1
  14. not1mm/lib/cwinterface.py +1 -1
  15. not1mm/lib/database.py +4 -4
  16. not1mm/lib/edit_contact.py +2 -2
  17. not1mm/lib/edit_macro.py +2 -3
  18. not1mm/lib/edit_opon.py +2 -2
  19. not1mm/lib/edit_station.py +3 -3
  20. not1mm/lib/ham_utility.py +1 -1
  21. not1mm/lib/lookup.py +1 -1
  22. not1mm/lib/multicast.py +9 -4
  23. not1mm/lib/n1mm.py +1 -1
  24. not1mm/lib/new_contest.py +2 -2
  25. not1mm/lib/select_contest.py +2 -2
  26. not1mm/lib/settings.py +3 -4
  27. not1mm/lib/super_check_partial.py +8 -5
  28. not1mm/lib/version.py +1 -1
  29. not1mm/logwindow.py +62 -105
  30. not1mm/plugins/10_10_fall_cw.py +1 -1
  31. not1mm/plugins/10_10_spring_cw.py +1 -1
  32. not1mm/plugins/10_10_summer_phone.py +1 -1
  33. not1mm/plugins/10_10_winter_phone.py +1 -1
  34. not1mm/plugins/arrl_10m.py +1 -1
  35. not1mm/plugins/arrl_dx_cw.py +1 -1
  36. not1mm/plugins/arrl_dx_ssb.py +1 -1
  37. not1mm/plugins/arrl_field_day.py +1 -1
  38. not1mm/plugins/arrl_ss_cw.py +1 -1
  39. not1mm/plugins/arrl_ss_phone.py +1 -1
  40. not1mm/plugins/arrl_vhf_jan.py +1 -1
  41. not1mm/plugins/arrl_vhf_jun.py +1 -1
  42. not1mm/plugins/arrl_vhf_sep.py +1 -1
  43. not1mm/plugins/canada_day.py +1 -1
  44. not1mm/plugins/cq_160_cw.py +1 -1
  45. not1mm/plugins/cq_160_ssb.py +1 -1
  46. not1mm/plugins/cq_wpx_cw.py +1 -1
  47. not1mm/plugins/cq_wpx_ssb.py +1 -1
  48. not1mm/plugins/cq_ww_cw.py +1 -1
  49. not1mm/plugins/cq_ww_ssb.py +1 -1
  50. not1mm/plugins/cwt.py +1 -1
  51. not1mm/plugins/general_logging.py +1 -1
  52. not1mm/plugins/iaru_hf.py +1 -1
  53. not1mm/plugins/jidx_cw.py +1 -1
  54. not1mm/plugins/jidx_ph.py +1 -1
  55. not1mm/plugins/naqp_cw.py +1 -1
  56. not1mm/plugins/naqp_ssb.py +1 -1
  57. not1mm/plugins/phone_weekly_test.py +1 -1
  58. not1mm/plugins/stew_perry_topband.py +1 -1
  59. not1mm/plugins/winter_field_day.py +1 -1
  60. not1mm/vfo.py +78 -98
  61. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/METADATA +67 -55
  62. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/RECORD +68 -66
  63. testing/detectdark.py +35 -0
  64. testing/test.py +13 -11
  65. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/LICENSE +0 -0
  66. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/WHEEL +0 -0
  67. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/entry_points.txt +0 -0
  68. {not1mm-24.3.16.dist-info → not1mm-24.3.24.dist-info}/top_level.txt +0 -0
not1mm/data/logwindow.ui CHANGED
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <ui version="4.0">
3
- <class>MainWindow</class>
4
- <widget class="QMainWindow" name="MainWindow">
3
+ <class>LogWindow</class>
4
+ <widget class="QWidget" name="LogWindow">
5
5
  <property name="geometry">
6
6
  <rect>
7
7
  <x>0</x>
@@ -11,11 +11,18 @@
11
11
  </rect>
12
12
  </property>
13
13
  <property name="windowTitle">
14
- <string>MainWindow</string>
14
+ <string>QSO Logs</string>
15
15
  </property>
16
- <widget class="QWidget" name="centralwidget">
17
- <layout class="QGridLayout" name="gridLayout">
18
- <item row="0" column="0">
16
+ <layout class="QVBoxLayout" name="verticalLayout">
17
+ <property name="bottomMargin"><number>2</number></property>
18
+ <property name="topMargin"><number>2</number></property>
19
+ <property name="leftMargin"><number>2</number></property>
20
+ <property name="rightMargin"><number>2</number></property>
21
+ <item>
22
+ <widget class="QSplitter" name="splitter">
23
+ <property name="orientation">
24
+ <enum>Qt::Vertical</enum>
25
+ </property>
19
26
  <widget class="QTableWidget" name="generalLog">
20
27
  <property name="font">
21
28
  <font>
@@ -23,8 +30,6 @@
23
30
  </font>
24
31
  </property>
25
32
  </widget>
26
- </item>
27
- <item row="1" column="0">
28
33
  <widget class="QTableWidget" name="focusedLog">
29
34
  <property name="font">
30
35
  <font>
@@ -32,9 +37,9 @@
32
37
  </font>
33
38
  </property>
34
39
  </widget>
35
- </item>
36
- </layout>
37
- </widget>
40
+ </widget>
41
+ </item>
42
+ </layout>
38
43
  </widget>
39
44
  <resources/>
40
45
  <connections/>
not1mm/data/main.ui CHANGED
@@ -9,8 +9,8 @@
9
9
  <rect>
10
10
  <x>0</x>
11
11
  <y>0</y>
12
- <width>866</width>
13
- <height>400</height>
12
+ <width>878</width>
13
+ <height>475</height>
14
14
  </rect>
15
15
  </property>
16
16
  <property name="sizePolicy">
@@ -894,6 +894,7 @@
894
894
  <item>
895
895
  <widget class="QFrame" name="Button_Row1">
896
896
  <layout class="QHBoxLayout" name="ButtonRow1">
897
+
897
898
  <property name="sizeConstraint">
898
899
  <enum>QLayout::SetNoConstraint</enum>
899
900
  </property>
@@ -1281,8 +1282,8 @@
1281
1282
  <rect>
1282
1283
  <x>0</x>
1283
1284
  <y>0</y>
1284
- <width>866</width>
1285
- <height>25</height>
1285
+ <width>878</width>
1286
+ <height>30</height>
1286
1287
  </rect>
1287
1288
  </property>
1288
1289
  <property name="nativeMenuBar">
@@ -1332,6 +1333,7 @@
1332
1333
  <string>View</string>
1333
1334
  </property>
1334
1335
  <addaction name="actionCW_Macros"/>
1336
+ <addaction name="actionDark_Mode_2"/>
1335
1337
  </widget>
1336
1338
  <widget class="QMenu" name="menuWindow">
1337
1339
  <property name="title">
@@ -1542,7 +1544,7 @@
1542
1544
  </action>
1543
1545
  <action name="actionLog_Window">
1544
1546
  <property name="text">
1545
- <string>Log Window</string>
1547
+ <string>QSO Log</string>
1546
1548
  </property>
1547
1549
  <property name="font">
1548
1550
  <font>
@@ -1742,7 +1744,7 @@
1742
1744
  </action>
1743
1745
  <action name="actionCheck_Window">
1744
1746
  <property name="text">
1745
- <string>Check Window</string>
1747
+ <string>Check Partial</string>
1746
1748
  </property>
1747
1749
  </action>
1748
1750
  <action name="actionVFO">
@@ -1750,6 +1752,14 @@
1750
1752
  <string>VFO</string>
1751
1753
  </property>
1752
1754
  </action>
1755
+ <action name="actionDark_Mode_2">
1756
+ <property name="checkable">
1757
+ <bool>true</bool>
1758
+ </property>
1759
+ <property name="text">
1760
+ <string>Dark Mode</string>
1761
+ </property>
1762
+ </action>
1753
1763
  </widget>
1754
1764
  <resources/>
1755
1765
  <connections/>
not1mm/data/vfo.ui CHANGED
@@ -1,66 +1,78 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <ui version="4.0">
3
- <class>MainWindow</class>
4
- <widget class="QMainWindow" name="MainWindow">
3
+ <class>VfoWindow</class>
4
+ <widget class="QWidget" name="VfoWindow">
5
5
  <property name="geometry">
6
6
  <rect>
7
7
  <x>0</x>
8
8
  <y>0</y>
9
- <width>367</width>
10
- <height>135</height>
9
+ <width>570</width>
10
+ <height>130</height>
11
11
  </rect>
12
12
  </property>
13
13
  <property name="windowTitle">
14
14
  <string>MainWindow</string>
15
15
  </property>
16
- <widget class="QWidget" name="centralwidget">
17
- <layout class="QGridLayout" name="gridLayout">
18
- <item row="0" column="0">
19
- <widget class="QFrame" name="frame">
20
- <property name="frameShape">
21
- <enum>QFrame::StyledPanel</enum>
22
- </property>
23
- <property name="frameShadow">
24
- <enum>QFrame::Raised</enum>
25
- </property>
26
- <layout class="QGridLayout" name="gridLayout_2">
27
- <item row="0" column="0">
28
- <widget class="QLCDNumber" name="lcdNumber">
29
- <property name="autoFillBackground">
30
- <bool>false</bool>
31
- </property>
32
- <property name="smallDecimalPoint">
33
- <bool>false</bool>
34
- </property>
35
- <property name="digitCount">
36
- <number>11</number>
37
- </property>
38
- <property name="mode">
39
- <enum>QLCDNumber::Dec</enum>
40
- </property>
41
- <property name="segmentStyle">
42
- <enum>QLCDNumber::Flat</enum>
43
- </property>
44
- <property name="intValue" stdset="0">
45
- <number>14032000</number>
46
- </property>
47
- </widget>
48
- </item>
49
- </layout>
50
- </widget>
51
- </item>
52
- </layout>
53
- </widget>
54
- <widget class="QMenuBar" name="menubar">
55
- <property name="geometry">
56
- <rect>
57
- <x>0</x>
58
- <y>0</y>
59
- <width>367</width>
60
- <height>28</height>
61
- </rect>
62
- </property>
63
- </widget>
16
+ <layout class="QGridLayout" name="gridLayout_3">
17
+ <item row="0" column="0">
18
+ <widget class="QMenuBar" name="menubar"/>
19
+ </item>
20
+ <item row="1" column="0">
21
+ <layout class="QGridLayout" name="gridLayout">
22
+ <item row="0" column="0">
23
+ <widget class="QFrame" name="frame">
24
+ <property name="sizePolicy">
25
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
26
+ <horstretch>0</horstretch>
27
+ <verstretch>0</verstretch>
28
+ </sizepolicy>
29
+ </property>
30
+ <property name="frameShape">
31
+ <enum>QFrame::StyledPanel</enum>
32
+ </property>
33
+ <property name="frameShadow">
34
+ <enum>QFrame::Raised</enum>
35
+ </property>
36
+ <layout class="QGridLayout" name="gridLayout_2">
37
+ <item row="0" column="0">
38
+ <widget class="QLCDNumber" name="lcdNumber">
39
+ <property name="sizePolicy">
40
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
41
+ <horstretch>0</horstretch>
42
+ <verstretch>0</verstretch>
43
+ </sizepolicy>
44
+ </property>
45
+ <property name="font">
46
+ <font>
47
+ <pointsize>25</pointsize>
48
+ </font>
49
+ </property>
50
+ <property name="autoFillBackground">
51
+ <bool>false</bool>
52
+ </property>
53
+ <property name="smallDecimalPoint">
54
+ <bool>false</bool>
55
+ </property>
56
+ <property name="digitCount">
57
+ <number>11</number>
58
+ </property>
59
+ <property name="mode">
60
+ <enum>QLCDNumber::Dec</enum>
61
+ </property>
62
+ <property name="segmentStyle">
63
+ <enum>QLCDNumber::Flat</enum>
64
+ </property>
65
+ <property name="intValue" stdset="0">
66
+ <number>14032000</number>
67
+ </property>
68
+ </widget>
69
+ </item>
70
+ </layout>
71
+ </widget>
72
+ </item>
73
+ </layout>
74
+ </item>
75
+ </layout>
64
76
  <action name="actionQuit">
65
77
  <property name="text">
66
78
  <string>Quit</string>
not1mm/fsutils.py ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """
4
+ fsutils.py: Filesystem utilities for not1mm.
5
+ @kyleboyle
6
+ """
7
+ # pylint: disable=invalid-name
8
+
9
+ import os
10
+ import platform
11
+ import sys
12
+ import subprocess
13
+ from pathlib import Path
14
+
15
+ from appdata import AppDataPaths
16
+
17
+ WORKING_PATH = Path(os.path.dirname(os.path.abspath(__file__)))
18
+
19
+ MODULE_PATH = WORKING_PATH
20
+
21
+
22
+ APP_DATA_PATH = MODULE_PATH / "data"
23
+ _app_paths = AppDataPaths(name="not1mm")
24
+ _app_paths.setup()
25
+
26
+ DATA_PATH = os.environ.get("XDG_DATA_HOME", str(Path.home() / ".local" / "share"))
27
+ DATA_PATH += "/not1mm"
28
+ USER_DATA_PATH = Path(DATA_PATH)
29
+ LOG_FILE = USER_DATA_PATH / "application.log"
30
+ _CONFIG_PATH = os.environ.get("XDG_CONFIG_HOME", str(Path.home() / ".config"))
31
+ _CONFIG_PATH += "/not1mm"
32
+ CONFIG_PATH = Path(_CONFIG_PATH)
33
+ CONFIG_FILE = CONFIG_PATH / "not1mm.json"
34
+
35
+ if platform.system() not in ["Windows", "Darwin"]:
36
+ try:
37
+ os.mkdir(CONFIG_PATH)
38
+ except FileExistsError:
39
+ ...
40
+ try:
41
+ os.mkdir(USER_DATA_PATH)
42
+ except FileExistsError:
43
+ ...
44
+
45
+ if platform.system() in ["Windows", "Darwin"]:
46
+ LOG_FILE = _app_paths.get_log_file_path(name="appplication.log")
47
+ _DATA_PATH = Path(_app_paths.app_data_path)
48
+ USER_DATA_PATH = _DATA_PATH
49
+ CONFIG_PATH = USER_DATA_PATH
50
+ CONFIG_FILE = CONFIG_PATH / "not1mm.json"
51
+
52
+ DARK_STYLESHEET = ""
53
+
54
+
55
+ def openFileWithOS(file):
56
+ """Open a file with the default program for that OS."""
57
+ if sys.platform == "win32":
58
+ os.startfile(file)
59
+ elif sys.platform == "darwin":
60
+ subprocess.Popen(["open", file])
61
+ else:
62
+ subprocess.Popen(["xdg-open", file])
63
+ # os.system(f"xdg-open {fsutils.USER_DATA_PATH / macro_file}")
not1mm/lib/about.py CHANGED
@@ -1,15 +1,17 @@
1
1
  """The About Dialog"""
2
2
 
3
+ # pylint: disable=c-extension-no-member
4
+
3
5
  from PyQt5 import QtWidgets, uic
4
6
 
5
7
 
6
8
  class About(QtWidgets.QDialog):
7
9
  """Waste of code space"""
8
10
 
9
- def __init__(self, WORKING_PATH):
11
+ def __init__(self, app_data_path):
10
12
  parent = None
11
13
  super().__init__(parent)
12
- uic.loadUi(WORKING_PATH + "/data/about.ui", self)
14
+ uic.loadUi(app_data_path / "about.ui", self)
13
15
  # self.buttonBox.clicked.connect(self.store)
14
16
 
15
17
  # def store(self):
@@ -12,7 +12,7 @@ import http
12
12
  if __name__ == "__main__":
13
13
  print("I'm not the program you are looking for.")
14
14
 
15
- logger = logging.getLogger("__main__")
15
+ logger = logging.getLogger("cat_interface")
16
16
 
17
17
 
18
18
  class CAT:
not1mm/lib/cwinterface.py CHANGED
@@ -11,7 +11,7 @@ import logging
11
11
  if __name__ == "__main__":
12
12
  print("I'm not the program you are looking for.")
13
13
 
14
- logger = logging.getLogger("__main__")
14
+ logger = logging.getLogger("cwinterface")
15
15
 
16
16
 
17
17
  class CW:
not1mm/lib/database.py CHANGED
@@ -15,7 +15,7 @@ import sqlite3
15
15
  if __name__ == "__main__":
16
16
  print("I'm not the program you are looking for.")
17
17
 
18
- logger = logging.getLogger("__main__")
18
+ logger = logging.getLogger("database")
19
19
 
20
20
 
21
21
  class DataBase:
@@ -23,10 +23,10 @@ class DataBase:
23
23
 
24
24
  current_contest = 1
25
25
 
26
- def __init__(self, database: str, working_path: str):
26
+ def __init__(self, database: str, app_data_dir: str):
27
27
  """initializes DataBase instance"""
28
28
  logger.debug("Database: %s", database)
29
- self.working_path = working_path
29
+ self.app_data_dir = app_data_dir
30
30
  self.empty_contact = {
31
31
  "TS": "",
32
32
  "Call": "",
@@ -198,7 +198,7 @@ class DataBase:
198
198
  result = cursor.fetchall()
199
199
  if len(result) == 0:
200
200
  with open(
201
- self.working_path + "/data/contests.sql", encoding="utf-8"
201
+ self.app_data_dir / "contests.sql", encoding="utf-8"
202
202
  ) as data:
203
203
  for line in data.readlines():
204
204
  cursor.execute(line)
@@ -6,9 +6,9 @@ from PyQt5 import QtWidgets, uic
6
6
  class EditContact(QtWidgets.QDialog):
7
7
  """Edit Contact"""
8
8
 
9
- def __init__(self, WORKING_PATH):
9
+ def __init__(self, app_data_path):
10
10
  super().__init__(None)
11
- uic.loadUi(WORKING_PATH + "/data/editcontact.ui", self)
11
+ uic.loadUi(app_data_path / "editcontact.ui", self)
12
12
  self.buttonBox.clicked.connect(self.store)
13
13
 
14
14
  def store(self):
not1mm/lib/edit_macro.py CHANGED
@@ -4,13 +4,12 @@ from PyQt5 import QtWidgets, uic
4
4
 
5
5
 
6
6
  class EditMacro(QtWidgets.QDialog):
7
- """Change the current operator"""
8
7
 
9
- def __init__(self, function_key, WORKING_PATH):
8
+ def __init__(self, function_key, app_data_path):
10
9
  self.function_key = function_key
11
10
  parent = None
12
11
  super().__init__(parent)
13
- uic.loadUi(WORKING_PATH + "/data/editmacro.ui", self)
12
+ uic.loadUi(app_data_path / "editmacro.ui", self)
14
13
  self.buttonBox.clicked.connect(self.store)
15
14
  self.macro_label.setText(function_key.text())
16
15
  self.the_macro.setText(function_key.toolTip())
not1mm/lib/edit_opon.py CHANGED
@@ -6,9 +6,9 @@ from PyQt5 import QtWidgets, uic
6
6
  class OpOn(QtWidgets.QDialog):
7
7
  """Change the current operator"""
8
8
 
9
- def __init__(self, WORKING_PATH, parent=None):
9
+ def __init__(self, app_data_path, parent=None):
10
10
  super().__init__(parent)
11
- uic.loadUi(WORKING_PATH + "/data/opon.ui", self)
11
+ uic.loadUi(app_data_path / "opon.ui", self)
12
12
  self.buttonBox.clicked.connect(self.store)
13
13
 
14
14
  def store(self):
@@ -11,14 +11,14 @@ class EditStation(QtWidgets.QDialog):
11
11
 
12
12
  cty_file = {}
13
13
 
14
- def __init__(self, WORKING_PATH):
14
+ def __init__(self, app_data_path):
15
15
  super().__init__(None)
16
- uic.loadUi(WORKING_PATH + "/data/settings.ui", self)
16
+ uic.loadUi(app_data_path / "settings.ui", self)
17
17
  self.buttonBox.clicked.connect(self.store)
18
18
  self.GridSquare.textEdited.connect(self.gridchanged)
19
19
  self.Call.textEdited.connect(self.call_changed)
20
20
  with open(
21
- WORKING_PATH + "/data/cty.json", "rt", encoding="utf-8"
21
+ app_data_path / "cty.json", "rt", encoding="utf-8"
22
22
  ) as file_descriptor:
23
23
  self.cty_file = loads(file_descriptor.read())
24
24
 
not1mm/lib/ham_utility.py CHANGED
@@ -7,7 +7,7 @@ from datetime import datetime
7
7
  from math import asin, atan2, cos, pi, radians, sin, sqrt
8
8
  from decimal import Decimal
9
9
 
10
- logger = logging.getLogger("__main__")
10
+ logger = logging.getLogger("ham_utility")
11
11
 
12
12
 
13
13
  def calculate_wpx_prefix(the_call: str) -> str:
not1mm/lib/lookup.py CHANGED
@@ -9,7 +9,7 @@ import logging
9
9
  import xmltodict
10
10
  import requests
11
11
 
12
- logger = logging.getLogger("__main__")
12
+ logger = logging.getLogger("lookup")
13
13
 
14
14
 
15
15
  class HamDBlookup:
not1mm/lib/multicast.py CHANGED
@@ -12,7 +12,7 @@ from dicttoxml import dicttoxml
12
12
 
13
13
  from PyQt5 import QtNetwork
14
14
 
15
- logger = logging.getLogger("__main__")
15
+ logger = logging.getLogger("multicast")
16
16
 
17
17
  if __name__ == "__main__":
18
18
  print("I'm not the program you are looking for.")
@@ -26,12 +26,14 @@ class Multicast:
26
26
  self.multicast_port = int(multicast_port)
27
27
  self.interface_ip = interface_ip
28
28
  self.server_udp = QtNetwork.QUdpSocket()
29
- self.server_udp.bind(
29
+ b_result = self.server_udp.bind(
30
30
  QtNetwork.QHostAddress.AnyIPv4,
31
31
  int(self.multicast_port),
32
- QtNetwork.QUdpSocket.ShareAddress,
32
+ QtNetwork.QUdpSocket.ReuseAddressHint
33
33
  )
34
- self.server_udp.joinMulticastGroup(QtNetwork.QHostAddress(self.multicast_group))
34
+ logger.warn(f"multicast bind {b_result}")
35
+ join_result = self.server_udp.joinMulticastGroup(QtNetwork.QHostAddress(self.multicast_group))
36
+ logger.warn(f"joinMulticastGroup result {join_result}")
35
37
 
36
38
  def has_pending_datagrams(self) -> bool:
37
39
  """Check if there is a pending datagram"""
@@ -90,3 +92,6 @@ class Multicast:
90
92
  .data()
91
93
  )
92
94
  return packet
95
+
96
+ def close(self):
97
+ self.server_udp.close()
not1mm/lib/n1mm.py CHANGED
@@ -10,7 +10,7 @@ import socket
10
10
  # pip3 install -U dicttoxml
11
11
  from dicttoxml import dicttoxml
12
12
 
13
- logger = logging.getLogger("__main__")
13
+ logger = logging.getLogger("n1mmlib")
14
14
 
15
15
  if __name__ == "__main__":
16
16
  print("I'm not the program you are looking for.")
not1mm/lib/new_contest.py CHANGED
@@ -6,9 +6,9 @@ from PyQt5 import QtWidgets, uic
6
6
  class NewContest(QtWidgets.QDialog):
7
7
  """New Contest"""
8
8
 
9
- def __init__(self, WORKING_PATH):
9
+ def __init__(self, app_data_path):
10
10
  super().__init__(None)
11
- uic.loadUi(WORKING_PATH + "/data/new_contest.ui", self)
11
+ uic.loadUi(app_data_path / "new_contest.ui", self)
12
12
  self.buttonBox.clicked.connect(self.store)
13
13
 
14
14
  def store(self):
@@ -6,9 +6,9 @@ from PyQt5 import QtWidgets, uic
6
6
  class SelectContest(QtWidgets.QDialog):
7
7
  """Select Contest"""
8
8
 
9
- def __init__(self, WORKING_PATH):
9
+ def __init__(self, app_data_path):
10
10
  super().__init__(None)
11
- uic.loadUi(WORKING_PATH + "/data/pickcontest.ui", self)
11
+ uic.loadUi(app_data_path / "pickcontest.ui", self)
12
12
  self.buttonBox.clicked.connect(self.store)
13
13
 
14
14
  def store(self):
not1mm/lib/settings.py CHANGED
@@ -8,12 +8,11 @@ import sounddevice as sd
8
8
  class Settings(QtWidgets.QDialog):
9
9
  """Settings dialog"""
10
10
 
11
- def __init__(self, WORKING_PATH, CONFIG_PATH, pref, parent=None):
11
+ def __init__(self, app_data_path, pref, parent=None):
12
12
  """initialize dialog"""
13
13
  super().__init__(parent)
14
- self.logger = logging.getLogger("__main__")
15
- self.config_path = CONFIG_PATH
16
- uic.loadUi(WORKING_PATH + "/data/configuration.ui", self)
14
+ self.logger = logging.getLogger("settings")
15
+ uic.loadUi(app_data_path / "configuration.ui", self)
17
16
  self.buttonBox.accepted.connect(self.save_changes)
18
17
  self.preference = pref
19
18
  self.devices = sd.query_devices()
@@ -1,7 +1,10 @@
1
1
  """Super Check Partial"""
2
2
 
3
+ # pylint: disable=unused-argument
4
+
3
5
  import logging
4
6
 
7
+ from pathlib import Path
5
8
  import requests
6
9
 
7
10
  from rapidfuzz import fuzz
@@ -12,7 +15,7 @@ MASTER_SCP_URL = "https://www.supercheckpartial.com/MASTER.SCP"
12
15
  if __name__ == "__main__":
13
16
  print("I'm not the program you are looking for.")
14
17
 
15
- logger = logging.getLogger("__main__")
18
+ logger = logging.getLogger("super_check_partial")
16
19
 
17
20
 
18
21
  def prefer_prefix_score(query: str, candidate: str, **kwargs) -> int:
@@ -28,10 +31,10 @@ def prefer_prefix_score(query: str, candidate: str, **kwargs) -> int:
28
31
  class SCP:
29
32
  """Super check partial"""
30
33
 
31
- def __init__(self, working_path):
34
+ def __init__(self, app_data_path):
32
35
  """initialize dialog"""
33
36
  self.scp = []
34
- self.working_path = working_path
37
+ self.app_data_path = app_data_path
35
38
  self.read_scp()
36
39
 
37
40
  def update_masterscp(self) -> None:
@@ -42,7 +45,7 @@ class SCP:
42
45
  with requests.Session() as session:
43
46
  the_request = session.get(MASTER_SCP_URL)
44
47
  if the_request.status_code == 200:
45
- with open(self.working_path + "/data/MASTER.SCP", "wb+") as file:
48
+ with open(Path(self.app_data_path) / "MASTER.SCP", "wb+") as file:
46
49
  file.write(the_request.content)
47
50
  return True
48
51
  return False
@@ -53,7 +56,7 @@ class SCP:
53
56
  """
54
57
  try:
55
58
  with open(
56
- self.working_path + "/data/MASTER.SCP", "r", encoding="utf-8"
59
+ Path(self.app_data_path) / "MASTER.SCP", "r", encoding="utf-8"
57
60
  ) as file_descriptor:
58
61
  self.scp = file_descriptor.readlines()
59
62
  self.scp = list(map(lambda x: x.strip(), self.scp))
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.3.16"
3
+ __version__ = "24.3.24"