Syntax: Select all
@OnLevelChange
def my_listener(...):
pass
I'm using a class decorator and I need to loop through all of the class's methods, and if they have been decorated with a listener, I need to wrap them. Basically this:
Syntax: Select all
for attr in dir(cls):
func = getattr(cls, attr)
if is_decorated(func):
setattr(cls, attr, wrapped(func))
Edit: Nvm, I can just use isinstance() check for ListenerManagerDecorator