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)
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)
def listMethods(self): """ Hack to return public methods of this object via XMLRPC :TODO: - Make this work """ return list_public_methods(self)
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
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
def _listMethods(self): return list_public_methods(self)
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)
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)