Lines Matching refs:instance
5 class instance, or by extending the SimpleXMLRPCServer
26 2. Install an instance:
46 3. Install an instance with custom dispatch method:
168 self.instance = None
173 def register_instance(self, instance, allow_dotted_names=False):
174 """Registers an instance to respond to XML-RPC requests.
176 Only one instance can be installed at a time.
178 If the registered instance has a _dispatch method then that
181 e.g. instance._dispatch('add',(2,3))
183 If the registered instance does not have a _dispatch method
184 then the instance will be searched to find a matching method
190 will be called instead of the registered instance.
193 instance does not have a _dispatch method, method names
206 self.instance = instance
285 if self.instance is not None:
288 if hasattr(self.instance, '_listMethods'):
289 methods |= set(self.instance._listMethods())
290 # if the instance has a _dispatch method then we
293 elif not hasattr(self.instance, '_dispatch'):
294 methods |= set(list_public_methods(self.instance))
318 elif self.instance is not None:
320 if hasattr(self.instance, '_methodHelp'):
321 return self.instance._methodHelp(method_name)
322 # if the instance has a _dispatch method then we
324 elif not hasattr(self.instance, '_dispatch'):
327 self.instance,
377 exists then the call is forwarded to the registered instance,
380 If the registered instance has a _dispatch method then that
383 e.g. instance._dispatch('add',(2,3))
385 If the registered instance does not have a _dispatch method
386 then the instance will be searched to find a matching method
403 if self.instance is not None:
404 if hasattr(self.instance, '_dispatch'):
405 # call the `_dispatch` method on the instance
406 return self.instance._dispatch(method, params)
408 # call the instance's method directly
411 self.instance,
573 Simple XML-RPC server that allows functions and a single instance
575 attempts to dispatch XML-RPC calls to the functions or instance
864 elif self.instance is not None:
866 if hasattr(self.instance, '_get_method_argstring'):
867 method_info[0] = self.instance._get_method_argstring(method_name)
868 if hasattr(self.instance, '_methodHelp'):
869 method_info[1] = self.instance._methodHelp(method_name)
874 elif not hasattr(self.instance, '_dispatch'):
877 self.instance,
886 "instance installed"