Author: jmorliaguet
Date: Sat Oct 15 04:57:02 2005
New Revision: 28335

Removed:
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/interfaces.py
Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
   
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/content/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/engines/default/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/engines/jsr168/configure.zcml
Log:

- the engine's name is stored in the request



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py    
Sat Oct 15 04:57:02 2005
@@ -57,10 +57,4 @@
         return perspective
 
     def getEffectiveEngine(self):
-        for iface in directlyProvidedBy(self.request):
-            if not iface.extends(IEngine):
-                continue
-            for name, engine in list(getUtilitiesFor(IEngine)):
-                if engine == iface:
-                    return name
-        return 'default'
+        return self.request.annotations.get('cpsskins.engine', 'default')

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py  
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/__init__.py  
Sat Oct 15 04:57:02 2005
@@ -21,17 +21,13 @@
 """
 
 from zope.app.traversing.namespace import view
-from zope.component import queryUtility
-from zope.interface import alsoProvides
 
 from interfaces import IEngine
 
 class engine(view):
 
     def traverse(self, name, ignored):
-        engine = queryUtility(IEngine, name, None)
-
         if engine is not None:
-            alsoProvides(self.request, engine)
+            self.request.annotations['cpsskins.engine'] = name
 
         return self.context

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py 
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metaconfigure.py 
    Sat Oct 15 04:57:02 2005
@@ -17,14 +17,12 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.app.component.interface import provideInterface
+registered_engines = []
 
-from cpsskins.configuration.engines.interfaces import IEngine
+def engine(_context, name):
 
-def engine(_context, name, interface):
+    if name in registered_engines:
+        raise ConfigurationError(
+            "The '%s' engine has already been registered.")
 
-    _context.action(
-        discriminator = ('engine', name),
-        callable = provideInterface,
-        args = (name, interface, IEngine, _context.info)
-        )
+    registered_engines.append(name)

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/engines/metadirectives.py
    Sat Oct 15 04:57:02 2005
@@ -17,7 +17,6 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.configuration.fields import GlobalObject
 from zope.interface import Interface
 from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine
@@ -31,10 +30,3 @@
         description=_("The engine that the renderer applies to."),
         required=False,
         )
-
-    interface = GlobalObject(
-        title=_("Interface"),
-        description=_("A marker interface for the engine"),
-        required=False,
-        )
-

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/content/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/content/configure.zcml
   (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/content/configure.zcml
   Sat Oct 15 04:57:02 2005
@@ -3,7 +3,6 @@
 
   <engine
       name="content-authoring"
-      interface=".interfaces.IContentAuthoring"
   />
 
   <renderer

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/page/configure.zcml  
    Sat Oct 15 04:57:02 2005
@@ -3,7 +3,6 @@
 
   <engine
       name="page-authoring"
-      interface=".interfaces.IPageAuthoring"
   />
 
   <renderer

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/default/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/default/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/default/configure.zcml     
Sat Oct 15 04:57:02 2005
@@ -3,7 +3,6 @@
 
   <engine
       name="default"
-      interface=".interfaces.IDefault"
   />
 
   <renderer

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/jsr168/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/jsr168/configure.zcml      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/jsr168/configure.zcml      
Sat Oct 15 04:57:02 2005
@@ -6,7 +6,6 @@
 
   <engine
       name="jsr168"
-      interface=".IJSR168"
   />
 
   <renderer
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to