Author: jmorliaguet
Date: Mon Nov  7 21:54:01 2005
New Revision: 29225

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py
   z3lab/cpsskins/branches/jmo-perspectives/storage/relations.py
   z3lab/cpsskins/branches/jmo-perspectives/thememanager.py
Log:

- fixes / simpler code



Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py   Mon Nov 
 7 21:54:01 2005
@@ -112,7 +112,7 @@
         current_format = formattable.getFormat(name)
         format = formattable.cloneFormat(current_format)
 
-        format = getUtility(IFormat, name)
+        format = getUtility(configuration.IFormat, name)
         relations = reltool.search(first=display, predicate=format.predicate)
         reltool.remove(relations)
 

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 Nov 
 7 21:54:01 2005
@@ -269,7 +269,7 @@
     def remove(self, ids=[]):
         """Remove relations for the storage.
         """
-        if not isinstance(ids, (list, tuple)):
+        if isinstance(ids, basestring):
             ids = [ids]
         for id in ids:
             if id not in self:

Modified: z3lab/cpsskins/branches/jmo-perspectives/thememanager.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/thememanager.py    (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/thememanager.py    Mon Nov  7 
21:54:01 2005
@@ -67,19 +67,19 @@
         self[IMAGE_CACHE_NAME] = ImageCache()
 
     def registerUtilities(self):
-        self.registerUtility(IIntIds, UIDS_NAME)
-        self.registerUtility(IImageCache, IMAGE_CACHE_NAME)
+        self.registerUtility(IIntIds, self[UIDS_NAME])
+        self.registerUtility(IImageCache, self[IMAGE_CACHE_NAME])
 
-    def registerUtility(self, interface, name):
-        reg = UtilityRegistration('', interface, self[name])
+    def registerUtility(self, interface, utility):
+        reg = UtilityRegistration('', interface, utility)
         self.registrationManager.addRegistration(reg)
         reg.status = ActiveStatus
 
     def getIdRegistry(self):
-        return getUtility(IIntIds, '', context=self)
+        return getUtility(IIntIds, context=self)
 
     def getImageCache(self):
-        return getUtility(IImageCache, '', context=self)
+        return getUtility(IImageCache, context=self)
 
     def registerElement(self, element):
         id = self.getIdRegistry().register(element)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to