Author: jmorliaguet
Date: Tue Dec 20 17:27:52 2005
New Revision: 2065

Modified:
   cpsskins/branches/jmo-perspectives/ui/default/formats/layout.py
   cpsskins/branches/jmo-perspectives/ui/default/formats/style.py
Log:

- no need to remove existing items before setting new ones

- trigger persistence



Modified: cpsskins/branches/jmo-perspectives/ui/default/formats/layout.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/default/formats/layout.py     
(original)
+++ cpsskins/branches/jmo-perspectives/ui/default/formats/layout.py     Tue Dec 
20 17:27:52 2005
@@ -72,9 +72,12 @@
         if not isinstance(v, basestring):
             raise TypeError, \
                 """Only strings can be stored in the layout objects."""
-        if k in self.data:
-            del self.data[k]
         self.data[k] = v
+        self._p_changed = True
+
+    def __delitem__(self, k):
+        del self.data[k]
+        self._p_changed = True
 
     def __getitem__(self, k):
         return self.data[k]

Modified: cpsskins/branches/jmo-perspectives/ui/default/formats/style.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/default/formats/style.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/default/formats/style.py      Tue Dec 
20 17:27:52 2005
@@ -124,13 +124,12 @@
         if not isinstance(v, dict):
             raise TypeError, \
                 """Only dictionaries can be stored in the style objects."""
-        if k in self:
-            del self[k]
-        if v:
-            self.data[self._wrap(k)] = v
+        self.data[self._wrap(k)] = v
+        self._p_changed = True
 
     def __delitem__(self, k):
         del self.data[self._wrap(k)]
+        self._p_changed = True
 
     def __iter__(self):
         return iter(self.data)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to