summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-20 22:00:27 -0500
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-20 22:00:27 -0500
commit26d6038d6a8226ad94580ee5cc58fd0800251cfa (patch)
treebb872bc581730780ea610fac4aacdebcbdae70b9 /pykolab
parent3d4e25c18dab7563b6093428682639b0cbd99a12 (diff)
downloadpykolab-26d6038d6a8226ad94580ee5cc58fd0800251cfa.tar.gz
Read delegated-from/-to from iCal into libkolabxml event objects
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/xml/attendee.py15
-rw-r--r--pykolab/xml/event.py6
2 files changed, 14 insertions, 7 deletions
diff --git a/pykolab/xml/attendee.py b/pykolab/xml/attendee.py
index 4eef860..ffe80f7 100644
--- a/pykolab/xml/attendee.py
+++ b/pykolab/xml/attendee.py
@@ -41,7 +41,8 @@ class Attendee(kolabformat.Attendee):
rsvp=False,
role=None,
participant_status=None,
- cutype=None
+ cutype=None,
+ ical_params=None
):
self.email = email
@@ -62,12 +63,18 @@ class Attendee(kolabformat.Attendee):
if not role == None:
self.set_role(role)
- if not participant_status == None:
- self.set_participant_status(participant_status)
-
if not cutype == None:
self.set_cutype(cutype)
+ if ical_params and ical_params.has_key('DELEGATED-FROM'):
+ self.delegate_from(Attendee(str(ical_params['DELEGATED-FROM'])))
+
+ if ical_params and ical_params.has_key('DELEGATED-TO'):
+ self.delegate_to(Attendee(str(ical_params['DELEGATED-TO'])))
+
+ if not participant_status == None:
+ self.set_participant_status(participant_status)
+
def delegate_from(self, delegators):
crefs = []
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index 2dea819..7e109e1 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -44,8 +44,8 @@ class Event(object):
self.uid = self.get_uid()
- def add_attendee(self, email, name=None, rsvp=False, role=None, participant_status=None, cutype="INDIVIDUAL"):
- attendee = Attendee(email, name, rsvp, role, participant_status, cutype)
+ def add_attendee(self, email, name=None, rsvp=False, role=None, participant_status=None, cutype="INDIVIDUAL", params=None):
+ attendee = Attendee(email, name, rsvp, role, participant_status, cutype, params)
self._attendees.append(attendee)
self.event.setAttendees(self._attendees)
@@ -701,7 +701,7 @@ class Event(object):
else:
cutype = kolabformat.CutypeIndividual
- self.add_attendee(address, name=name, rsvp=rsvp, role=role, participant_status=partstat, cutype=cutype)
+ att = self.add_attendee(address, name=name, rsvp=rsvp, role=role, participant_status=partstat, cutype=cutype, params=params)
def set_ical_dtend(self, dtend):
self.set_end(dtend)