[conduit/tracker] Start fleshing out tracker <--> vcard bridge
- From: John Carr <johncarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [conduit/tracker] Start fleshing out tracker <--> vcard bridge
- Date: Mon, 15 Jun 2009 00:45:20 -0400 (EDT)
commit 296b0e64cd6f2e85de9a18a89f5956681a4fc7d0
Author: John Carr <john carr unrouted co uk>
Date: Sun Jun 14 20:10:52 2009 +0100
Start fleshing out tracker <--> vcard bridge
conduit/modules/TrackerModule/TrackerModule.py | 13 ++++++++++++-
.../modules/TrackerModule/tralchemy/namespace.py | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/conduit/modules/TrackerModule/TrackerModule.py b/conduit/modules/TrackerModule/TrackerModule.py
index 57c2ee2..03e8bc6 100644
--- a/conduit/modules/TrackerModule/TrackerModule.py
+++ b/conduit/modules/TrackerModule/TrackerModule.py
@@ -77,7 +77,7 @@ class TrackerContacts(DataProvider.TwoWay):
elif k == "tel":
pass
elif k == "bday":
- pass
+ c.birthdate = v[0].value
elif k == "n":
x = v[0].value
c.namefamily = x.family
@@ -95,6 +95,8 @@ class TrackerContacts(DataProvider.TwoWay):
pass
elif k == "fn":
c.fullname = v[0].value
+ elif k == "x-gender":
+ c.gender = v[0].value
else:
log.warning("Unhandled key: %s" % k)
@@ -103,6 +105,9 @@ class TrackerContacts(DataProvider.TwoWay):
def _tracker_to_vcard(self, tracker):
c = Contact.Contact()
+ if tracker.gender:
+ c.vcard.add('x-gender').value = tracker.gender
+
if tracker.fullname:
c.vcard.fn.value = tracker.fullname
@@ -114,6 +119,12 @@ class TrackerContacts(DataProvider.TwoWay):
prefix=tracker.namehonorificprefix, suffix=tracker.namehonorificsuffix)
c.vcard.n.value = n
+ if tracker.note:
+ c.vcard.add('note').value = tracker.note
+
+ if tracker.addresslocation:
+ pass
+
return c
def get_UID(self):
diff --git a/conduit/modules/TrackerModule/tralchemy/namespace.py b/conduit/modules/TrackerModule/tralchemy/namespace.py
index 8204a37..6996418 100644
--- a/conduit/modules/TrackerModule/tralchemy/namespace.py
+++ b/conduit/modules/TrackerModule/tralchemy/namespace.py
@@ -32,7 +32,7 @@ class Namespace(object):
self.__class__.__name__, name))
self.__dict__[name] = cls
- return value
+ return cls
@property
def __members__(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]