not1mm 24.9.14__py3-none-any.whl → 24.9.22__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.
@@ -287,6 +287,11 @@
287
287
  <string>CQ WW CW</string>
288
288
  </property>
289
289
  </item>
290
+ <item>
291
+ <property name="text">
292
+ <string>CQ WW RTTY</string>
293
+ </property>
294
+ </item>
290
295
  <item>
291
296
  <property name="text">
292
297
  <string>CQ WW SSB</string>
@@ -376,24 +381,24 @@
376
381
  </property>
377
382
  <property name="dateTime">
378
383
  <datetime>
379
- <hour>8</hour>
384
+ <hour>0</hour>
380
385
  <minute>0</minute>
381
386
  <second>0</second>
382
387
  <year>2024</year>
383
388
  <month>1</month>
384
- <day>1</day>
389
+ <day>2</day>
385
390
  </datetime>
386
391
  </property>
387
392
  <property name="date">
388
393
  <date>
389
394
  <year>2024</year>
390
395
  <month>1</month>
391
- <day>1</day>
396
+ <day>2</day>
392
397
  </date>
393
398
  </property>
394
399
  <property name="time">
395
400
  <time>
396
- <hour>8</hour>
401
+ <hour>0</hour>
397
402
  <minute>0</minute>
398
403
  <second>0</second>
399
404
  </time>
@@ -0,0 +1,24 @@
1
+ S|F1|MyCall|{MYCALL}
2
+ S|F2|Exch|{EXCH}
3
+ S|F3|My NR|{SENTNR}
4
+ S|F4|empty|
5
+ S|F5|AGN|agn
6
+ S|F6|?|?
7
+ S|F7|Roger|rr
8
+ S|F8|73|73
9
+ S|F9|..|ee
10
+ S|F10|Call?|cl?
11
+ S|F11|NR??|NR?
12
+ S|F12|TU|tu
13
+ R|F1|Run CQ|cq test {MYCALL} {MYCALL} test
14
+ R|F2|HisCall|{HISCALL}
15
+ R|F3|Run Exch|{HISCALL} {SNT} {SENTNR}
16
+ R|F4|Run TU|tu {MYCALL} qrz
17
+ R|F5|MyCall|{MYCALL}
18
+ R|F6|MyNR|{SENTNR}
19
+ R|F7|?|?
20
+ R|F8|Roger|rr
21
+ R|F9|AGN|agn
22
+ R|F10|Call?|cl?
23
+ R|F11|NR?|NR?
24
+ R|F12|Ack Call?|{HISCALL} rr tu
not1mm/lib/cwinterface.py CHANGED
@@ -50,35 +50,43 @@ class CW:
50
50
  def sendcw(self, texttosend):
51
51
  """sends cw to k1el"""
52
52
  logger.debug(f"{texttosend=} {self.servertype=}")
53
- if self.servertype == 2:
54
- self._sendcw_xmlrpc(texttosend)
55
- if self.servertype == 1:
56
- self._sendcw_udp(texttosend)
57
- if self.servertype == 3 and self.cw is not None:
58
- self._sendcwcat(texttosend)
53
+ if texttosend:
54
+ if self.servertype == 2:
55
+ self._sendcw_xmlrpc(texttosend)
56
+ if self.servertype == 1:
57
+ self._sendcw_udp(texttosend)
58
+ if self.servertype == 3 and self.cw is not None:
59
+ self._sendcwcat(texttosend)
59
60
 
60
61
  def _sendcw_xmlrpc(self, texttosend):
61
62
  """sends cw to xmlrpc"""
62
63
  logger.debug("xmlrpc: %s", texttosend)
63
- with ServerProxy(f"http://{self.host}:{self.port}") as proxy:
64
- try:
65
- proxy.k1elsendstring(texttosend)
66
- except Error as exception:
67
- logger.debug(
68
- "http://%s:%s, xmlrpc error: %s", self.host, self.port, exception
69
- )
70
- except ConnectionRefusedError:
71
- logger.debug(
72
- "http://%s:%s, xmlrpc Connection Refused", self.host, self.port
73
- )
64
+ if texttosend:
65
+ with ServerProxy(f"http://{self.host}:{self.port}") as proxy:
66
+ try:
67
+ proxy.k1elsendstring(texttosend)
68
+ except Error as exception:
69
+ logger.debug(
70
+ "http://%s:%s, xmlrpc error: %s",
71
+ self.host,
72
+ self.port,
73
+ exception,
74
+ )
75
+ except ConnectionRefusedError:
76
+ logger.debug(
77
+ "http://%s:%s, xmlrpc Connection Refused", self.host, self.port
78
+ )
74
79
 
75
80
  def _sendcw_udp(self, texttosend):
76
81
  """send cw to udp port"""
77
82
  logger.debug("UDP: %s", texttosend)
78
- server_address_port = (self.host, self.port)
79
- # bufferSize = 1024
80
- udp_client_socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
81
- udp_client_socket.sendto(bytes(texttosend, "utf-8"), server_address_port)
83
+ if texttosend:
84
+ server_address_port = (self.host, self.port)
85
+ # bufferSize = 1024
86
+ udp_client_socket = socket.socket(
87
+ family=socket.AF_INET, type=socket.SOCK_DGRAM
88
+ )
89
+ udp_client_socket.sendto(bytes(texttosend, "utf-8"), server_address_port)
82
90
 
83
91
  def _sendcwcat(self, texttosend):
84
92
  """..."""
@@ -0,0 +1,23 @@
1
+ import xmlrpc.client
2
+
3
+
4
+ class FlDigi_Comm:
5
+ """Send strings to fldigi for RTTY"""
6
+
7
+ def __init__(self):
8
+ self.target = "http://127.0.0.1:7362"
9
+
10
+ def send_string(
11
+ self, message: str = None, nlbefore: bool = True, rxafter: bool = True
12
+ ):
13
+ """send string"""
14
+ try:
15
+ server = xmlrpc.client.ServerProxy(self.target)
16
+ server.main.tx()
17
+ if nlbefore:
18
+ message = f"\n{message}"
19
+ if rxafter:
20
+ message = f"{message}^r"
21
+ server.text.add_tx(message)
22
+ except OSError:
23
+ ...
not1mm/lib/lookup.py CHANGED
@@ -188,7 +188,10 @@ class QRZlookup:
188
188
  payload = {"s": self.session, "callsign": call}
189
189
  try:
190
190
  query_result = requests.get(self.qrzurl, params=payload, timeout=10.0)
191
- except requests.exceptions.Timeout as exception:
191
+ except (
192
+ requests.exceptions.Timeout,
193
+ requests.exceptions.ConnectionError,
194
+ ) as exception:
192
195
  self.error = True
193
196
  return {"error": exception}
194
197
  baseroot = xmltodict.parse(query_result.text)
@@ -228,8 +231,8 @@ class HamQTH:
228
231
  self.session = False
229
232
  payload = {"u": self.username, "p": self.password}
230
233
  try:
231
- query_result = requests.get(self.url, params=payload, timeout=10.0)
232
- except requests.exceptions.Timeout:
234
+ query_result = requests.get(self.url, params=payload, timeout=2.0)
235
+ except (requests.exceptions.Timeout, requests.exceptions.ConnectionError):
233
236
  self.error = True
234
237
  return
235
238
  logger.info("resultcode: %s", query_result.status_code)
@@ -258,7 +261,7 @@ class HamQTH:
258
261
  payload = {"id": self.session, "callsign": call, "prg": "not1mm"}
259
262
  try:
260
263
  query_result = requests.get(self.url, params=payload, timeout=10.0)
261
- except requests.exceptions.Timeout:
264
+ except (requests.exceptions.Timeout, requests.exceptions.ConnectionError):
262
265
  self.error = True
263
266
  return the_result
264
267
  logger.info("resultcode: %s", query_result.status_code)
@@ -189,6 +189,15 @@ def gen_adif(self, cabrillo_name: str, contest_id=""):
189
189
  end="\r\n",
190
190
  file=file_descriptor,
191
191
  )
192
+ # ------------CQ-WW-DX-RTTY---------
193
+ elif cabrillo_name == "CQ-WW-RTTY":
194
+ rcv = f"{str(contact.get('ZN', '')).zfill(2)} {contact.get('Exchange1', 'DX')}"
195
+ if len(rcv) > 1:
196
+ print(
197
+ f"<SRX_STRING:{len(rcv)}>{rcv.upper()}",
198
+ end="\r\n",
199
+ file=file_descriptor,
200
+ )
192
201
  elif rcvnr != "0":
193
202
  print(
194
203
  f"<SRX_STRING:{len(rcvnr)}>{rcvnr}",
not1mm/lib/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """It's the version"""
2
2
 
3
- __version__ = "24.9.14"
3
+ __version__ = "24.9.22"
@@ -403,10 +403,10 @@ def cabrillo(self):
403
403
  print(
404
404
  f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
405
405
  f"{contact.get('StationPrefix', '').ljust(13)} "
406
- f"{str(contact.get('SNT', '')).ljust(3)} "
406
+ # f"{str(contact.get('SNT', '')).ljust(3)} "
407
407
  f"{str(contact.get('SentNr', '')).ljust(6)} "
408
408
  f"{contact.get('Call', '').ljust(13)} "
409
- f"{str(contact.get('RCV', '')).ljust(3)} "
409
+ # f"{str(contact.get('RCV', '')).ljust(3)} "
410
410
  f"{str(contact.get('NR', '')).ljust(6)}",
411
411
  end="\r\n",
412
412
  file=file_descriptor,
@@ -370,10 +370,10 @@ def cabrillo(self):
370
370
  print(
371
371
  f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
372
372
  f"{contact.get('StationPrefix', '').ljust(13)} "
373
- f"{str(contact.get('SNT', '')).ljust(3)} "
373
+ # f"{str(contact.get('SNT', '')).ljust(3)} "
374
374
  f"{str(contact.get('SentNr', '')).ljust(6)} "
375
375
  f"{contact.get('Call', '').ljust(13)} "
376
- f"{str(contact.get('RCV', '')).ljust(3)} "
376
+ # f"{str(contact.get('RCV', '')).ljust(3)} "
377
377
  f"{str(contact.get('NR', '')).ljust(6)}",
378
378
  end="\r\n",
379
379
  file=file_descriptor,
@@ -370,10 +370,10 @@ def cabrillo(self):
370
370
  print(
371
371
  f"QSO: {frequency} {themode} {loggeddate} {loggedtime} "
372
372
  f"{contact.get('StationPrefix', '').ljust(13)} "
373
- f"{str(contact.get('SNT', '')).ljust(3)} "
373
+ # f"{str(contact.get('SNT', '')).ljust(3)} "
374
374
  f"{str(contact.get('SentNr', '')).ljust(6)} "
375
375
  f"{contact.get('Call', '').ljust(13)} "
376
- f"{str(contact.get('RCV', '')).ljust(3)} "
376
+ # f"{str(contact.get('RCV', '')).ljust(3)} "
377
377
  f"{str(contact.get('NR', '')).ljust(6)}",
378
378
  end="\r\n",
379
379
  file=file_descriptor,
@@ -1,5 +1,39 @@
1
1
  """CQ World Wide DX CW plugin"""
2
2
 
3
+ # CQ Worldwide DX Contest, CW
4
+ # Status: Active
5
+ # Geographic Focus: Worldwide
6
+ # Participation: Worldwide
7
+ # Awards: Worldwide
8
+ # Mode: CW
9
+ # Bands: 160, 80, 40, 20, 15, 10m
10
+ # Classes: Single Op All Band (QRP/Low/High)
11
+ # Single Op Single Band (QRP/Low/High)
12
+ # Single Op Assisted All Band (QRP/Low/High)
13
+ # Single Op Assisted Single Band (QRP/Low/High)
14
+ # Single Op Overlays: (Classic/Rookie/Youth)
15
+ # Multi-Single (Low/High)
16
+ # Multi-Two
17
+ # Multi-Multi
18
+ # Explorer
19
+ # Max power: HP: 1500 watts
20
+ # LP: 100 watts
21
+ # QRP: 5 watts
22
+ # Exchange: RST + CQ Zone No.
23
+ # Work stations: Once per band
24
+ # QSO Points: 0 points per QSO with same country (counts as mult)
25
+ # 1 point per QSO with different country same continent
26
+ # 2 points per QSO with different country same continent (NA)
27
+ # 3 points per QSO with different continent
28
+ # Multipliers: Each CQ zone once per band
29
+ # Each country once per band
30
+ # Score Calculation: Total score = total QSO points x total mults
31
+ # E-mail logs to: (none)
32
+ # Upload log at: https://www.cqww.com/logcheck/
33
+ # Mail logs to: (none)
34
+ # Find rules at: https://www.cqww.com/rules.htm
35
+ # Cabrillo name: CQ-WW-CW
36
+
3
37
  # pylint: disable=invalid-name, unused-argument, unused-variable, c-extension-no-member, unused-import
4
38
 
5
39
  import datetime