Package SPyRO :: Module SPyRO :: Class Response
[show private | hide private]
[frames | no frames]

Class Response


Objects to send as response at requests. The request codes are the following: Successful = 0 # Unknown Object, no object registered to share in server, retvalue is None ErrorUnknownObject = 1 # Object doesn't have specified attribute, retvalue = None ErrorUnknownAttribute = 2 # NO USAR # An Exception Throw, exception is returned in retvalue ErrorExceptionThrowed = 3 # An error on protocol ErrorUnknownRequestType = 4 # The object is callable, we don't wanna send it, we want to call it ObjectIsCallable = 5
Method Summary
  __init__(self, errcode, retvalue, rettype)
Initialize the response with an error code |errcode| and the return value |retvalue|
  __call__(self, *args, **kwargs)
Internal function, this is the real __call__ method
  errname(self)
Returns the name of the errcode
  prepareToCall(self, remoteobj)
Returns the returned value of calling |methodname| with arguments |args|.

Class Variable Summary
int ErrorExceptionThrowed = 3                                                                     
list ErrorNames = ['Successful', 'ErrorUnknownObject', 'Error...
int ErrorUnknownAttribute = 2                                                                     
int ErrorUnknownObject = 1                                                                     
int ErrorUnknownRequestType = 4                                                                     
int ObjectIsCallable = 5                                                                     
int Successful = 0                                                                     

Method Details

__init__(self, errcode=None, retvalue=None, rettype=None)
(Constructor)

Initialize the response with an error code |errcode| and the return value |retvalue|

__call__(self, *args, **kwargs)
(Call operator)

Internal function, this is the real __call__ method

errname(self)

Returns the name of the errcode

prepareToCall(self, remoteobj)

Returns the returned value of calling |methodname| with arguments |args|. Can raise remote exceptions or locals due to remote errors

Class Variable Details

ErrorExceptionThrowed

Type:
int
Value:
3                                                                     

ErrorNames

Type:
list
Value:
['Successful',
 'ErrorUnknownObject',
 'ErrorUnknownAttribute',
 'ErrorExceptionThrowed',
 'ErrorUnknownRequestType',
 'ObjectIsCallable']                                                   

ErrorUnknownAttribute

Type:
int
Value:
2                                                                     

ErrorUnknownObject

Type:
int
Value:
1                                                                     

ErrorUnknownRequestType

Type:
int
Value:
4                                                                     

ObjectIsCallable

Type:
int
Value:
5                                                                     

Successful

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 http://epydoc.sf.net