Further bugfixes

This commit is contained in:
K2IE 2024-03-25 23:19:21 -04:00
parent 64c4b7748e
commit 03668785ab
1 changed files with 17 additions and 13 deletions

View File

@ -114,6 +114,13 @@ count = len(entries)
log.debug("Entry count: " + str(count))
dbfile = '/dev/shm/noaaconf.db'
if (count == 0):
log.info("Exiting - no events found")
if os.path.isfile(dbfile):
os.remove(dbfile)
print()
exit(0)
ppmap = '/usr/local/share/noaacap/ppmap.db'
sg = {"W":"WARN ","A":"WATCH","Y":"ADVIS","S":"STMNT","F":"4CAST",
@ -140,11 +147,6 @@ hit = 0
for i in range(0, count):
log.debug("Processing entry: " + str(i + 1))
if ("no active" in entries[i].title.string):
if os.path.isfile(dbfile):
os.remove(dbfile)
break
else:
if i == 0:
alerts = db.DB()
alerts.open(dbfile, "Alerts", db.DB_HASH, db.DB_CREATE)
@ -211,6 +213,8 @@ for i in range(0, count):
id = bytes(str(Office + Phenomena + Significance + ETN), 'utf-8')
log.debug("ID: " + id.decode('utf-8'))
# Do we have this alert?
if id in alerts:
# Is the updated time unchanged?