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

Class EventSet

source code

extern.log.log.Loggable --+
                          |
                         EventSet

I represent a set of VEVENT entries in a calendar sharing the same uid. I can have recurrence. I can be scheduled between a start time and an end time, returning a list of start and end points in UTC. I can have exception dates.

Instance Methods [hide private]
 
__init__(self, uid) source code
 
__repr__(self) source code
 
addEvent(self, event)
Add an event to the set.
source code
 
removeEvent(self, event)
Remove an event from the set.
source code
 
getPoints(self, start=None, delta=None, clip=True)
Get an ordered list of start and end points from the given start point, with the given delta, in this set of Events.
source code
 
_getRecurringEvent(self) source code
 
_getEventInstances(self, start, end, clip) source code
 
_getEventInstanceSingle(self, event, start, end) source code
 
_getEventInstancesRecur(self, event, start, end) source code
list of EventInstance
getActiveEventInstances(self, dt=None)
Get all event instances active at the given dt.
source code
list of Event
getEvents(self)
Return the list of events.
source code

Inherited from extern.log.log.Loggable: __providedBy__, __provides__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]

Inherited from extern.log.log.Loggable: __implemented__, logCategory

Method Details [hide private]

__init__(self, uid)
(Constructor)

source code 
Parameters:
  • uid (str) - the uid shared among the events on this set

addEvent(self, event)

source code 

Add an event to the set. The event must have the same uid as the set.

Parameters:
  • event (Event) - the event to add.

removeEvent(self, event)

source code 

Remove an event from the set.

Parameters:
  • event (Event) - the event to add.

getPoints(self, start=None, delta=None, clip=True)

source code 

Get an ordered list of start and end points from the given start point, with the given delta, in this set of Events.

start defaults to now. delta defaults to 0, effectively returning all points at this time. the returned list includes the extremes (start and start + delta)

Parameters:
  • start (datetime.datetime) - the start time
  • delta (datetime.timedelta) - the delta
  • clip - whether to clip all event instances to the given start and end

getActiveEventInstances(self, dt=None)

source code 

Get all event instances active at the given dt.

Parameters:
  • dt (datetime.datetime)
Returns: list of EventInstance