Changes between Version 124 and Version 125 of XmlRpcPlugin


Ignore:
Timestamp:
Apr 21, 2021, 1:31:54 AM (13 months ago)
Author:
Jun Omae
Comment:

Use Request(url, request_body) since .add_data(request_body) is deprecated

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcPlugin

    v124 v125  
    132132
    133133{{{#!python
    134 import xmlrpclib
    135          
     134try:
     135    from xmlrpc import client as xmlrpclib
     136except ImportError:
     137    import xmlrpclib
     138
    136139server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc")
    137140for method in server.system.listMethods():
     
    145148
    146149{{{#!python
    147 import xmlrpclib
     150try:
     151    from xmlrpc import client as xmlrpclib
     152except ImportError:
     153    import xmlrpclib
    148154
    149155server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc")
     
    163169
    164170{{{#!python
    165 import xmlrpclib
     171try:
     172    from xmlrpc import client as xmlrpclib
     173except ImportError:
     174    import xmlrpclib
    166175
    167176server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac/devel/login/xmlrpc")
     
    176185
    177186{{{#!python
    178 import xmlrpclib
     187try:
     188    from xmlrpc import client as xmlrpclib
     189except ImportError:
     190    import xmlrpclib
    179191
    180192server = xmlrpclib.ServerProxy("http://athomas:password@localhost/trac-dev/login/xmlrpc")
     
    194206
    195207{{{#!python
    196 import xmlrpclib
     208try:
     209    from xmlrpc import client as xmlrpclib
     210except ImportError:
     211    import xmlrpclib
    197212 
    198213server = xmlrpclib.ServerProxy("http://athomas:password@localhost:8080/trunk/login/xmlrpc")
     
    206221
    207222{{{#!python
     223try:
     224    from xmlrpc import client as xmlrpclib
     225except ImportError:
     226    import xmlrpclib
     227    import urllib2
     228else:
     229    from urllib import request as urllib2
     230
    208231class HTTPSDigestTransport(xmlrpclib.SafeTransport):
    209232    """
     
    221244
    222245    def request(self, host, handler, request_body, verbose):
    223         import urllib2
    224 
    225246        url = 'https://'+host+handler
    226247        if verbose or self.verbose:
    227248            print "ProxyTransport URL: [%s]"%url
    228249
    229         request = urllib2.Request(url)
    230         request.add_data(request_body)
     250        request = urllib2.Request(url, request_body)
    231251        # Note: 'Host' and 'Content-Length' are added automatically
    232252        request.add_header("User-Agent", self.user_agent)