summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-17 12:16:58 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-17 12:16:58 +0100
commit71c1450337b64d1cb9b010b83e9cc543c01dee4c (patch)
tree25eaa9ce119c1df03e0a32d6b536cf75c23dbc3e
parent073abc3611c52707f4a5fc63ab964f960366a9a6 (diff)
downloadpykolab-71c1450337b64d1cb9b010b83e9cc543c01dee4c.tar.gz
Add getter for ical_lastmodified property; print type with InvalidEventDateError exceptions
-rw-r--r--pykolab/xml/event.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index 3fdd8dc..bff759d 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -176,7 +176,7 @@ class Event(object):
valid_datetime = True
if not valid_datetime:
- raise InvalidEventDateError, _("Event start needs datetime.date or datetime.datetime instance")
+ raise InvalidEventDateError, _("Exdate needs datetime.date or datetime.datetime instance, got %r") % (type(_datetime))
self.event.addExceptionDate(xmlutils.to_cdatetime(_datetime, True))
@@ -597,6 +597,9 @@ class Event(object):
except:
return datetime.datetime.now()
+ def get_ical_lastmodified(self):
+ return self.get_ical_dtstamp()
+
def get_ical_dtstart(self):
return self.get_start()
@@ -786,7 +789,7 @@ class Event(object):
valid_datetime = True
if not valid_datetime:
- raise InvalidEventDateError, _("Event end needs datetime.date or datetime.datetime instance")
+ raise InvalidEventDateError, _("Event end needs datetime.date or datetime.datetime instance, got %r") % (type(_datetime))
self.event.setEnd(xmlutils.to_cdatetime(_datetime, True))
@@ -931,7 +934,7 @@ class Event(object):
_datetime = datetime.datetime.utcnow()
if not valid_datetime:
- raise InvalidEventDateError, _("Event start needs datetime.date or datetime.datetime instance")
+ raise InvalidEventDateError, _("Event last-modified needs datetime.date or datetime.datetime instance, got %r") % (type(_datetime))
self.event.setLastModified(xmlutils.to_cdatetime(_datetime, False, True))
@@ -974,7 +977,7 @@ class Event(object):
valid_datetime = True
if not valid_datetime:
- raise InvalidEventDateError, _("Event start needs datetime.date or datetime.datetime instance")
+ raise InvalidEventDateError, _("Event start needs datetime.date or datetime.datetime instance, got %r") % (type(_datetime))
self.event.setStart(xmlutils.to_cdatetime(_datetime, True))