[conduit/syncml: 87/244] Populate changes dict with uuids instead of ids direct from device



commit 2732876484e90ce98fcc3bab7e25c90909465c76
Author: John Carr <john carr unrouted co uk>
Date:   Fri Apr 24 08:39:52 2009 -0700

    Populate changes dict with uuids instead of ids direct from device
---
 conduit/modules/SyncmlModule/SyncmlModule.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/conduit/modules/SyncmlModule/SyncmlModule.py b/conduit/modules/SyncmlModule/SyncmlModule.py
index 5cc61e9..856f31d 100644
--- a/conduit/modules/SyncmlModule/SyncmlModule.py
+++ b/conduit/modules/SyncmlModule/SyncmlModule.py
@@ -104,7 +104,11 @@ class SyncmlDataProvider(DataProvider.TwoWay):
         if self._changes == None:
             return 1
 
-        self._changes[uid] = (type, data[:size])
+        if uid in self.mapping:
+            self.mapping[uid] = str(uuid.uuid4())
+        LUID = self.mapping[uid]
+
+        self._changes[LUID] = (type, data[:size])
 
         if self._session_type == enums.SML_SESSION_TYPE_CLIENT:
             err = pysyncml.Error()
@@ -132,8 +136,6 @@ class SyncmlDataProvider(DataProvider.TwoWay):
     def _syncml_run(self):
         err = pysyncml.Error()
 
-        self._changs = {}
-
         self._setup_connection()
         self._setup_datastore()
 
@@ -160,6 +162,7 @@ class SyncmlDataProvider(DataProvider.TwoWay):
         DataProvider.TwoWay.__init__(self)
         self.address = address
 
+        self.mapping = {}
         self.slowsync = True
 
         self._handle_event = pysyncml.EventCallback(self.handle_event)



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