MCPcopy Index your code
hub / github.com/python/cpython / register_instance

Method register_instance

Lib/xmlrpc/server.py:173–207  ·  view source on GitHub ↗

Registers an instance to respond to XML-RPC requests. Only one instance can be installed at a time. If the registered instance has a _dispatch method then that method will be called with the name of the XML-RPC method and its parameters as a tuple e.g. insta

(self, instance, allow_dotted_names=False)

Source from the content-addressed store, hash-verified

171 self.use_builtin_types = use_builtin_types
172
173 def register_instance(self, instance, allow_dotted_names=False):
174 """Registers an instance to respond to XML-RPC requests.
175
176 Only one instance can be installed at a time.
177
178 If the registered instance has a _dispatch method then that
179 method will be called with the name of the XML-RPC method and
180 its parameters as a tuple
181 e.g. instance._dispatch('add',(2,3))
182
183 If the registered instance does not have a _dispatch method
184 then the instance will be searched to find a matching method
185 and, if found, will be called. Methods beginning with an '_'
186 are considered private and will not be called by
187 SimpleXMLRPCServer.
188
189 If a registered function matches an XML-RPC request, then it
190 will be called instead of the registered instance.
191
192 If the optional allow_dotted_names argument is true and the
193 instance does not have a _dispatch method, method names
194 containing dots are supported and resolved, as long as none of
195 the name segments start with an '_'.
196
197 *** SECURITY WARNING: ***
198
199 Enabling the allow_dotted_names options allows intruders
200 to access your module's global variables and may allow
201 intruders to execute arbitrary code on your machine. Only
202 use this option on a secure, closed network.
203
204 """
205
206 self.instance = instance
207 self.allow_dotted_names = allow_dotted_names
208
209 def register_function(self, function=None, name=None):
210 """Registers a function to respond to XML-RPC requests.

Callers 6

make_serverFunction · 0.80
http_serverFunction · 0.80
server.pyFile · 0.80

Calls

no outgoing calls

Tested by 5

make_serverFunction · 0.64
http_serverFunction · 0.64