Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
icalendar.prop.vBinary Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def ical
def from_ical
def __str__

Public Attributes

 obj
 params

Static Public Attributes

tuple from_ical = staticmethod(from_ical)

Detailed Description

Binary property values are base 64 encoded
>>> b = vBinary('This is gibberish')
>>> b.ical()
'VGhpcyBpcyBnaWJiZXJpc2g='
>>> b = vBinary.from_ical('VGhpcyBpcyBnaWJiZXJpc2g=')
>>> b
'This is gibberish'

The roundtrip test
>>> x = 'Binary data    \x13 \x56'
>>> vBinary(x).ical()
'QmluYXJ5IGRhdGEg5iD4IOUgEyBW'
>>> vBinary.from_ical('QmluYXJ5IGRhdGEg5iD4IOUgEyBW')
'Binary data \\xe6 \\xf8 \\xe5 \\x13 V'

>>> b = vBinary('txt')
>>> b.params
Parameters({'VALUE': 'BINARY', 'ENCODING': 'BASE64'})

Definition at line 64 of file prop.py.


Constructor & Destructor Documentation

def icalendar.prop.vBinary.__init__ (   self,
  obj 
)

Definition at line 86 of file prop.py.

00086 
00087     def __init__(self, obj):
00088         self.obj = obj
00089         self.params = Parameters(encoding='BASE64', value="BINARY")


Member Function Documentation

Definition at line 90 of file prop.py.

00090 
00091     def __repr__(self):
00092         return "vBinary(%s)" % str.__repr__(self.obj)

Definition at line 104 of file prop.py.

00104 
00105     def __str__(self):
00106         return self.ical()
00107 
00108 

Here is the call graph for this function:

Definition at line 96 of file prop.py.

00096 
00097     def from_ical(ical):
00098         "Parses the data format from ical text format"
00099         try:
00100             return ical.decode('base-64')
00101         except:
            raise ValueError, 'Not valid base 64 encoding.'

Definition at line 93 of file prop.py.

00093 
00094     def ical(self):
00095         return self.obj.encode('base-64')[:-1]

Here is the caller graph for this function:


Member Data Documentation

tuple icalendar.prop.vBinary.from_ical = staticmethod(from_ical) [static]

Definition at line 102 of file prop.py.

Definition at line 87 of file prop.py.

Definition at line 88 of file prop.py.


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