Author: jmorliaguet
Date: Thu Jun 15 14:14:02 2006
New Revision: 3414

Modified:
   cpsskins/branches/paris-sprint-2006/configuration/engines/metaconfigure.py
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py
   cpsskins/branches/paris-sprint-2006/elements/format.py
   cpsskins/branches/paris-sprint-2006/standard/ds/menuitems.py
   cpsskins/branches/paris-sprint-2006/standard/formats/widget.py
   cpsskins/branches/paris-sprint-2006/storage/relations.py

Log:

- don't default to mutable objects



Modified: 
cpsskins/branches/paris-sprint-2006/configuration/engines/metaconfigure.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/configuration/engines/metaconfigure.py  
(original)
+++ cpsskins/branches/paris-sprint-2006/configuration/engines/metaconfigure.py  
Thu Jun 15 14:14:02 2006
@@ -24,14 +24,14 @@
 
 registered_utilities = []
 
-def engine(_context, name, accesskeys=[]):
+def engine(_context, name, accesskeys=None):
 
     if name in registered_utilities:
         raise ConfigurationError(
             "The '%s' engine has already been registered." % name)
 
     utility(_context=_context, provides=configuration.IEngine,
-            component=configuration.Engine(accesskeys=accesskeys),
+            component=configuration.Engine(accesskeys=accesskeys or []),
             name=name)
 
     registered_utilities.append(name)

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    Thu Jun 15 14:14:02 2006
@@ -38,8 +38,8 @@
     def display(self, _context, type):
         self._display = type
 
-    def format(self, _context, name, types=[]):
-        self._formats[name] = types
+    def format(self, _context, name, types=None):
+        self._formats[name] = types or []
 
     def __call__(self):
 

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py 
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py 
    Thu Jun 15 14:14:02 2006
@@ -26,7 +26,7 @@
 
     implements(IPresentation)
 
-    def __init__(self, display=None, formats=[]):
+    def __init__(self, display, formats):
         self.display = display
         self.formats = formats
 

Modified: cpsskins/branches/paris-sprint-2006/elements/format.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/format.py      (original)
+++ cpsskins/branches/paris-sprint-2006/elements/format.py      Thu Jun 15 
14:14:02 2006
@@ -37,7 +37,7 @@
 
     types = []
 
-    def __init__(self, types=[]):
+    def __init__(self, types):
         self.types = types
 
     def findDisplays(self):
@@ -136,9 +136,9 @@
         names.sort()
         return names
 
-    def addFormat(self, name=u'', types=[]):
+    def addFormat(self, name=u'', types=None):
         format = createObject(u'cpsskins.format.%s' % name)
-        format.types = types
+        format.types = types or []
         self.storeFormat(format)
         return self.setFormat(format)
 

Modified: cpsskins/branches/paris-sprint-2006/standard/ds/menuitems.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/ds/menuitems.py        
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/ds/menuitems.py        Thu Jun 
15 14:14:02 2006
@@ -47,7 +47,7 @@
     """
     implements(IMenuItems)
 
-    def __init__(self, items=[]):
+    def __init__(self, items):
         self.items = items
 
     def __repr__(self):

Modified: cpsskins/branches/paris-sprint-2006/standard/formats/widget.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/formats/widget.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/formats/widget.py      Thu Jun 
15 14:14:02 2006
@@ -53,7 +53,7 @@
     """
     implements(IWidget)
 
-    def __init__(self, types=[]):
+    def __init__(self, types):
         self.types = types
 
     def __repr__(self):

Modified: cpsskins/branches/paris-sprint-2006/storage/relations.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/storage/relations.py    (original)
+++ cpsskins/branches/paris-sprint-2006/storage/relations.py    Thu Jun 15 
14:14:02 2006
@@ -274,9 +274,11 @@
         logger.debug("Added a relation '%s': '%s'", relation_name,
                      repr(relation))
 
-    def remove(self, ids=[]):
+    def remove(self, ids=None):
         """Remove relations for the storage.
         """
+        if ids is None:
+            ids = []
         if isinstance(ids, basestring):
             ids = [ids]
         for id in ids:
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to