[Zope-Checkins] SVN: Zope/branches/2.9/ Merge philikon-fix-lookup-priorities and add changelog entry

Philipp von Weitershausen philikon at philikon.de
Sun Mar 26 15:40:18 EST 2006


Log message for revision 66190:
  Merge philikon-fix-lookup-priorities and add changelog entry
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py
  U   Zope/branches/2.9/lib/python/ZPublisher/Publish.py
  U   Zope/branches/2.9/lib/python/ZPublisher/Test.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt	2006-03-26 20:30:29 UTC (rev 66189)
+++ Zope/branches/2.9/doc/CHANGES.txt	2006-03-26 20:40:18 UTC (rev 66190)
@@ -25,6 +25,9 @@
 
       - Collector #2037: fixed broken ACTUAL_URL for '/'
 
+      - Put the default skin interface on the request once it is
+        created, both in ZPublisher and ZopeTestCase.
+
   Zope 2.9.1  (2006/02/25)
 
     Bugs fixed

Modified: Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py
===================================================================
--- Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py	2006-03-26 20:30:29 UTC (rev 66189)
+++ Zope/branches/2.9/lib/python/Testing/ZopeTestCase/utils.py	2006-03-26 20:40:18 UTC (rev 66190)
@@ -138,6 +138,12 @@
     request = Request(sys.stdin, environ, response)
     request._steps = ['noobject'] # Fake a published object
     request['ACTUAL_URL'] = request.get('URL') # Zope 2.7.4
+
+    # set Zope3-style default skin so that the request is usable for
+    # Zope3-style view look-ups
+    from zope.app.publication.browser import setDefaultSkin
+    setDefaultSkin(request)
+
     return app.__of__(RequestContainer(REQUEST=request))
 
 

Modified: Zope/branches/2.9/lib/python/ZPublisher/Publish.py
===================================================================
--- Zope/branches/2.9/lib/python/ZPublisher/Publish.py	2006-03-26 20:30:29 UTC (rev 66189)
+++ Zope/branches/2.9/lib/python/ZPublisher/Publish.py	2006-03-26 20:40:18 UTC (rev 66190)
@@ -21,6 +21,7 @@
 from maybe_lock import allocate_lock
 from mapply import mapply
 from zExceptions import Redirect
+from zope.app.publication.browser import setDefaultSkin
 
 class Retry(Exception):
     """Raise this to retry a request
@@ -185,6 +186,11 @@
             if request is None:
                 request=Request(stdin, environ, response)
 
+            # make sure that the request we hand over has the
+            # default layer/skin set on it; subsequent code that
+            # wants to look up views will likely depend on it
+            setDefaultSkin(request)
+
             response = publish(request, module_name, after_list, debug=debug)
         except SystemExit, v:
             must_die=sys.exc_info()

Modified: Zope/branches/2.9/lib/python/ZPublisher/Test.py
===================================================================
--- Zope/branches/2.9/lib/python/ZPublisher/Test.py	2006-03-26 20:30:29 UTC (rev 66189)
+++ Zope/branches/2.9/lib/python/ZPublisher/Test.py	2006-03-26 20:40:18 UTC (rev 66190)
@@ -189,6 +189,12 @@
                 stdout=response.stdout
             if request is None:
                 request=Request(stdin, environ, response)
+                # make sure that the request we hand over has the
+                # default layer/skin set on it; subsequent code that
+                # wants to look up views will likely depend on it
+                from zope.app.publication.browser import setDefaultSkin
+                setDefaultSkin(request)
+
             for k, v in extra.items(): request[k]=v
             response = publish(request, module_name, after_list, debug=debug)
         except SystemExit, v:



More information about the Zope-Checkins mailing list