diff --git a/includes/descriptionList.py b/includes/descriptionList.py index 848d39a..9e548fd 100644 --- a/includes/descriptionList.py +++ b/includes/descriptionList.py @@ -106,13 +106,10 @@ def getDescription(typ, data): logging.debug("look up description lists") try: if typ == "FMS": - global fmsDescribtionList resultStr = fmsDescribtionList[data] elif typ == "ZVEI": - global zveiDescribtionList resultStr = zveiDescribtionList[data] elif typ == "POC": - global ricDescribtionList resultStr = ricDescribtionList[data[:-1]] # MainRIC resultStr += " " + ricDescribtionList[data] # SubRIC else: diff --git a/includes/doubleFilter.py b/includes/doubleFilter.py index 8550640..887b074 100644 --- a/includes/doubleFilter.py +++ b/includes/doubleFilter.py @@ -31,12 +31,10 @@ def checkID(typ, data, msg=""): @return: True if check was OK @return: False if double was found """ - global doubleList timestamp = int(time.time()) # Get Timestamp logging.debug("checkID: %s (%s)", data, msg) - for i in range(len(doubleList)): - (xID, xTimestamp, xMsg) = doubleList[i] + for (xID, xTimestamp, xMsg) in doubleList: # given ID found? # return False if the first entry in double_ignore_time is found, we will not check for younger ones... if data == xID and timestamp < xTimestamp + globalVars.config.getint("BOSWatch", "doubleFilter_ignore_time"): diff --git a/includes/pynma/pynma.py b/includes/pynma/pynma.py index ff91a31..08a71cb 100644 --- a/includes/pynma/pynma.py +++ b/includes/pynma/pynma.py @@ -39,16 +39,16 @@ takes 2 optional arguments: self._developerkey = None self.developerkey(developerkey) if apikey: - if type(apikey) == str: + if isinstance(apikey, str): apikey = [apikey] self._apikey = uniq(apikey) def addkey(self, key): "Add a key (register ?)" - if type(key) == str: + if isinstance(key, str): if not key in self._apikey: self._apikey.append(key) - elif type(key) == list: + elif isinstance(key, list): for k in key: if not k in self._apikey: self._apikey.append(k) @@ -65,7 +65,7 @@ takes 2 optional arguments: def developerkey(self, developerkey): "Sets the developer key (and check it has the good length)" - if type(developerkey) == str and len(developerkey) == 48: + if isinstance(developerkey, str) and len(developerkey) == 48: self._developerkey = developerkey def pushWithAPIKey(self, apikey=[], application="", event="", description="", url="", contenttype=None, priority=0, batch_mode=False, html=False): diff --git a/includes/regexFilter.py b/includes/regexFilter.py index 8f3ef2c..bccd7ea 100644 --- a/includes/regexFilter.py +++ b/includes/regexFilter.py @@ -28,7 +28,6 @@ def loadFilters(): @return: nothing """ - global filterList try: logging.debug("loading filters") # For each entry in config.ini [Filters] section diff --git a/plugins/notifyMyAndroid/notifyMyAndroid.py b/plugins/notifyMyAndroid/notifyMyAndroid.py index ece1859..7fa535f 100644 --- a/plugins/notifyMyAndroid/notifyMyAndroid.py +++ b/plugins/notifyMyAndroid/notifyMyAndroid.py @@ -173,9 +173,6 @@ def run(typ,freq,data): @return: nothing """ # local variables - global fmsAPIKeyList - global zveiAPIKeyList - global pocAPIKeyList try: try: