Exemplo n.º 1
0
 def listMethods(self):
     result = set()
     for name, handler in self._xmlrpc_server.register.items():
         methods = list_public_methods(handler)
         methods = set('%s.%s' % (name, method) for method in methods)
         result.update(methods)
     return sorted(result)
Exemplo n.º 2
0
 def listMethods(self):
     result = set()
     for name, handler in self._xmlrpc_server.register.items():
         methods = list_public_methods(handler)
         methods = set('%s.%s' % (name, method) for method in methods)
         result.update(methods)
     return sorted(result)
Exemplo n.º 3
0
 def register_with(cls, dispatcher):
     """Adds this API's methods to the given dispatcher."""
     for method_name in list_public_methods(cls):
         if method_name != 'register_with':
             method = getattr(cls, method_name)
             full_name = '.'.join((part for part in (cls.namespace, method_name) if part))
             dispatcher.register_function(method, full_name)
Exemplo n.º 4
0
    def listMethods(self):
        """
            Hack to return public methods of this object via XMLRPC

            :TODO:
                - Make this work
        """
        return list_public_methods(self)
Exemplo n.º 5
0
 def _listMethods(self):
     """
     Class method listing (required for introspection API).
     """
     m = []
     for x in list_public_methods(self):
         if x.startswith("_"): continue
         if not is_exposed(getattr(self, x)): continue
         m.append(x)
     return m
Exemplo n.º 6
0
 def _listMethods(self):
     """
     Class method listing (required for introspection API).
     """
     m = []
     for x in list_public_methods(self):
         if x.startswith("_"): continue
         if not is_exposed( getattr(self, x) ): continue
         m.append(x)
     return m
Exemplo n.º 7
0
 def _listMethods(self):
     return list_public_methods(self)
Exemplo n.º 8
0
 def _listMethods(self):
     return list_public_methods(self)
Exemplo n.º 9
0
    def get_public_method(self, method):
        if method not in list_public_methods(self):
            raise AttributeError('Method %r not available' % method)

        return getattr(self, method)
Exemplo n.º 10
0
    def get_public_method(self, method):
        if method not in list_public_methods(self):
            raise AttributeError('Method %r not available' % method)

        return getattr(self, method)
Exemplo n.º 11
0
 def _listMethods(self):
     """The convenience function list_public_methods() scans an instance to return the names of callable attributes that do not start with an underscore."""
     # redefine _listMethods() to apply whatever rules are desired.
     return list_public_methods(self)
 def _listMethods(self):
     """The convenience function list_public_methods() scans an instance to return the names of callable attributes that do not start with an underscore."""
     # redefine _listMethods() to apply whatever rules are desired.
     return list_public_methods(self)