#TODO: This function needs to accept an incoming message and process it accordingly. # This function is called every time the switch receives a new message. #if message.pathThrough == True and message.origin not in self.activeLinks: #self.activeLinks.append(message.origin) #if message.pathThrough == False and message.origin in self.activeLinks: #self.activeLinks.remove(message.origin)

Respuesta :

Answer:

This function is a method of a class object that checks a message path and register or update the previous messages list with only new messages.

Explanation:

def message_check(self ) :

If message.pathThrough == True and \ message.origin not in self.activeLinks:

Self.activeLinks.append( message.origin )

Elif message.pathThrouh == False and \ message.origin in self.activeLinks:

Self.activeLinks.remove( message.origin )