Package flumotion :: Package common :: Module eventcalendar
[hide private]

Module eventcalendar

source code

Classes [hide private]
  DSTTimezone
A tzinfo class representing a DST timezone
  FixedOffsetTimezone
Fixed offset in hours from UTC.
  LocalTimezone
A tzinfo class representing the system's idea of the local timezone
  UTCTimezone
A tzinfo class representing UTC
  Point
I represent a start or an end point linked to an event instance of an event.
  EventInstance
I represent one event instance of an event.
  Event
I represent a VEVENT entry in a calendar for our purposes.
  EventSet
I represent a set of VEVENT entries in a calendar sharing the same uid.
  Calendar
I represent a parsed iCalendar resource.
  NotCompilantError
Functions [hide private]
datetime.datetime or anything
_toDateTime(d)
If d is a datetime.date, convert it to datetime.datetime.
source code
datetime.datetime or None
_first_sunday_on_or_after(dt)
Looks for the closest last sunday in the month
source code
 
vDDDToDatetime(v, timezones)
Convert a vDDDType to a datetime, respecting timezones.
source code
datetime.timedelta
vDDDToTimedelta(v)
Convert a vDDDType (vDuration) to a timedelta.
source code
Calendar
fromICalendar(iCalendar)
Parse an icalendar Calendar object into our Calendar object.
source code
Calendar
fromFile(file)
Create a new calendar from an open file object.
source code
Variables [hide private]
  HAS_ICALENDAR = False
  HAS_DATEUTIL = False
  LOCAL = LocalTimezone()
  UTC = UTC
  __package__ = None
hash(x)
Function Details [hide private]

_toDateTime(d)

source code 

If d is a datetime.date, convert it to datetime.datetime.

Parameters:
  • d (anything)
Returns: datetime.datetime or anything
The equivalent datetime.datetime if d is a datetime.date; d if not

_first_sunday_on_or_after(dt)

source code 

Looks for the closest last sunday in the month

Parameters:
  • dt (datetime.datetime) - Reference date
Returns: datetime.datetime or None
Last sunday of the month

vDDDToDatetime(v, timezones)

source code 

Convert a vDDDType to a datetime, respecting timezones.

Parameters:
  • v (icalendar.prop.vDDDTypes) - the time to convert
  • timezones - Defined timezones in the calendar

vDDDToTimedelta(v)

source code 

Convert a vDDDType (vDuration) to a timedelta.

Parameters:
  • v (icalendar.prop.vDDDTypes) - the duration to convert
Returns: datetime.timedelta

fromICalendar(iCalendar)

source code 

Parse an icalendar Calendar object into our Calendar object.

Parameters:
Returns: Calendar

fromFile(file)

source code 

Create a new calendar from an open file object.

Parameters:
  • file (file object)
Returns: Calendar