Back to index

python3.2  3.2.2
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
xmlrpc.client.ServerProxy Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def __getattr__
def __call__

Private Member Functions

def __close
def __request

Private Attributes

 __handler
 __transport
 __encoding
 __verbose
 __allow_none

Static Private Attributes

 __str__ = __repr__

Detailed Description

uri [,options] -> a logical connection to an XML-RPC server

uri is the connection point on the server, given as
scheme://host/target.

The standard implementation always supports the "http" scheme.  If
SSL socket support is available (Python 2.0), it also supports
"https".

If the target part and the slash preceding it are both omitted,
"/RPC2" is assumed.

The following options can be given as keyword arguments:

    transport: a transport factory
    encoding: the request encoding (default is UTF-8)

All 8-bit strings passed to the server proxy are assumed to use
the given encoding.

Definition at line 1364 of file client.py.


Constructor & Destructor Documentation

def xmlrpc.client.ServerProxy.__init__ (   self,
  uri,
  transport = None,
  encoding = None,
  verbose = False,
  allow_none = False,
  use_datetime = False 
)

Definition at line 1387 of file client.py.

01387 
01388                  allow_none=False, use_datetime=False):
01389         # establish a "logical" server connection
01390 
01391         # get the url
01392         import urllib.parse
01393         type, uri = urllib.parse.splittype(uri)
01394         if type not in ("http", "https"):
01395             raise IOError("unsupported XML-RPC protocol")
01396         self.__host, self.__handler = urllib.parse.splithost(uri)
01397         if not self.__handler:
01398             self.__handler = "/RPC2"
01399 
01400         if transport is None:
01401             if type == "https":
01402                 transport = SafeTransport(use_datetime=use_datetime)
01403             else:
01404                 transport = Transport(use_datetime=use_datetime)
01405         self.__transport = transport
01406 
01407         self.__encoding = encoding or 'utf-8'
01408         self.__verbose = verbose
01409         self.__allow_none = allow_none

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

def xmlrpc.client.ServerProxy.__call__ (   self,
  attr 
)
A workaround to get special attributes on the ServerProxy
   without interfering with the magic __getattr__

Definition at line 1446 of file client.py.

01446 
01447     def __call__(self, attr):
01448         """A workaround to get special attributes on the ServerProxy
01449            without interfering with the magic __getattr__
01450         """
01451         if attr == "close":
01452             return self.__close
01453         elif attr == "transport":
01454             return self.__transport
01455         raise AttributeError("Attribute %r not found" % (attr,))
01456 
01457 # compatibility

Here is the call graph for this function:

def xmlrpc.client.ServerProxy.__close (   self) [private]

Definition at line 1410 of file client.py.

01410 
01411     def __close(self):
01412         self.__transport.close()

Here is the caller graph for this function:

def xmlrpc.client.ServerProxy.__getattr__ (   self,
  name 
)

Definition at line 1439 of file client.py.

01439 
01440     def __getattr__(self, name):
01441         # magic method dispatcher
01442         return _Method(self.__request, name)

Here is the call graph for this function:

Definition at line 1431 of file client.py.

01431 
01432     def __repr__(self):
01433         return (
01434             "<ServerProxy for %s%s>" %
01435             (self.__host, self.__handler)
01436             )

def xmlrpc.client.ServerProxy.__request (   self,
  methodname,
  params 
) [private]

Definition at line 1413 of file client.py.

01413 
01414     def __request(self, methodname, params):
01415         # call a method on the remote server
01416 
01417         request = dumps(params, methodname, encoding=self.__encoding,
01418                         allow_none=self.__allow_none).encode(self.__encoding)
01419 
01420         response = self.__transport.request(
01421             self.__host,
01422             self.__handler,
01423             request,
01424             verbose=self.__verbose
01425             )
01426 
01427         if len(response) == 1:
01428             response = response[0]
01429 
01430         return response

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1408 of file client.py.

Definition at line 1406 of file client.py.

Definition at line 1395 of file client.py.

Definition at line 1437 of file client.py.

Definition at line 1404 of file client.py.

Definition at line 1407 of file client.py.


The documentation for this class was generated from the following file: