not1mm 25.3.19__py3-none-any.whl → 25.3.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 +51 -2
- not1mm/data/main.ui +19 -2
- not1mm/data/new_contest.ui +5 -0
- not1mm/data/statistics.ui +47 -0
- not1mm/lib/version.py +1 -1
- not1mm/plugins/darc_vhf.py +44 -44
- not1mm/plugins/ea_majistad_cw.py +2 -2
- not1mm/plugins/ea_majistad_ssb.py +727 -0
- not1mm/statistics.py +152 -0
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info}/METADATA +7 -3
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info}/RECORD +15 -12
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info}/WHEEL +1 -1
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info}/entry_points.txt +0 -0
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info/licenses}/LICENSE +0 -0
- {not1mm-25.3.19.dist-info → not1mm-25.3.23.dist-info}/top_level.txt +0 -0
not1mm/statistics.py
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
import datetime
|
2
|
+
import logging
|
3
|
+
import os
|
4
|
+
|
5
|
+
# import sys
|
6
|
+
|
7
|
+
from PyQt6 import uic, QtWidgets
|
8
|
+
from PyQt6.QtWidgets import QDockWidget
|
9
|
+
|
10
|
+
# from PyQt6.QtGui import QColorConstants, QPalette, QColor
|
11
|
+
from PyQt6.QtCore import pyqtSignal
|
12
|
+
|
13
|
+
import not1mm.fsutils as fsutils
|
14
|
+
from not1mm.lib.database import DataBase
|
15
|
+
|
16
|
+
from json import loads
|
17
|
+
from json.decoder import JSONDecodeError
|
18
|
+
|
19
|
+
logger = logging.getLogger(__name__)
|
20
|
+
|
21
|
+
|
22
|
+
class StatsWindow(QDockWidget):
|
23
|
+
"""The stats window. Shows something important."""
|
24
|
+
|
25
|
+
message = pyqtSignal(dict)
|
26
|
+
dbname = None
|
27
|
+
pref = {}
|
28
|
+
poll_time = datetime.datetime.now() + datetime.timedelta(milliseconds=1000)
|
29
|
+
|
30
|
+
def __init__(self):
|
31
|
+
super().__init__()
|
32
|
+
self.active = False
|
33
|
+
self.load_pref()
|
34
|
+
self.dbname = fsutils.USER_DATA_PATH / self.pref.get(
|
35
|
+
"current_database", "ham.db"
|
36
|
+
)
|
37
|
+
self.database = DataBase(self.dbname, fsutils.APP_DATA_PATH)
|
38
|
+
self.database.current_contest = self.pref.get("contest", 0)
|
39
|
+
self.load_pref()
|
40
|
+
self.dbname = fsutils.USER_DATA_PATH / self.pref.get(
|
41
|
+
"current_database", "ham.db"
|
42
|
+
)
|
43
|
+
self.database = DataBase(self.dbname, fsutils.APP_DATA_PATH)
|
44
|
+
self.database.current_contest = self.pref.get("contest", 0)
|
45
|
+
uic.loadUi(fsutils.APP_DATA_PATH / "statistics.ui", self)
|
46
|
+
|
47
|
+
def msg_from_main(self, packet):
|
48
|
+
""""""
|
49
|
+
if packet.get("cmd", "") == "DARKMODE":
|
50
|
+
self.setDarkMode(packet.get("state", False))
|
51
|
+
return
|
52
|
+
|
53
|
+
if self.active is False:
|
54
|
+
return
|
55
|
+
|
56
|
+
if packet.get("cmd", "") == "UPDATELOG":
|
57
|
+
logger.debug("External refresh command.")
|
58
|
+
self.get_run_and_total_qs()
|
59
|
+
return
|
60
|
+
|
61
|
+
if packet.get("cmd", "") == "NEWDB":
|
62
|
+
self.load_pref()
|
63
|
+
self.dbname = fsutils.USER_DATA_PATH / self.pref.get(
|
64
|
+
"current_database", "ham.db"
|
65
|
+
)
|
66
|
+
self.database = DataBase(self.dbname, fsutils.APP_DATA_PATH)
|
67
|
+
self.database.current_contest = self.pref.get("contest", 0)
|
68
|
+
|
69
|
+
def setActive(self, mode: bool) -> None:
|
70
|
+
self.active = bool(mode)
|
71
|
+
|
72
|
+
def setDarkMode(self, dark: bool) -> None:
|
73
|
+
"""Forces a darkmode palette."""
|
74
|
+
|
75
|
+
def load_pref(self) -> None:
|
76
|
+
"""
|
77
|
+
Load preference file to get current db filename and sets the initial darkmode state.
|
78
|
+
|
79
|
+
Parameters
|
80
|
+
----------
|
81
|
+
None
|
82
|
+
|
83
|
+
Returns
|
84
|
+
-------
|
85
|
+
None
|
86
|
+
"""
|
87
|
+
try:
|
88
|
+
if os.path.exists(fsutils.CONFIG_FILE):
|
89
|
+
with open(
|
90
|
+
fsutils.CONFIG_FILE, "rt", encoding="utf-8"
|
91
|
+
) as file_descriptor:
|
92
|
+
self.pref = loads(file_descriptor.read())
|
93
|
+
logger.info(f"loaded config file from {fsutils.CONFIG_FILE}")
|
94
|
+
else:
|
95
|
+
self.pref["current_database"] = "ham.db"
|
96
|
+
|
97
|
+
except (IOError, JSONDecodeError) as exception:
|
98
|
+
logger.critical("Error: %s", exception)
|
99
|
+
self.setDarkMode(self.pref.get("darkmode", False))
|
100
|
+
|
101
|
+
def get_run_and_total_qs(self):
|
102
|
+
"""get numbers"""
|
103
|
+
self.tableWidget.clear()
|
104
|
+
self.tableWidget.setColumnCount(4)
|
105
|
+
self.tableWidget.setHorizontalHeaderLabels(["BAND", "QSO", "CALLS", "POINTS"])
|
106
|
+
self.tableWidget.verticalHeader().setVisible(False)
|
107
|
+
self.tableWidget.setEditTriggers(
|
108
|
+
QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers
|
109
|
+
)
|
110
|
+
self.tableWidget.setSelectionMode(
|
111
|
+
QtWidgets.QAbstractItemView.SelectionMode.NoSelection
|
112
|
+
)
|
113
|
+
query = f"select DISTINCT(Band) as band from DXLOG where ContestNR = {self.database.current_contest};"
|
114
|
+
result = self.database.exec_sql_mult(query)
|
115
|
+
self.tableWidget.setRowCount(len(result) + 1)
|
116
|
+
row = 0
|
117
|
+
for band in result:
|
118
|
+
query = f"select count(*) as qs, count(DISTINCT(Call)) as calls, sum(Points) as points from DXLOG where ContestNR = {self.database.current_contest} and Band = '{band['band']}';"
|
119
|
+
result = self.database.exec_sql(query)
|
120
|
+
item = QtWidgets.QTableWidgetItem(str(band["band"]))
|
121
|
+
item.setTextAlignment(0x0002)
|
122
|
+
self.tableWidget.setItem(row, 0, item)
|
123
|
+
item = QtWidgets.QTableWidgetItem(str(result["qs"]))
|
124
|
+
item.setTextAlignment(0x0002)
|
125
|
+
self.tableWidget.setItem(row, 1, item)
|
126
|
+
item = QtWidgets.QTableWidgetItem(str(result["calls"]))
|
127
|
+
item.setTextAlignment(0x0002)
|
128
|
+
self.tableWidget.setItem(row, 2, item)
|
129
|
+
item = QtWidgets.QTableWidgetItem(str(result["points"]))
|
130
|
+
item.setTextAlignment(0x0002)
|
131
|
+
self.tableWidget.setItem(row, 3, item)
|
132
|
+
row += 1
|
133
|
+
query = f"select count(*) as qs, count(DISTINCT(Call)) as calls, sum(Points) as points from DXLOG where ContestNR = {self.database.current_contest};"
|
134
|
+
result = self.database.exec_sql(query)
|
135
|
+
item = QtWidgets.QTableWidgetItem("TOTAL")
|
136
|
+
item.setTextAlignment(0x0002)
|
137
|
+
self.tableWidget.setItem(row, 0, item)
|
138
|
+
item = QtWidgets.QTableWidgetItem(str(result["qs"]))
|
139
|
+
item.setTextAlignment(0x0002)
|
140
|
+
self.tableWidget.setItem(row, 1, item)
|
141
|
+
item = QtWidgets.QTableWidgetItem(str(result["calls"]))
|
142
|
+
item.setTextAlignment(0x0002)
|
143
|
+
self.tableWidget.setItem(row, 2, item)
|
144
|
+
item = QtWidgets.QTableWidgetItem(str(result["points"]))
|
145
|
+
item.setTextAlignment(0x0002)
|
146
|
+
self.tableWidget.setItem(row, 3, item)
|
147
|
+
self.tableWidget.resizeColumnsToContents()
|
148
|
+
self.tableWidget.resizeRowsToContents()
|
149
|
+
|
150
|
+
|
151
|
+
if __name__ == "__main__":
|
152
|
+
print("This is not a program.\nTry Again.")
|
@@ -1,13 +1,13 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: not1mm
|
3
|
-
Version: 25.3.
|
3
|
+
Version: 25.3.23
|
4
4
|
Summary: NOT1MM Logger
|
5
5
|
Author-email: Michael Bridak <michael.bridak@gmail.com>
|
6
|
+
License-Expression: GPL-3.0-or-later
|
6
7
|
Project-URL: Homepage, https://github.com/mbridak/not1mm
|
7
8
|
Project-URL: Bug Tracker, https://github.com/mbridak/not1mm/issues
|
8
9
|
Classifier: Programming Language :: Python :: 3
|
9
10
|
Classifier: Development Status :: 5 - Production/Stable
|
10
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
11
11
|
Classifier: Environment :: X11 Applications :: Qt
|
12
12
|
Classifier: Operating System :: POSIX :: Linux
|
13
13
|
Classifier: Intended Audience :: End Users/Desktop
|
@@ -28,6 +28,7 @@ Requires-Dist: notctyparser>=23.6.21
|
|
28
28
|
Requires-Dist: rapidfuzz
|
29
29
|
Requires-Dist: appdata
|
30
30
|
Requires-Dist: Levenshtein
|
31
|
+
Dynamic: license-file
|
31
32
|
|
32
33
|
# Not1MM
|
33
34
|
<!-- markdownlint-disable MD001 MD033 -->
|
@@ -224,6 +225,7 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
|
|
224
225
|
- DARC Xmas
|
225
226
|
- DARC VHF
|
226
227
|
- EA Majistad CW
|
228
|
+
- EA Majistad SSB
|
227
229
|
- EA RTTY
|
228
230
|
- Helvetia
|
229
231
|
- IARU Fieldday R1 CW, SSB
|
@@ -245,6 +247,8 @@ generated, 'cause I'm lazy, list of those who've submitted PR's.
|
|
245
247
|
|
246
248
|
## Recent Changes
|
247
249
|
|
250
|
+
- [25-3-23] Add a statistics window.
|
251
|
+
- [25-3-19-1] Add EA His Maj King of Spain SSB.
|
248
252
|
- [25-3-19] Merged PR from @DD5ML Adding DARC VHF.
|
249
253
|
- [25-3-18] Add His Maj King of Spain CW
|
250
254
|
- [25-3-17] Add EA RTTY contest.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
not1mm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
not1mm/__main__.py,sha256=
|
2
|
+
not1mm/__main__.py,sha256=TKA6hSE2A2SZpXvMySGXNVgfE3UKhvzSC8tSzzVZTBs,151537
|
3
3
|
not1mm/bandmap.py,sha256=mdSK6oj8plEmr6WVYkzPTCfsHWKl9lea3R14cmRsAI4,31531
|
4
4
|
not1mm/checkwindow.py,sha256=VFAcKYTcoWhmIf91chwY6tyao9FQMWPiUkgDDkkWaog,9670
|
5
5
|
not1mm/fsutils.py,sha256=ukHKxKTeNKxKwqRaJjtzRShL4X5Xl0jRBbADyy3Ifp8,1701
|
@@ -8,6 +8,7 @@ not1mm/lookupservice.py,sha256=GkY_qHZfrW6XHf8upIoaG4hCFqm0fg6Ganu9ConGrIc,2628
|
|
8
8
|
not1mm/radio.py,sha256=_b-tSFuDLoBKnABxrsafGQu2p33U-KOubY7-qgLV2yg,5408
|
9
9
|
not1mm/ratewindow.py,sha256=UVkQt0nSB2COQlJQV6tFtsz4mP7d-Wj9jcjqvZw934Q,9891
|
10
10
|
not1mm/rtc_service.py,sha256=axAwnCBuTr-QL0YwXtWvg9tjwhcFsiiEZFgFjOofX6k,2816
|
11
|
+
not1mm/statistics.py,sha256=UW9FKFkJArqSnkrfMKnSi0eL-Nj5iUcIYBffeUtz8NU,5717
|
11
12
|
not1mm/test.py,sha256=RN71m2S9MPIOJMaoCi0wZhwEhpEZunvtosZxaKahRB4,101
|
12
13
|
not1mm/vfo.py,sha256=ggPyWtxMbdSE5RwdK0nDRwDNqOxdpb_pvnzZdbzZVQE,11136
|
13
14
|
not1mm/voice_keying.py,sha256=HZImqC5NgnyW2nknNYQ3b7I8-6S_hxpq5G4RcIRXn_k,3005
|
@@ -32,8 +33,8 @@ not1mm/data/k6gte.not1mm-32.png,sha256=XdTsCa3xqwTfn26Ga7RwO_Vlbg_77RKkSc8bMxVcC
|
|
32
33
|
not1mm/data/k6gte.not1mm-64.png,sha256=6ku45Gq1g5ezh04F07osoKRtanb3e4kbx5XdIEh3N90,2925
|
33
34
|
not1mm/data/logwindow.ui,sha256=f7vULj96tHIQuR1nJMyvPHHcmVgzkhv9D1isyojsnFU,1458
|
34
35
|
not1mm/data/logwindowx.ui,sha256=CwpI-h7cI1yqyldH9quKftsdHL5lTyL9ABOcf80nfqc,1632
|
35
|
-
not1mm/data/main.ui,sha256
|
36
|
-
not1mm/data/new_contest.ui,sha256=
|
36
|
+
not1mm/data/main.ui,sha256=-yhNNnaqYiAXueK4wKg3qn4tqo4EUlcSm88qQfXUVOM,63800
|
37
|
+
not1mm/data/new_contest.ui,sha256=m41EGeg1yPSUZAkF8jA2z1EKytZD9hZYiQDh1sjE2ac,24602
|
37
38
|
not1mm/data/not1mm.html,sha256=c9-mfjMwDt4f5pySUruz2gREW33CQ2_rCddM2z5CZQo,23273
|
38
39
|
not1mm/data/opon.ui,sha256=QDicqAk2lORG2UWsHa6jHlsGn6uzrrI2R4HSAocpPes,2258
|
39
40
|
not1mm/data/pickcontest.ui,sha256=4hPBszCglObThx_eIWtmK9CEcbr7WBjbB1rKZdI-o3I,1707
|
@@ -46,6 +47,7 @@ not1mm/data/rttymacros.txt,sha256=FQ2BnAChXF5w-tzmMnBOE8IgvviAEsd3cmmz4b8GOPk,46
|
|
46
47
|
not1mm/data/settings.ui,sha256=rZmhUjFAyCA8B-cd4Ljrvz5qC3NKy6S3feYVh5WX-tw,40084
|
47
48
|
not1mm/data/splash.png,sha256=85_BQotR1q24uCthrKm4SB_6ZOMwRjR-Jdp1XBHSTyg,5368
|
48
49
|
not1mm/data/ssbmacros.txt,sha256=Q7MrkaBntbeg4yQSoMv3NLoM24V4y_RVati3_wmb0mY,464
|
50
|
+
not1mm/data/statistics.ui,sha256=8hW3SxJzB4nsxo1DcJTF9oH4dPjvxo27qutAQsgl0dY,1073
|
49
51
|
not1mm/data/vfo.ui,sha256=-fmFMJLPDz0jmsOdCljL7vfmlAQgwyHkGZjomlIN3gc,2076
|
50
52
|
not1mm/data/phonetics/0.wav,sha256=0OpYiR-3MK6fVHE6MB-HeOxSAPiDNMjqvx5JcIZtsQk,42590
|
51
53
|
not1mm/data/phonetics/1.wav,sha256=OEAavA8cfVxFZwaT0HY9Wg9NAGEPKBhwhEdzGXkQs_U,30248
|
@@ -116,7 +118,7 @@ not1mm/lib/plugin_common.py,sha256=D1OBjyLmX7zuSPqgTCmHwXzAKA12J_zTQItvyIem-4Y,1
|
|
116
118
|
not1mm/lib/select_contest.py,sha256=WsptLuwkouIHeocJL3oZ6-eUfEnhpwdc-x7eMZ_TIVM,359
|
117
119
|
not1mm/lib/settings.py,sha256=mXffn8Xaj5KATPQinNBR0V5DbHWQPsRfh24_axWGYuk,15254
|
118
120
|
not1mm/lib/super_check_partial.py,sha256=hwT2NRwobu0PLDyw6ltmbmcAtGBD02CKGFbgGWjXMqA,2334
|
119
|
-
not1mm/lib/version.py,sha256=
|
121
|
+
not1mm/lib/version.py,sha256=vU3m0t16VI6NkKZdHZ_j-a-BN1_FKkNq--xKAoyB-bM,48
|
120
122
|
not1mm/lib/versiontest.py,sha256=8vDNptuBBunn-1IGkjNaquehqBYUJyjrPSF8Igmd4_Y,1286
|
121
123
|
not1mm/plugins/10_10_fall_cw.py,sha256=P63dEhRmvsEV7ixHYg-qhs5zzj0_DJXjjPHQBQr8Wwg,14731
|
122
124
|
not1mm/plugins/10_10_spring_cw.py,sha256=S_z-KbExH4_kfRbKo07zM-iVlJUKxFwzbm6LRnXYyNU,14734
|
@@ -144,9 +146,10 @@ not1mm/plugins/cq_ww_cw.py,sha256=GCsKohb1SQf9RbsXVUa_ojwkPIzm_TmCJHu2SAjaeKg,18
|
|
144
146
|
not1mm/plugins/cq_ww_rtty.py,sha256=6McNrXDziFpxgUP244jFXr3FirpVAKHPK8PU_szXvvE,22498
|
145
147
|
not1mm/plugins/cq_ww_ssb.py,sha256=gDAizDcr9cIgXJQ6S63UDtG64jvjIZQfvWw_MYfkNKU,18003
|
146
148
|
not1mm/plugins/cwt.py,sha256=mN1wGGao9lcXN8ztqED564tEbf1APl8_jQDoDFaThkw,17542
|
147
|
-
not1mm/plugins/darc_vhf.py,sha256=
|
149
|
+
not1mm/plugins/darc_vhf.py,sha256=WENCNr_v5_OrjluXDTYsIY9rPnhlx2qi-aD-96sjpZI,27367
|
148
150
|
not1mm/plugins/darc_xmas.py,sha256=KmpFXWS1jKegPCvk8XZWlzUCshhtDww2AgTGtauricQ,18919
|
149
|
-
not1mm/plugins/ea_majistad_cw.py,sha256=
|
151
|
+
not1mm/plugins/ea_majistad_cw.py,sha256=WUPM9sY2mOKSVFfOCPxtNAvEAwbjDIP8S1X1KgPJn0E,23301
|
152
|
+
not1mm/plugins/ea_majistad_ssb.py,sha256=FOd26kb_QjGCk_CIkQiG0FDw5fZQfAqE2b2xooPNylc,22895
|
150
153
|
not1mm/plugins/ea_rtty.py,sha256=RBaavcn2CRcH3NuSx5YAPsChYY2BCKpES-8YT9FtS0E,23178
|
151
154
|
not1mm/plugins/general_logging.py,sha256=eQuna-LnrWpf93LmHTTo6956GWoGocVfeYnzY5cyTmw,9600
|
152
155
|
not1mm/plugins/helvetia.py,sha256=-aL4GYn3boRMJWVWqqS3xvXUgehB58-5cTs1jWTsnxE,20027
|
@@ -170,9 +173,9 @@ not1mm/plugins/ref_ssb.py,sha256=tGK5XeFrc3z7l8OViG9DM3rc4HLUBF9S3SUkaAPrjQk,215
|
|
170
173
|
not1mm/plugins/stew_perry_topband.py,sha256=LHt0WnWMRS_m5nO9BOIQs0kO38M6x-k4eaA4nbEqDVA,15353
|
171
174
|
not1mm/plugins/weekly_rtty.py,sha256=4gfFg25KGkU9tKmwslHLc38qPAXuRGWNX48n582NC7w,20078
|
172
175
|
not1mm/plugins/winter_field_day.py,sha256=jLgEr95hJCZoc3Fi95PiNeB06thPQHFI3zOHmR6NprE,15234
|
173
|
-
not1mm-25.3.
|
174
|
-
not1mm-25.3.
|
175
|
-
not1mm-25.3.
|
176
|
-
not1mm-25.3.
|
177
|
-
not1mm-25.3.
|
178
|
-
not1mm-25.3.
|
176
|
+
not1mm-25.3.23.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
177
|
+
not1mm-25.3.23.dist-info/METADATA,sha256=O3nl8WeblJtv9jbNlPSOSg8o6eiVleC_h6pxrDWRB_8,37243
|
178
|
+
not1mm-25.3.23.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
179
|
+
not1mm-25.3.23.dist-info/entry_points.txt,sha256=pMcZk_0dxFgLkcUkF0Q874ojpwOmF3OL6EKw9LgvocM,47
|
180
|
+
not1mm-25.3.23.dist-info/top_level.txt,sha256=0YmTxEcDzQlzXub-lXASvoLpg_mt1c2thb5cVkDf5J4,7
|
181
|
+
not1mm-25.3.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|