Merge branch 'develop' into dev-express-alarm

This commit is contained in:
Bastian Schroll 2017-10-03 15:08:57 +02:00 committed by GitHub
commit fa90ba10cc
8 changed files with 46 additions and 47 deletions

View file

@ -159,7 +159,6 @@ def convertToUTF8(inputString = ""):
raise
# End of exception UnicodeDecodeError: check given string is already UTF-8
pass
except:
logging.warning("error checking given string")

View file

@ -3,14 +3,14 @@
from xml.dom.minidom import parseString
try:
from http.client import HTTPSConnection
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from httplib import HTTPSConnection
try:
from urllib.parse import urlencode
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from urllib import urlencode
__version__ = "1.0"
@ -55,10 +55,10 @@ takes 2 optional arguments:
def delkey(self, key):
"Removes a key (unregister ?)"
if type(key) == str:
if isinstance(key, str):
if key in self._apikey:
self._apikey.remove(key)
elif type(key) == list:
elif isinstance(key, list):
for k in key:
if key in self._apikey:
self._apikey.remove(k)
@ -71,7 +71,7 @@ takes 2 optional arguments:
def pushWithAPIKey(self, apikey=[], application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False):
"""Special Funktion"""
if apikey:
if type(apikey) == str:
if isinstance(apikey, str):
apikey = [apikey]
self._apikey = uniq(apikey)
return self.push(application, event, description, url, contenttype, priority, batch_mode, html)