Module xmlrpclib
[show private | hide private]
[frames | no frames]

Module xmlrpclib

An XML-RPC client interface for Python.

############################################################
patched for use with co2 to use socket.settimeout by default
modifications are marked '# co2 patch'
############################################################

The marshalling and response parser code can also be used to
implement XML-RPC servers.

Exported exceptions:

  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package

Exported classes:

  ServerProxy    Represents a logical connection to an XML-RPC server

  Boolean        boolean wrapper to generate a "boolean" XML-RPC value
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper

  SlowParser     Slow but safe standard parser (based on xmllib)
  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server

Exported constants:

  True
  False

Exported functions:

  boolean        Convert any Python value to an XML-RPC boolean
  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).

Classes
Binary Wrapper for binary data.
DateTime DateTime wrapper for an ISO 8601 string or time tuple or localtime integer value to generate 'dateTime.iso8601' XML-RPC value.
ExpatParser  
Marshaller Generate an XML-RPC params chunk from a Python data structure.
SafeTransport Handles an HTTPS transaction to an XML-RPC server.
Server uri [,options] -> a logical connection to an XML-RPC server
ServerProxy uri [,options] -> a logical connection to an XML-RPC server
SlowParser Default XML parser (based on xmllib.XMLParser).
Transport Handles an HTTP transaction to an XML-RPC server.
Unmarshaller Unmarshal an XML-RPC response, based on incoming XML event messages (start, data, end).
_Method  

Exceptions
Error Base class for client errors.
Fault Indicates an XML-RPC fault package.
ProtocolError Indicates an HTTP protocol error.
ResponseError Indicates a broken response package.

Function Summary
  dumps(params, methodname, methodresponse, encoding, allow_none)
data [,options] -> marshalled data
  escape(s, replace)
  getparser()
getparser() -> parser, unmarshaller
  loads(data)
data -> unmarshalled data, method name
  _binary(data)
  _datetime(data)
  _decode(data, encoding, is8bit)
  _stringify(string)

Variable Summary
str __version__
int APPLICATION_ERROR
bool False
NoneType FastMarshaller
NoneType FastParser
NoneType FastUnmarshaller
int INTERNAL_ERROR
int INVALID_ENCODING_CHAR
int INVALID_METHOD_PARAMS
int INVALID_XMLRPC
long MAXINT
int METHOD_NOT_FOUND
long MININT
int NOT_WELLFORMED_ERROR
int PARSE_ERROR
int SERVER_ERROR
NoneType SgmlopParser
float SOCKET_TIMEOUT
tuple StringTypes
int SYSTEM_ERROR
int TRANSPORT_ERROR
bool True
int UNSUPPORTED_ENCODING
tuple WRAPPERS
bool _bool_is_builtin

Function Details

dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0)

data [,options] -> marshalled data

Convert an argument tuple or a Fault instance to an XML-RPC
request (or response, if the methodresponse option is used).

In addition to the data object, the following options can be given
as keyword arguments:

    methodname: the method name for a methodCall packet

    methodresponse: true to create a methodResponse packet.
    If this option is used with a tuple, the tuple must be
    a singleton (i.e. it can contain only one element).

    encoding: the packet encoding (default is UTF-8)

All 8-bit strings in the data structure are assumed to use the
packet encoding.  Unicode strings are automatically converted,
where necessary.

getparser()

getparser() -> parser, unmarshaller

Create an instance of the fastest available parser, and attach it to an unmarshalling object. Return both objects.

loads(data)

data -> unmarshalled data, method name

Convert an XML-RPC packet to unmarshalled data plus a method name (None if not present).

If the XML-RPC packet represents a fault condition, this function raises a Fault exception.

Variable Details

__version__

Type:
str
Value:
'1.0.1'                                                                

APPLICATION_ERROR

Type:
int
Value:
-32500                                                                 

False

Type:
bool
Value:
False                                                                  

FastMarshaller

Type:
NoneType
Value:
None                                                                   

FastParser

Type:
NoneType
Value:
None                                                                   

FastUnmarshaller

Type:
NoneType
Value:
None                                                                   

INTERNAL_ERROR

Type:
int
Value:
-32603                                                                 

INVALID_ENCODING_CHAR

Type:
int
Value:
-32702                                                                 

INVALID_METHOD_PARAMS

Type:
int
Value:
-32602                                                                 

INVALID_XMLRPC

Type:
int
Value:
-32600                                                                 

MAXINT

Type:
long
Value:
2147483647L                                                            

METHOD_NOT_FOUND

Type:
int
Value:
-32601                                                                 

MININT

Type:
long
Value:
-2147483648L                                                           

NOT_WELLFORMED_ERROR

Type:
int
Value:
-32700                                                                 

PARSE_ERROR

Type:
int
Value:
-32700                                                                 

SERVER_ERROR

Type:
int
Value:
-32600                                                                 

SgmlopParser

Type:
NoneType
Value:
None                                                                   

SOCKET_TIMEOUT

Type:
float
Value:
60.0                                                                   

StringTypes

Type:
tuple
Value:
(<type 'str'>, <type 'unicode'>)                                       

SYSTEM_ERROR

Type:
int
Value:
-32400                                                                 

TRANSPORT_ERROR

Type:
int
Value:
-32300                                                                 

True

Type:
bool
Value:
True                                                                   

UNSUPPORTED_ENCODING

Type:
int
Value:
-32701                                                                 

WRAPPERS

Type:
tuple
Value:
(<class xmlrpclib.DateTime at 0x402e656c>,
 <class xmlrpclib.Binary at 0x402e668c>)                               

_bool_is_builtin

Type:
bool
Value:
True                                                                   

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net