[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Sebastian Krzyszkowiak seba.dos1 at gmail.com
Sat Aug 6 08:18:14 UTC 2011


The following commit has been merged in the debian branch:
commit 02ede11c3d92959bf5511cd20a4aeaa3e75641ba
Author: Sebastian Krzyszkowiak <seba.dos1 at gmail.com>
Date:   Mon Aug 31 16:33:28 2009 +0200

    opimd: fix merging

diff --git a/framework/subsystems/opimd/docs/TODO b/framework/subsystems/opimd/docs/TODO
index 8edf524..5a57188 100644
--- a/framework/subsystems/opimd/docs/TODO
+++ b/framework/subsystems/opimd/docs/TODO
@@ -1,15 +1,18 @@
 Near future:
-* check if merging still works
-* quering "Phone" should check also "Office phone"
+* Messages on GenericDomain
+* UnfinishedTasks
+* check if sorting works with merged entries
 In mean-time:
 * Initialized signal in source
 After that:
+* quering "Phone" should check also "Office phone"
 * finished inteligent queries (ContactDeleted, ConactUpdated)
 * updating with SIM-Messages-FSO
 * adding new fields to for example SIM entry (by merging)
-* RSS-Messages backend (handler)
-* Messages on GenericDomain
 Think about:
+* RSS-Messages backend (handler)
+* Google-Contacts backend
+* should quering "Phone" check also "Office phone"? regexps in fields?
 * more domains?
 Finishing:
 * faster merging and avoiding duplicates
diff --git a/framework/subsystems/opimd/pimd_generic.py b/framework/subsystems/opimd/pimd_generic.py
index b2d68fe..813e972 100644
--- a/framework/subsystems/opimd/pimd_generic.py
+++ b/framework/subsystems/opimd/pimd_generic.py
@@ -243,7 +243,7 @@ class GenericEntry():
         return result
 
 
-    def get_content(self):
+    def get_content(self, parserfields = False):
         """Creates and returns a complete representation of the entry
         @note Backend information is omitted.
         @note Fields that have more than one occurence are concatenated using a separation character of ','.
@@ -253,7 +253,9 @@ class GenericEntry():
         fields = self.get_fields(self._field_idx)
         content = {}
         for field in fields:
-            if fields[field]!='' and fields[field]!=None and not field.startswith('_'):
+            if not parserfields and field.startswith('_'):
+                continue
+            if fields[field]!='' and fields[field]!=None:
                 content[field] = fields[field]
         return content
 
@@ -264,10 +266,16 @@ class GenericEntry():
         @param backend_name Backend that owns the entry data
         @return True on successful merge, False otherwise"""
 
+        def notnull(sth):
+            if sth!=None and sth!='':
+                return True
+            else:
+                return False
+
         duplicated = True
-        self_fields = self.get_content()
+        self_fields = self.get_content(True)
         for field_name in entry_fields:
-            if entry_fields[field_name] and self_fields.get(field_name) and self_fields[field_name]!=entry_fields[field_name]:
+            if notnull(entry_fields[field_name]) and (not notnull(self_fields.get(field_name)) or self_fields[field_name]!=entry_fields[field_name]):
                 duplicated = False
                 break
 

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list