From 98b1bb8e56b8d6e63117163a1d280cc008fbe27c Mon Sep 17 00:00:00 2001 From: schdwlk Date: Sun, 29 Mar 2020 16:46:28 +0200 Subject: [PATCH] Added some comments to ConsumerLocator --- ConsumerLocator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ConsumerLocator.py b/ConsumerLocator.py index bebd1cb..410c644 100644 --- a/ConsumerLocator.py +++ b/ConsumerLocator.py @@ -14,7 +14,14 @@ __version__text__ = "1" class ConsumerLocator: + """ + Manages the list of consumers. + """ + def __init__(self): + """ + Initialize class. + """ self.consumerList = [{"Host": "KnownHost", "State": True, "LastOk": datetime.datetime.now()}] self.currentConsumer = self.consumerList[0]["Host"] @@ -45,9 +52,8 @@ class ConsumerLocator: def updateConsumer(self): """ 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() if not self.checkConsumer():