Change the event_list to be a dictionary of known_events and their docstrings
This commit is contained in:
parent
ad04b2a137
commit
2b3bd4f1f3
|
@ -41,15 +41,20 @@ and subsequently emitted to the clients.
|
|||
|
||||
"""
|
||||
|
||||
event_list = []
|
||||
known_events = {}
|
||||
|
||||
class DelugeEventMetaClass(type):
|
||||
"""
|
||||
This metaclass simply keeps a list of all events classes created.
|
||||
"""
|
||||
def __init__(cls, name, bases, dct):
|
||||
event_list.append(name)
|
||||
super(DelugeEventMetaClass, cls).__init__(name, bases, dct)
|
||||
if name != "DelugeEvent":
|
||||
classdoc = cls.__doc__.splitlines()
|
||||
if classdoc[0].strip():
|
||||
known_events[name] = classdoc[0].strip()
|
||||
else:
|
||||
known_events[name] = classdoc[1].strip()
|
||||
|
||||
class DelugeEvent(object):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue