Fix documentation in the new option of the event handler
This commit is contained in:
parent
f6255caade
commit
32ad83d51c
1 changed files with 9 additions and 5 deletions
|
|
@ -101,24 +101,28 @@ class EventHandler(DefaultScript):
|
||||||
Return a dictionary of events on this object.
|
Return a dictionary of events on this object.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
obj (Object or typeclass): the connected object or typeclass.
|
obj (Object or typeclass): the connected object or a general typeclass.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A dictionary of the object's events.
|
A dictionary of the object's events.
|
||||||
|
|
||||||
Note:
|
Notes:
|
||||||
Events would define what the object can have as
|
Events would define what the object can have as
|
||||||
callbacks. Note, however, that chained callbacks will not
|
callbacks. Note, however, that chained callbacks will not
|
||||||
appear in events and are handled separately.
|
appear in events and are handled separately.
|
||||||
|
|
||||||
|
You can also request the events of a typeclass, not a
|
||||||
|
connected object. This is useful to get the global list
|
||||||
|
of events for a typeclass that has no object yet.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
events = {}
|
events = {}
|
||||||
all_events = self.ndb.events
|
all_events = self.ndb.events
|
||||||
classes = Queue()
|
classes = Queue()
|
||||||
if isinstance(obj, ObjectDB):
|
if isinstance(obj, type):
|
||||||
classes.put(type(obj))
|
|
||||||
else:
|
|
||||||
classes.put(obj)
|
classes.put(obj)
|
||||||
|
else:
|
||||||
|
classes.put(type(obj))
|
||||||
|
|
||||||
invalid = []
|
invalid = []
|
||||||
while not classes.empty():
|
while not classes.empty():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue