Back to index

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

List of all members.

Public Member Functions

def __init__
def ical
def from_ical
def __str__

Public Attributes

 params

Static Public Attributes

tuple bool_map = CaselessDict(true=True, false=False)
tuple from_ical = staticmethod(from_ical)

Detailed Description

Returns specific string according to state
>>> bin = vBoolean(True)
>>> bin.ical()
'TRUE'
>>> bin = vBoolean(0)
>>> bin.ical()
'FALSE'

The roundtrip test
>>> x = True
>>> x == vBoolean.from_ical(vBoolean(x).ical())
True
>>> vBoolean.from_ical('true')
True

Definition at line 109 of file prop.py.


Constructor & Destructor Documentation

def icalendar.prop.vBoolean.__init__ (   self,
  args,
  kwargs 
)

Definition at line 127 of file prop.py.

00127 
00128     def __init__(self, *args, **kwargs):
00129         int.__init__(self, *args, **kwargs)
00130         self.params = Parameters()


Member Function Documentation

Definition at line 146 of file prop.py.

00146 
00147     def __str__(self):
00148         return self.ical()
00149 
00150 

Here is the call graph for this function:

Definition at line 138 of file prop.py.

00138 
00139     def from_ical(ical):
00140         "Parses the data format from ical text format"
00141         try:
00142             return vBoolean.bool_map[ical]
00143         except:
            raise ValueError, "Expected 'TRUE' or 'FALSE'. Got %s" % ical

Definition at line 131 of file prop.py.

00131 
00132     def ical(self):
00133         if self:
00134             return 'TRUE'
00135         return 'FALSE'

Here is the caller graph for this function:


Member Data Documentation

tuple icalendar.prop.vBoolean.bool_map = CaselessDict(true=True, false=False) [static]

Definition at line 136 of file prop.py.

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

Definition at line 144 of file prop.py.

Definition at line 129 of file prop.py.


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