Added some comments to ConsumerLocator

This commit is contained in:
Scharnitzky Donát 2020-03-29 16:46:28 +02:00
parent 48d6fb2cc1
commit 98b1bb8e56

View File

@ -14,7 +14,14 @@ __version__text__ = "1"
class ConsumerLocator: class ConsumerLocator:
"""
Manages the list of consumers.
"""
def __init__(self): def __init__(self):
"""
Initialize class.
"""
self.consumerList = [{"Host": "KnownHost", "State": True, "LastOk": datetime.datetime.now()}] self.consumerList = [{"Host": "KnownHost", "State": True, "LastOk": datetime.datetime.now()}]
self.currentConsumer = self.consumerList[0]["Host"] self.currentConsumer = self.consumerList[0]["Host"]
@ -45,9 +52,8 @@ class ConsumerLocator:
def updateConsumer(self): def updateConsumer(self):
""" """
Checks all the consumers in the list and updates the current consumer if necessary. Checks all the consumers in the list and updates the current consumer if necessary.
:return: the current consumer :return: the current consumer or None if there are no available customers at the moment.
""" """
self.updateConsumerList() self.updateConsumerList()
if not self.checkConsumer(): if not self.checkConsumer():