Author: jmorliaguet
Date: Fri Jun 30 00:04:56 2006
New Revision: 3568

Modified:
   cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py
   cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py
   cpsskins/branches/paris-sprint-2006/doc/portlets.txt
   cpsskins/branches/paris-sprint-2006/standard/filters/accesskeys/__init__.py
   cpsskins/branches/paris-sprint-2006/standard/filters/widget/__init__.py
   cpsskins/branches/paris-sprint-2006/standard/portlets/actions/portlet.py
   cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/portlet.py
   cpsskins/branches/paris-sprint-2006/standard/portlets/custom/portlet.py
   cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/portlet.py
   cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
   
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/pageblock.pt

Log:

- renamed the renderer's global structure as 'rendering', e.g. 

  info.rendering.engine, info.rendering.location

  instead of 'globals' to avoid locally overriding globals()



Modified: cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py   
(original)
+++ cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py   Fri Jun 
30 00:04:56 2006
@@ -77,9 +77,9 @@
         """Get the list of filters associated to the element
         """
         element, request = self.element, self.request
-        engine = info.globals.engine
+        engine = info.rendering.engine
 
-        relations = info.globals.relations
+        relations = info.rendering.relations
 
         # look for renderers associated to the element's content type
         type = IType(element)
@@ -126,7 +126,7 @@
                 # the adapted object is a URI which must be resolved
                 if isinstance(adapted, basestring):
                     uri = adapted
-                    adapted = info.globals.resources.resolve(uri, element)
+                    adapted = info.rendering.resources.resolve(uri, element)
 
                 # get the adapter
                 filter = queryMultiAdapter((adapted,), IFilterView,

Modified: cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py     Fri Jun 
30 00:04:56 2006
@@ -66,24 +66,24 @@
         notify(ViewNodeEvent(element))
 
         # update global context info variables passed as keyword parameters
-        globals = ContextInfo(kw)
+        rendering = ContextInfo(kw)
 
         # set the current location unless specified
-        if globals.location is None:
-            globals.location = IPhysicallyLocatable(element).getNearestSite()
+        if rendering.location is None:
+            rendering.location = IPhysicallyLocatable(element).getNearestSite()
 
-        if globals.engine is None:
-            globals.engine = u'default'
+        if rendering.engine is None:
+            rendering.engine = u'default'
 
         tmutil = getThemeManager(element)
         relations = tmutil.getRelationStorage()
-        negotiation = getMultiAdapter((globals.location, request),
+        negotiation = getMultiAdapter((rendering.location, request),
                                       INegotiation, 'negotiation')
         perspective = negotiation.getPerspective()
         resources = getUtility(IResourceManager)
 
         # set other global variables
-        globals.update({
+        rendering.update({
             'request': request,
             'perspective': perspective,
             'relations': relations,
@@ -91,17 +91,17 @@
             })
 
         # XXX
-        globals.accesskeys = []
+        rendering.accesskeys = []
 
         # build the tree and store it in the request
         contexts = {}
         tree = contexts['tree'] = {}
-        _updateTreeInfo(tree=tree, node=element, globals=globals)
+        _updateTreeInfo(tree=tree, node=element, rendering=rendering)
 
         # render the tree
         return getMultiAdapter((element, request), IRendererView)(tree)
 
-def _updateTreeInfo(tree={}, node=None, order=0, globals=None):
+def _updateTreeInfo(tree={}, node=None, order=0, rendering=None):
     """Build the tree info for an element.
     """
 
@@ -111,9 +111,9 @@
 
     node_index = tree[node.identifier] = {}
 
-    perspective = globals.perspective
+    perspective = rendering.perspective
 
-    traverser = getMultiAdapter((node, globals.request), INodeTraversing)
+    traverser = getMultiAdapter((node, rendering.request), INodeTraversing)
     children = traverser.getChildNodes(perspective=perspective)
 
     info = ContextInfo({
@@ -125,7 +125,7 @@
         })
 
     # set global variables
-    info.globals = globals
+    info.rendering = rendering
 
     node_index['info'] = info
     node_index['children'] = children
@@ -135,6 +135,6 @@
 
     for child in children:
         _updateTreeInfo(tree=tree, node=child, order=children.index(child),
-                        globals=globals)
+                        rendering=rendering)
 
 

Modified: cpsskins/branches/paris-sprint-2006/doc/portlets.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/doc/portlets.txt        (original)
+++ cpsskins/branches/paris-sprint-2006/doc/portlets.txt        Fri Jun 30 
00:04:56 2006
@@ -22,7 +22,7 @@
 
     >>> from cpsskins.browser.rendering.context import ContextInfo
     >>> info = ContextInfo({'data': None, 'metadata': None})
-    >>> info.globals = ContextInfo({'request': request, 'location': root})
+    >>> info.rendering = ContextInfo({'request': request, 'location': root})
 
 
 Portlets

Modified: 
cpsskins/branches/paris-sprint-2006/standard/filters/accesskeys/__init__.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/filters/accesskeys/__init__.py 
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/filters/accesskeys/__init__.py 
Fri Jun 30 00:04:56 2006
@@ -37,7 +37,7 @@
     def __call__(self, markup, info):
         """Apply the filter"""
 
-        keys = info.globals.accesskeys
+        keys = info.rendering.accesskeys
         if not keys:
             return markup
 

Modified: 
cpsskins/branches/paris-sprint-2006/standard/filters/widget/__init__.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/filters/widget/__init__.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/filters/widget/__init__.py     
Fri Jun 30 00:04:56 2006
@@ -50,9 +50,9 @@
         """Apply the widget filter.
         """
         context = self.context
-        request = info.globals.request
+        request = info.rendering.request
 
-        engine = info.globals.engine
+        engine = info.rendering.engine
         data = info.data
 
         # create a transient HTML data structure if there is no data

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/actions/portlet.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/actions/portlet.py    
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/actions/portlet.py    
Fri Jun 30 00:04:56 2006
@@ -48,8 +48,8 @@
 
     def __call__(self, info):
 
-        request = info.globals.request
-        location = info.globals.location
+        request = info.rendering.request
+        location = info.rendering.location
 
         try:
            menu = getMenu(self.category, location, request)

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/portlet.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/portlet.py    
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/portlet.py    
    Fri Jun 30 00:04:56 2006
@@ -41,8 +41,8 @@
         self.title = title
 
     def __call__(self, info):
-        request = info.globals.request
-        location = info.globals.location
+        request = info.rendering.request
+        location = info.rendering.location
 
         url = getMultiAdapter((location, request), IAbsoluteURL)
         items = [MenuItem(title=bc['name'], url=bc['url'])

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/custom/portlet.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/custom/portlet.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/custom/portlet.py     
Fri Jun 30 00:04:56 2006
@@ -71,9 +71,9 @@
         format = self.format
         if format in page_factories:
             page = page_factories[format]()
-            page = contained(page, info.globals.location)
+            page = contained(page, info.rendering.location)
             page.setSource(self.source)
-            markup = unicode(_renderPage(page, info.globals.request))
+            markup = unicode(_renderPage(page, info.rendering.request))
         else:
             markup = _(u"Page not configured.")
 

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/portlet.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/portlet.py  
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/portlet.py  
Fri Jun 30 00:04:56 2006
@@ -41,11 +41,11 @@
         self.title = title
 
     def __call__(self, info):
-        globals = info.globals
-        request = globals.request
+        rendering = info.rendering
+        request = rendering.request
 
-        view = globals.view
-        template = globals.template
+        view = rendering.view
+        template = rendering.template
 
         if view is not None and template is not None:
             # Switch to the macroless skin before rendering the view

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/definitions.py       Fri Jun 
30 00:04:56 2006
@@ -359,7 +359,7 @@
             'type': 'panel',
         },
         'model': 'page-mode-selector',
-        'perspectives': ['page-designer'],
+        'perspectives': ['page-designer', 'content-author'],
         'controllers': ['main-editor-perspectives'],
     },
 

Modified: 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/pageblock.pt
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/pageblock.pt
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/wysiwyg/pageblock.pt
    Fri Jun 30 00:04:56 2006
@@ -1,8 +1,8 @@
 <tal:block
   define="
     info options/info;
-    globals info/globals;
-    perspective globals/perspective;
+    rendering info/rendering;
+    perspective rendering/perspective;
     formats context/formattable:getFormatNames;
     layout context/formattable:layout;
     title context/title;
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to