[conduit/tracker] Fix duration
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit/tracker] Fix duration
- Date: Fri, 19 Jun 2009 19:34:46 -0400 (EDT)
commit d0f7a0a7c725a1d41654a0cc402a9ba6cde57492
Author: John Carr <john carr unrouted co uk>
Date: Wed Jun 17 13:57:49 2009 +0100
Fix duration
conduit/modules/TrackerModule/TrackerModule.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/conduit/modules/TrackerModule/TrackerModule.py b/conduit/modules/TrackerModule/TrackerModule.py
index 36a83f8..a1d4c71 100644
--- a/conduit/modules/TrackerModule/TrackerModule.py
+++ b/conduit/modules/TrackerModule/TrackerModule.py
@@ -15,6 +15,7 @@ import tralchemy
from tralchemy import nco
from tralchemy import ncal
import vobject
+from datetime import timedelta
MODULES = {
"TrackerContacts": { "type": "dataprovider" },
@@ -289,7 +290,7 @@ class TrackerCalendar(DataProvider.TwoWay):
elif k == "dtend":
c.dtend = ncal.NcalDateTime.create(datetime=v[0].value)
elif k == "duration":
- c.duration = v[0].value
+ c.duration = v[0].value.seconds / (60 * 60)
elif k == "uid":
c.uid = v[0].value
elif k == "url":
@@ -331,7 +332,7 @@ class TrackerCalendar(DataProvider.TwoWay):
dt = ncal.NcalDateTime(value)
ev.add('dtend').value = dt.datetime
elif key == "ncal:duration":
- ev.add('duration').value = value
+ ev.add('duration').value = timedelta(0, int(value)*60*60, 0)
elif key == "ncal:uid":
ev.add('uid').value = value
elif key == "ncal:url":
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]