Compare commits
5 Commits
f473855e29
...
41dc1ad8a7
| Author | SHA1 | Date |
|---|---|---|
|
|
41dc1ad8a7 | |
|
|
3108a06c11 | |
|
|
b9e37c8656 | |
|
|
19246878ed | |
|
|
b0b7b6ea01 |
|
|
@ -1,5 +1,5 @@
|
|||
Package: noaacap
|
||||
Version: 1.4.0
|
||||
Version: 1.5
|
||||
Section: hamradio
|
||||
Priority: extra
|
||||
Maintainer: Dan Srebnick <k2ie at k2ie.net>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Copyright: 2017-2020 Daniel L. Srebnick <k2ie@k2ie.net>
|
||||
Copyright: 2017-2025 Daniel L. Srebnick <k2ie@k2ie.net>
|
||||
License: BSD-2-clause
|
||||
Files: *
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
##
|
||||
## See /usr/local/share/noaacap/CHANGELOG for change history
|
||||
##
|
||||
version = "1.4.0"
|
||||
version = "1.5"
|
||||
|
||||
import sys
|
||||
import pytz
|
||||
|
|
@ -22,6 +22,7 @@ import configparser
|
|||
import re
|
||||
import logging
|
||||
from systemd.journal import JournalHandler
|
||||
import argparse
|
||||
|
||||
log = logging.getLogger('noaacap')
|
||||
log.addHandler(JournalHandler(SYSLOG_IDENTIFIER='noaacap'))
|
||||
|
|
@ -30,16 +31,26 @@ if len(sys.argv) == 2 and sys.argv[1] == '-v':
|
|||
print("noaacap.py by K2IE, version " + version + "\n")
|
||||
print("A weather alert beacon exec for aprx >= 2.9 and Direwolf >= 1.3")
|
||||
print("Licensed under the BSD 2 Clause license")
|
||||
print("Copyright 2017-2024 by Daniel L. Srebnick\n")
|
||||
print("Copyright 2017-2025 by Daniel L. Srebnick\n")
|
||||
sys.exit(0)
|
||||
|
||||
# Command-line argument parsing
|
||||
parser = argparse.ArgumentParser(description="noaacap.py - APRS Weather Alerts beacon exec for aprx & Dire Wolf")
|
||||
parser.add_argument('--config', '-c',
|
||||
help='Path to the configuration file (default: /etc/noaacap.conf)',
|
||||
default='/etc/noaacap.conf')
|
||||
parser.add_argument('--dbfile', '-d',
|
||||
help='Path to the database file (default: /dev/shm/noaaconf.db)',
|
||||
default='/dev/shm/noaaconf.db')
|
||||
args = parser.parse_args()
|
||||
|
||||
# We need this function early in execution
|
||||
def ErrExit():
|
||||
log.error("Exiting")
|
||||
print()
|
||||
exit(0)
|
||||
|
||||
conffile = '/etc/noaacap.conf'
|
||||
conffile = args.config
|
||||
|
||||
if not os.path.isfile(conffile):
|
||||
log.error(conffile + " not found")
|
||||
|
|
@ -112,7 +123,7 @@ soup = BeautifulSoup(r.text, 'xml')
|
|||
entries = soup.find_all('entry')
|
||||
count = len(entries)
|
||||
|
||||
dbfile = '/dev/shm/noaaconf.db'
|
||||
dbfile = args.dbfile
|
||||
if count == 0:
|
||||
log.info("Exiting - no events found")
|
||||
if os.path.isfile(dbfile):
|
||||
|
|
@ -281,7 +292,9 @@ for i in range(0, count):
|
|||
sorted_zcs = (sorted(zcs_discrete))
|
||||
|
||||
# Move myZone to first position in case of truncation
|
||||
if myZone in sorted_zcs:
|
||||
move_entry(sorted_zcs,myZone,0)
|
||||
log.debug("myZone found in sorted zcs and moved to index 0")
|
||||
|
||||
# Move adjacent zones, if present, after myZone
|
||||
adjZone2Index = 1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
noaacap changelog
|
||||
##
|
||||
Version: 1.5
|
||||
Release: June 25, 2025
|
||||
Add command argument parsing
|
||||
##
|
||||
Version: 1.4.1
|
||||
Release: June 23, 2025
|
||||
Add XH phenomena and fix county bug
|
||||
##
|
||||
Version: 1.4
|
||||
Release: April 3, 2024
|
||||
Complete rewrite of zone parsing
|
||||
##
|
||||
Version: 1.3.1
|
||||
Release: April 2, 2024
|
||||
Fix expiration date parsing issue
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
The current release of noaacap is 1.4.0. If you are running older than this
|
||||
version, please update before asking for support.
|
||||
The current release of noaacap is 1.5. If you are running an older version
|
||||
than this, please update before asking for support.
|
||||
|
||||
This software is written in python3 and has been tested with aprx 2.9.x.
|
||||
If you are running a version < 2.9.0 you should first update aprx. The current
|
||||
|
|
@ -63,8 +63,8 @@ the following command: timedatectl list-timezones | grep America.
|
|||
myZone should be set to your zone code. A list of zone codes may be found
|
||||
at https://www.weather.gov/pimar/PubZone. Only list one zone. The program
|
||||
will send the alert for all affected zones that will fit in the allocated 67
|
||||
characters. You could instead use a county code if you wish. However the
|
||||
associated zone may also be sent, wasting characters.
|
||||
characters. You could instead use a county code, if you wish. However,
|
||||
NOAA now seems to return zones rather than counties in some cases.
|
||||
|
||||
As an example, if you're located in Lancaster, PA, the map shows that you
|
||||
are in zone 066. Enter PAZ066 for myZone.
|
||||
|
|
@ -89,4 +89,4 @@ weather alerts via this program.
|
|||
|
||||
Dan Srebnick, K2IE
|
||||
02/06/2020
|
||||
Updated 04/03/2024
|
||||
Updated 06/25/2025
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue