Exemplo n.º 1
0
 def register_listeners(self, mod):
     for event, func in util.find_prefixed_funcs(mod, 'on_'):
         try:
             self.register_listener(mod, event, func)
         except:
             self.unregister_listeners(mod)
             raise
Exemplo n.º 2
0
 def register_commands(self, mod):
     for name, func in util.find_prefixed_funcs(mod, 'cmd_'):
         try:
             self.register_command(mod, name, func)
         except:
             self.unregister_commands(mod)
             raise