add getAllAccepting()

This commit is contained in:
David Rose 2006-11-07 16:16:49 +00:00
parent fe8a5d19ed
commit da7c1e8a10
2 changed files with 13 additions and 0 deletions

View File

@ -35,6 +35,9 @@ class DirectObject:
def isAccepting(self, event):
return messenger.isAccepting(event, self)
def getAllAccepting(self):
return messenger.getAllAccepting(self)
def isIgnoring(self, event):
return messenger.isIgnoring(event, self)

View File

@ -126,6 +126,16 @@ class Messenger:
del self.__callbacks[event]
del self.__objectEvents[object]
def getAllAccepting(self, object):
"""
Returns the list of all events accepted by the indicated object.
"""
# Get the list of events this object is listening to
eventDict = self.__objectEvents.get(object)
if eventDict:
return eventDict.keys()
return []
def isAccepting(self, event, object):
""" isAccepting(self, string, DirectOject)
Is this object accepting this event?