Reputation: 68
How using Python I can dynamically generate my call to my xmlrpc server using xmlrpc
lib?
something like
def call_method(method_name)
server = Server(self.URL, transport=ProxiedTransport())
server.method_name(params)
The resolution takes method_name
instead of for example if method_name=get_time
:
server.get_time(params)
.
Upvotes: 0
Views: 202
Reputation: 8895
The source of xmlrpclib
contains this comment, which you might find applicable outside its original context.
# note: to call a remote object with an non-standard name, use
# result getattr(server, "strange-python-name")(args)
It's a general Python idiom.
Upvotes: 2