Package SPyRO :: Module formats :: Class XMLRPCFormat
[hide private]
[frames] | no frames]

Class XMLRPCFormat

source code

SPyRO_Format --+
               |
              XMLRPCFormat
Known Subclasses:
XMLRPCFormatLegacy

XMLRPC Format,

SPyRO Clients can use the transparent mode.
Non-SPyRO clients must send request to any of the following functions

==> SPyRO_execute(options)
Note: SPyRO_execute has an alias called 'execute' with the same arguments
Execute a dictionary (xmlrpc struct) with all the information to perform
a remote operation. The possible arguments depends of the type of the
request, (See the SPyRO's Request class).
   The basic arguments or fields are:
    |objname| The object name (ID in the server)
    |attrname| The name of the requested attribute
    |reqtype| The type of the request. It can be 'BYE', 'GET', 'SET', 'DEL',
    CALL'
    |auth| The authentication object to the request

   Advanced arguments:
    |local_server| If Request to call a remote method and exists port we call
    the method with the pass the arguments by reference the server receives
    the name or id in the remote peer (the caller) and a port to connect.
    The IP address is obtained by the socket
    |auth| The authentication object
    |extra| Additional info to append to message, for example routed calls

   When calling methods:
   
    |args| Positional arguments, tuple
    |kwargs| Keyword arguments, dictionary


Other specific functions are:
==> getAttr(object_name, attribute_name)
Retrieves the value of the attribute |attribute_name| from the object
|object_name|

==> setAttr(object_name, attribute_name, new_value)
Set the value to the attribute |attribute_name| of the object |object_name|

==> callMethod(object_name, method_name, positional_args, keyword_args, options)
Call remote methods
|object_name| The name of the object
|method_name| The name of the method
|positional_args| The position arguments (an array or list)
|keyword_args| The named arguments (a struct or dictionary)
|options| Aditional arguments (see 'SPyRO_execute'



Instance Methods [hide private]
 
__init__(self, encoding='UTF-8') source code
 
_loads(self, msg)
Loads a msg.
source code
 
_dumps(self, msg)
Dumps a msg.
source code
 
load_request(self, msg) source code
 
dump_result(self, msg)
Create a result message with |msg| object
source code
 
dump_error(self, msg)
Create a result message with |msg| object
source code

Inherited from SPyRO_Format: contenttype, dump_callMethod, dump_control, dump_getAttr, dump_setAttr, load_result

Method Details [hide private]

_loads(self, msg)

source code 
Loads a msg. Its called for every load_* if the load_* method is not overloaded
Overrides: SPyRO_Format._loads
(inherited documentation)

_dumps(self, msg)

source code 
Dumps a msg. Its called for every dump_* if the dump_* method is not overloaded
Overrides: SPyRO_Format._dumps
(inherited documentation)

load_request(self, msg)

source code 
Overrides: SPyRO_Format.load_request

dump_result(self, msg)

source code 
Create a result message with |msg| object
Overrides: SPyRO_Format.dump_result
(inherited documentation)

dump_error(self, msg)

source code 
Create a result message with |msg| object
Overrides: SPyRO_Format.dump_error
(inherited documentation)