Initial simple implementation of app.py
This commit is contained in:
@@ -19,18 +19,21 @@ class ConsumerLocator:
|
||||
Manages the list of consumers.
|
||||
"""
|
||||
|
||||
def __init__(self, comm: communicator.Communicator):
|
||||
def __init__(self):
|
||||
"""
|
||||
Initialize class.
|
||||
"""
|
||||
self.consumerList = [{"Host": "KnownHost", "State": True, "LastOk": datetime.datetime.now()}]
|
||||
self.currentConsumer = self.consumerList[0]["Host"]
|
||||
|
||||
def initCommunicator(self, comm: communicator.Communicator):
|
||||
self.communicator = comm
|
||||
|
||||
def learnconsumerlist(self):
|
||||
""""
|
||||
Learns the list of consumers.
|
||||
"""
|
||||
#TODO improve learning
|
||||
recievedConsumerList = self.communicator.discoveravailableconsumers()
|
||||
for consumer in recievedConsumerList:
|
||||
self.consumerList.append({"Host": consumer, "State": True, "LastOk": datetime.datetime.now()})
|
||||
|
||||
Reference in New Issue
Block a user