Author: jmorliaguet
Date: Sat May  6 18:24:31 2006
New Revision: 3058

Modified:
   cpsskins/branches/paris-sprint-2006/setup/manager.py
   cpsskins/branches/paris-sprint-2006/setup/settings.py

Log:

- fixes



Modified: cpsskins/branches/paris-sprint-2006/setup/manager.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/manager.py        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/manager.py        Sat May  6 
18:24:31 2006
@@ -60,8 +60,8 @@
             name = name or chooser.chooseName(title, context)
             setting = LocalSetting(name=name, title=title, resource=resource)
             setting.custom = custom
-            settings[name] = setting
             uri = IIdentifiable(setting).getURI()
+            settings[uri] = setting
             settings.registerUtility(setting, ISetting, uri)
 
     def unregister(self, uri=u'', context=None):
@@ -78,6 +78,7 @@
         if setting is None or not setting.isLocal():
             raise ValueError("No such local setting: '%s'" % uri)
 
+        del settings[uri]
         settings.unregisterUtility(provided=ISetting, name=uri)
 
     def lookup(self, uri=u'', context=None, default=None):
@@ -106,13 +107,13 @@
             settings = getThemeManager(context).getSettings()
             entries.extend(list(settings.getUtilitiesFor(ISetting)))
 
-        settings = []
+        settings_dict = {}
         for uri, setting in entries:
             resource = IResource(setting).getResource()
             if type and not type.providedBy(resource):
                 continue
-            settings.append(setting)
-        return settings
+            settings_dict[uri] = setting
+        return settings_dict.values()
 
     ### Resolving resources  ###########################################
 

Modified: cpsskins/branches/paris-sprint-2006/setup/settings.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/settings.py       (original)
+++ cpsskins/branches/paris-sprint-2006/setup/settings.py       Sat May  6 
18:24:31 2006
@@ -18,11 +18,11 @@
 __docformat__ = "reStructuredText"
 
 from zope.app.container.btree import BTreeContainer
-from zope.component.interfaces import IComponentLookup
+from zope.component.interfaces import IComponents
 from zope.component.persistentregistry import PersistentComponents
 from zope.interface import implements
 
-class ISettings(IComponentLookup):
+class ISettings(IComponents):
     """Settings registry"""
 
 class Settings(BTreeContainer, PersistentComponents):
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to