summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-05 00:21:06 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-05 00:21:06 -0400
commite636a436365e2025e50ed7eb16105f134412bd62 (patch)
tree2244e0feda84859776753f33c43c42514e8af53a
parent91887a0e6cecf53273fb6de85608bea0b0b5581a (diff)
downloadpykolab-e636a436365e2025e50ed7eb16105f134412bd62.tar.gz
Remove duplicate set_status() method; get translated event status value on request
-rw-r--r--pykolab/xml/event.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index a9db73e..72cbfeb 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -550,11 +550,12 @@ class Event(object):
def get_start(self):
return xmlutils.from_cdatetime(self.event.start(), True)
- def get_status(self):
+ def get_status(self, translated=False):
status = self.event.status()
- for key in self.status_map.keys():
- if self.status_map[key] == status:
- return key
+ if translated:
+ return self._translate_value(status, self.status_map) if status else None
+
+ return status
def get_summary(self):
return self.event.summary()
@@ -592,14 +593,6 @@ class Event(object):
self.event.setAttendees(self._attendees)
- def set_status(self, status):
- if status in self.status_map.keys():
- self.event.setStatus(self.status_map[status])
- elif status in self.status_map.values():
- self.event.setStatus(status)
- else:
- raise ValueError, _("Invalid status %r") % (status)
-
def set_classification(self, classification):
if classification in self.classification_map.keys():
self.event.setClassification(self.classification_map[classification])