Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
xmlrpc.client.Binary Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
 Get buffer contents.
def __eq__
def __ne__
def decode
def encode

Public Attributes

 data

Detailed Description

Wrapper for binary data.

Definition at line 384 of file client.py.


Constructor & Destructor Documentation

def xmlrpc.client.Binary.__init__ (   self,
  data = None 
)

Definition at line 387 of file client.py.

00387 
00388     def __init__(self, data=None):
00389         if data is None:
00390             data = b""
00391         else:
00392             if not isinstance(data, bytes):
00393                 raise TypeError("expected bytes, not %s" %
00394                                 data.__class__.__name__)
00395             data = bytes(data)  # Make a copy of the bytes!
00396         self.data = data

Here is the caller graph for this function:


Member Function Documentation

def xmlrpc.client.Binary.__eq__ (   self,
  other 
)

Definition at line 405 of file client.py.

00405 
00406     def __eq__(self, other):
00407         if isinstance(other, Binary):
00408             other = other.data
00409         return self.data == other

def xmlrpc.client.Binary.__ne__ (   self,
  other 
)

Definition at line 410 of file client.py.

00410 
00411     def __ne__(self, other):
00412         if isinstance(other, Binary):
00413             other = other.data
00414         return self.data != other

Get buffer contents.

Returns:
Buffer contents, as an 8-bit string.

Definition at line 402 of file client.py.

00402 
00403     def __str__(self):
00404         return str(self.data, "latin-1")  # XXX encoding?!

def xmlrpc.client.Binary.decode (   self,
  data 
)

Definition at line 415 of file client.py.

00415 
00416     def decode(self, data):
00417         self.data = base64.decodebytes(data)

Here is the call graph for this function:

def xmlrpc.client.Binary.encode (   self,
  out 
)

Definition at line 418 of file client.py.

00418 
00419     def encode(self, out):
00420         out.write("<value><base64>\n")
00421         encoded = base64.encodebytes(self.data)
00422         out.write(encoded.decode('ascii'))
00423         out.write('\n')
00424         out.write("</base64></value>\n")

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 395 of file client.py.


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