Further bugfixes
This commit is contained in:
parent
64c4b7748e
commit
03668785ab
|
|
@ -114,6 +114,13 @@ count = len(entries)
|
||||||
log.debug("Entry count: " + str(count))
|
log.debug("Entry count: " + str(count))
|
||||||
|
|
||||||
dbfile = '/dev/shm/noaaconf.db'
|
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'
|
ppmap = '/usr/local/share/noaacap/ppmap.db'
|
||||||
|
|
||||||
sg = {"W":"WARN ","A":"WATCH","Y":"ADVIS","S":"STMNT","F":"4CAST",
|
sg = {"W":"WARN ","A":"WATCH","Y":"ADVIS","S":"STMNT","F":"4CAST",
|
||||||
|
|
@ -140,19 +147,14 @@ hit = 0
|
||||||
for i in range(0, count):
|
for i in range(0, count):
|
||||||
|
|
||||||
log.debug("Processing entry: " + str(i + 1))
|
log.debug("Processing entry: " + str(i + 1))
|
||||||
if ("no active" in entries[i].title.string):
|
if i == 0:
|
||||||
if os.path.isfile(dbfile):
|
alerts = db.DB()
|
||||||
os.remove(dbfile)
|
alerts.open(dbfile, "Alerts", db.DB_HASH, db.DB_CREATE)
|
||||||
break
|
if myResend > 0:
|
||||||
else:
|
resend = db.DB()
|
||||||
if i == 0:
|
resend.open(dbfile, "Resend", db.DB_HASH, db.DB_CREATE)
|
||||||
alerts = db.DB()
|
pp = db.DB()
|
||||||
alerts.open(dbfile, "Alerts", db.DB_HASH, db.DB_CREATE)
|
pp.open(ppmap, None, db.DB_HASH, db.DB_RDONLY)
|
||||||
if myResend > 0:
|
|
||||||
resend = db.DB()
|
|
||||||
resend.open(dbfile, "Resend", db.DB_HASH, db.DB_CREATE)
|
|
||||||
pp = db.DB()
|
|
||||||
pp.open(ppmap, None, db.DB_HASH, db.DB_RDONLY)
|
|
||||||
|
|
||||||
updated = entries[i].updated.string
|
updated = entries[i].updated.string
|
||||||
|
|
||||||
|
|
@ -211,6 +213,8 @@ for i in range(0, count):
|
||||||
|
|
||||||
id = bytes(str(Office + Phenomena + Significance + ETN), 'utf-8')
|
id = bytes(str(Office + Phenomena + Significance + ETN), 'utf-8')
|
||||||
|
|
||||||
|
log.debug("ID: " + id.decode('utf-8'))
|
||||||
|
|
||||||
# Do we have this alert?
|
# Do we have this alert?
|
||||||
if id in alerts:
|
if id in alerts:
|
||||||
# Is the updated time unchanged?
|
# Is the updated time unchanged?
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue