mirror of
https://github.com/mewtek/i2ME-Legacy.git
synced 2025-05-15 02:31:05 -05:00
Bugfix if alertmanifest doesn't exist
This commit is contained in:
parent
af80e77553
commit
e65b66f73a
@ -94,12 +94,15 @@ def getAlerts(location):
|
|||||||
locationType = 'Z'
|
locationType = 'Z'
|
||||||
|
|
||||||
#theIdent = str(Identifier)
|
#theIdent = str(Identifier)
|
||||||
thecheck = open('alertmanifest.txt', "r")
|
try:
|
||||||
check = thecheck.read()
|
thecheck = open('./.temp/alertmanifest.txt', "r")
|
||||||
|
check = thecheck.read()
|
||||||
if check.find(Identifier) != -1:
|
|
||||||
l.debug("Alert already sent...")
|
if check.find(Identifier) != -1:
|
||||||
return
|
l.debug("Alert already sent...")
|
||||||
|
return
|
||||||
|
except FileNotFoundError:
|
||||||
|
l.warning("alert manifest does not exist (yet)")
|
||||||
k += 1 #We have an alert to send!
|
k += 1 #We have an alert to send!
|
||||||
|
|
||||||
#Lets Map Our Vocal Codes!
|
#Lets Map Our Vocal Codes!
|
||||||
@ -309,7 +312,7 @@ def getAlerts(location):
|
|||||||
b.close()
|
b.close()
|
||||||
|
|
||||||
#Add our alert to the manifest so we don't keep sending in the same alert every 60 seconds unless an update is issued.
|
#Add our alert to the manifest so we don't keep sending in the same alert every 60 seconds unless an update is issued.
|
||||||
with open('alertmanifest.txt', "a") as c:
|
with open('./.temp/alertmanifest.txt', "a") as c:
|
||||||
c.write('\n' + location + '_' + x['phenomena'] + '_' + x['significance'] + '_' + str(x['processTimeUTC']))
|
c.write('\n' + location + '_' + x['phenomena'] + '_' + x['significance'] + '_' + str(x['processTimeUTC']))
|
||||||
c.close()
|
c.close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user