Add return value to Notify

This commit is contained in:
Stuckinaboot 2019-03-14 14:01:37 -04:00 committed by stuckinaboot
parent 01099e9f2c
commit a5fa053815
2 changed files with 4 additions and 0 deletions

View File

@ -46,4 +46,5 @@ class INetwork(ABC):
def notify(self, notifee): def notify(self, notifee):
""" """
:param notifee: object implementing Notifee interface :param notifee: object implementing Notifee interface
:return: true if notifee registered successfully, false otherwise
""" """

View File

@ -175,9 +175,12 @@ class Swarm(INetwork):
def notify(self, notifee): def notify(self, notifee):
""" """
:param notifee: object implementing Notifee interface :param notifee: object implementing Notifee interface
:return: true if notifee registered successfully, false otherwise
""" """
if isinstance(notifee, INotifee): if isinstance(notifee, INotifee):
self.notifees.append(notifee) self.notifees.append(notifee)
return True
return False
def add_transport(self, transport): def add_transport(self, transport):
# TODO: Support more than one transport # TODO: Support more than one transport