Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
icalendar.prop.vTime Class Reference
Inheritance diagram for icalendar.prop.vTime:
Inheritance graph
[legend]
Collaboration diagram for icalendar.prop.vTime:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def ical
def from_ical
def __str__

Public Attributes

 params

Static Public Attributes

tuple from_ical = staticmethod(from_ical)

Detailed Description

A subclass of datetime, that renders itself in the iCalendar time
format.
>>> dt = vTime(12, 30, 0)
>>> dt.ical()
'123000'

>>> vTime.from_ical('123000')
datetime.time(12, 30)

We should also fail, right?
>>> vTime.from_ical('263000')
Traceback (most recent call last):
    ...
ValueError: Expected time, got: 263000

Definition at line 1020 of file prop.py.


Constructor & Destructor Documentation

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

Definition at line 1038 of file prop.py.

01038 
01039     def __init__(self, *args, **kwargs):
01040         time.__init__(self, *args, **kwargs)
01041         self.params = Parameters()


Member Function Documentation

Definition at line 1054 of file prop.py.

01054 
01055     def __str__(self):
01056         return self.ical()
01057 
01058 

Here is the call graph for this function:

Definition at line 1045 of file prop.py.

01045 
01046     def from_ical(ical):
01047         "Parses the data format from ical text format"
01048         try:
01049             timetuple = map(int, (ical[:2],ical[2:4],ical[4:6]))
01050             return time(*timetuple)
01051         except:
            raise ValueError, 'Expected time, got: %s' % ical
def icalendar.prop.vTime.ical (   self)

Definition at line 1042 of file prop.py.

01042 
01043     def ical(self):
01044         return self.strftime("%H%M%S")

Here is the caller graph for this function:


Member Data Documentation

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

Definition at line 1052 of file prop.py.

Definition at line 1040 of file prop.py.


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