Skip to content

Instantly share code, notes, and snippets.

@truekonrads
Created August 20, 2015 13:57
Show Gist options
  • Select an option

  • Save truekonrads/cccba65b2a9b7f2d68e4 to your computer and use it in GitHub Desktop.

Select an option

Save truekonrads/cccba65b2a9b7f2d68e4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Poll an XML RPC server about its methods
import xmlrpclib, sys
SERVER=None
def discover():
print "Capabilities:"
print SERVER.system.capabilities()
print SERVER.system.getCapabilities()
print "Methods:"
for method in SERVER.system.listMethods():
sig=SERVER.system.methodSignature(method)
help=SERVER.system.methodHelp(method)
print "%s: '%s' (%s)" % (method,sig,help)
if __name__ == '__main__':
SERVER=xmlrpclib.Server(sys.argv[1])
discover()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment