Author: jmorliaguet
Date: Mon Oct 31 00:18:25 2005
New Revision: 28836

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/engines/default/formats/layout.py
   z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py
Log:

- more robust code for testing string / non-string instances



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/default/formats/layout.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/default/formats/layout.py  
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/default/formats/layout.py  
Mon Oct 31 00:18:25 2005
@@ -87,7 +87,7 @@
         return None
 
     def __setitem__(self, k, v):
-        if not isinstance(v, str):
+        if not isinstance(v, basestring):
             raise TypeError, \
                 """Only strings can be stored in the layout objects."""
         if k not in self._getAllowedKeys():

Modified: z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py       Mon Oct 
31 00:18:25 2005
@@ -269,7 +269,7 @@
     def remove(self, ids=[]):
         """Remove relations for the storage.
         """
-        if isinstance(ids, str):
+        if not isinstance(ids, (list, tuple)):
             ids = [ids]
         for id in ids:
             if id not in self:
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to