Esempio n. 1
0
 def test_aliased_global_method(self):
     def my_global_method(obj, context):
         return (obj, context)
     register_global_method(my_global_method, "aliased_global_method")
     c = self.c
     h = self.h
     try:
         self.check_path("here/aliased_global_method", (h,c))
         self.check_path("here/msg/aliased_global_method", (h.msg,c))
     finally:
         unregister_global_method("aliased_global_method")
Esempio n. 2
0
def register(controller=None):
    for (name, method) in inspect.getmembers(sys.modules.get(__name__)):
        if name.startswith('_') or name.startswith('register'):
            continue
        if inspect.isfunction(method):
            register_global_method(method, name)