conduit r1545 - in trunk: . conduit/modules



Author: johncarr
Date: Tue Jul 15 12:35:45 2008
New Revision: 1545
URL: http://svn.gnome.org/viewvc/conduit?rev=1545&view=rev

Log:
Stub for a vcard to opensync xml converter

Modified:
   trunk/   (props changed)
   trunk/conduit/modules/SynceModule.py

Modified: trunk/conduit/modules/SynceModule.py
==============================================================================
--- trunk/conduit/modules/SynceModule.py	(original)
+++ trunk/conduit/modules/SynceModule.py	Tue Jul 15 12:35:45 2008
@@ -7,6 +7,7 @@
 import conduit.datatypes.Contact as Contact
 import conduit.Exceptions as Exceptions
 
+import xml.dom.ext
 import xml.dom.minidom
 import vobject
 
@@ -282,7 +283,17 @@
         return c
 
     def _data_to_blob(self, data):
-        pass
+      doc = xml.dom.minidom.Document()
+      node = doc.createElement("contact")
+
+      for chunk in data.contents:
+          print chunk
+
+      doc.appendChild(node)
+
+      tmp=StringIO()
+      xml.dom.ext.PrettyPrint(node, stream=tmp, encoding='utf-8')
+      return tmp.getvalue()
 
 class SynceCalendarTwoWay(SynceTwoWay):
     _name_ = "Calendar"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]