Back to index

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

List of all members.

Public Member Functions

def __init__
def ical
def from_ical
def __str__

Public Attributes

 relative
 params

Static Public Attributes

tuple week_days
tuple from_ical = staticmethod(from_ical)

Detailed Description

This returns an unquoted weekday abbrevation
>>> a = vWeekday('mo')
>>> a.ical()
'MO'

>>> a = vWeekday('erwer')
Traceback (most recent call last):
    ...
ValueError: Expected weekday abbrevation, got: ERWER

>>> vWeekday.from_ical('mo')
'MO'

>>> vWeekday.from_ical('+3mo')
'+3MO'

>>> vWeekday.from_ical('Saturday')
Traceback (most recent call last):
    ...
ValueError: Expected weekday abbrevation, got: Saturday

>>> a = vWeekday('+mo')
>>> a.ical()
'+MO'

>>> a = vWeekday('+3mo')
>>> a.ical()
'+3MO'

>>> a = vWeekday('-tu')
>>> a.ical()
'-TU'

Definition at line 707 of file prop.py.


Constructor & Destructor Documentation

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

Definition at line 746 of file prop.py.

00746 
00747     def __init__(self, *args, **kwargs):
00748         str.__init__(self, *args, **kwargs)
00749         match = WEEKDAY_RULE.match(self)
00750         if match is None:
00751             raise ValueError, 'Expected weekday abbrevation, got: %s' % self
00752         match = match.groupdict()
00753         sign = match['signal']
00754         weekday = match['weekday']
00755         relative = match['relative']
00756         if not weekday in vWeekday.week_days or sign not in '+-':
00757             raise ValueError, 'Expected weekday abbrevation, got: %s' % self
00758         self.relative = relative and int(relative) or None
00759         self.params = Parameters()


Member Function Documentation

Definition at line 771 of file prop.py.

00771 
00772     def __str__(self):
00773         return self.ical()
00774 
00775 

Here is the call graph for this function:

Definition at line 763 of file prop.py.

00763 
00764     def from_ical(ical):
00765         "Parses the data format from ical text format"
00766         try:
00767             return vWeekday(ical.upper())
00768         except:
            raise ValueError, 'Expected weekday abbrevation, got: %s' % ical

Definition at line 760 of file prop.py.

00760 
00761     def ical(self):
00762         return self.upper()

Here is the caller graph for this function:


Member Data Documentation

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

Definition at line 769 of file prop.py.

Definition at line 758 of file prop.py.

Definition at line 757 of file prop.py.

Initial value:
CaselessDict({"SU":0, "MO":1, "TU":2, "WE":3,
                              "TH":4, "FR":5, "SA":6})

Definition at line 743 of file prop.py.


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