Changes between Version 29 and Version 30 of XmlRpcPlugin


Ignore:
Timestamp:
Feb 16, 2006 1:15:07 PM (8 years ago)
Author:
athomas
Comment:

Another multicall example

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcPlugin

    v29 v30  
    8181}}} 
    8282 
     83The same example using `system.multicall()`. This reduces network and server 
     84load by compacting all of the `system.methodHelp()` calls into one HTTP POST. 
     85 
     86{{{ 
     87#!python 
     88import xmlrpclib 
     89 
     90server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc") 
     91methods = server.system.listMethods() 
     92method_help = server.system.multicall([{'methodName': 'system.methodHelp', 'params': [method]} for method in methods]) 
     93for help in method_help: 
     94    lines  = help.splitlines() 
     95    print lines[0] 
     96    print '\n'.join(['  ' + x for x in lines[2:]]) 
     97    print 
     98}}} 
     99 
    83100List all tickets that are owned by athomas, using the XML-RPC multicall system  
    84101to issue multiple RPC calls with one HTTP request: