Skip to content

Commit

Permalink
Fix expiration date parsing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
K2IE committed Apr 2, 2024
1 parent 421aca6 commit 2680769
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion noaacap/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: noaacap
Version: 1.3.0
Version: 1.3.1
Section: hamradio
Priority: extra
Maintainer: Dan Srebnick <k2ie at k2ie.net>
Expand Down
10 changes: 6 additions & 4 deletions noaacap/usr/local/bin/noaacap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
##
## See /usr/local/share/noaacap/CHANGELOG for change history
##
version = "1.3"
version = "1.3.1"

import sys
import pytz
Expand Down Expand Up @@ -199,16 +199,18 @@ def move_entry(mylist,entry_val,entry_pos):
if ProductClass != "/O": #Loop if not operational
continue

EventEnd = "20" + EventEnd

# Is alert expired?
now = datetime.datetime.now(datetime.timezone.utc)
now = datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
# Fix exit on exp = '000000T0000Z'
try:
exp = dateutil.parser.parse(EventEnd)
except:
exp = now

# log.debug('Time Now: ' + datetime.datetime.strftime(now,"%y-%m-%d %H:%M") + '\n' + \
# 'Expiration: ' + datetime.datetime.strftime(exp,"%y-%m-%d %H:%M"))
# log.debug('Time Now: ' + datetime.datetime.strftime(now,"%y-%m-%d %H:%M"))
# log.debug('Expiration: ' + datetime.datetime.strftime(exp,"%y-%m-%d %H:%M"))

if now > exp:
log.debug("Alert Expired")
Expand Down
4 changes: 4 additions & 0 deletions noaacap/usr/local/share/noaacap/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
noaacap changelog
##
Version: 1.3.1
Release: April 2, 2024
Fix expiration date parsing issue
##
Version: 1.3
Release: TBD
Fixed truncation bug in compressed zone list
Expand Down

0 comments on commit 2680769

Please sign in to comment.