Merge pull request #103 from essigt/patch-1

Add ric prefixes to notifyMyAndroid-Plugin
This commit is contained in:
Bastian Schroll 2016-08-19 07:27:47 +02:00 committed by GitHub
commit c408d38963

View file

@ -281,6 +281,25 @@ def run(typ,freq,data):
except KeyError:
# nothing found
pass
# 3. lets look for ric prefixes in pocAPIKeyList
for prefixLength in reversed(range(6)):
ricPrefix = data['ric'][:prefixLength]
#fill the ric with stars
ricPrefix = ricPrefix.ljust(8,'*')
try:
xID = ricPrefix
# data structure: pocAPIKeyList[xID][i] = (xAPIKey, xPriority, xEventPrefix)
for i in range(len(pocAPIKeyList[xID])):
xEvent = event
(xAPIKey, xPriority, xEventPrefix) = pocAPIKeyList[xID][i]
if len(xEventPrefix) > 0:
xEvent = xEventPrefix + ": " + xEvent
response = nma.pushWithAPIKey(xAPIKey, application, xEvent, msg, priority=xPriority)
checkResponse(response, xAPIKey)
except KeyError:
# nothing found
pass
# end if "POC" in typ
# end if usecsv == True
except: