[Zope3-checkins] CVS: Zope3/src/zope/app/browser - absoluteurl.py:1.5.10.1

Steve Alexander steve@cat-box.net
Fri, 16 May 2003 12:19:09 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser
In directory cvs.zope.org:/tmp/cvs-serv2621/src/zope/app/browser

Modified Files:
      Tag: stevea-decorators-branch
	absoluteurl.py 
Log Message:
All unit tests now pass.
Added an ensureContextWrapped function to zope.proxy.context.

In code that uses context wrapping, we have two situations:

  * Code such as traversal code wants to ensure that there is a context-
    wrapper, and set the parent and items in the context dict.
    If there is no context wrapper, it should create one, but if there
    is one already, it should be preserved.

  * Code that is the primary source of some information, and wants to
    wrap it and add minimal information (name, usually) before allowing
    the world to see the information. The zopecontainerdecorator is an
    example of this.

To resolve these situations, the former code should use
ensureContextWrapped, which keeps an existing context wrapper if possible,
and updates the context and adds/overwrites items in the context dict.
The latter code can continue to use ContextWrapper.



=== Zope3/src/zope/app/browser/absoluteurl.py 1.5 => 1.5.10.1 ===
--- Zope3/src/zope/app/browser/absoluteurl.py:1.5	Mon Apr 28 09:14:19 2003
+++ Zope3/src/zope/app/browser/absoluteurl.py	Fri May 16 12:18:38 2003
@@ -50,7 +50,7 @@
         base = getView(container, 'absolute_url', self.request).breadcrumbs()
 
         if name == '.':
-            # The name is meaningless. There is a side-efect name
+            # The name is meaningless. There is a side-effect name
             # that we need to preserve in the urls (only)
             name = dict.get('side_effect_name', name)
             if name.startswith('++vh++'):