[Checkins] SVN: zope.app.publication/trunk/ Look up the application controller through a utility registration

Shane Hathaway shane at hathawaymix.org
Sat May 23 16:23:34 EDT 2009


Log message for revision 100293:
  Look up the application controller through a utility registration
  rather than a direct reference.
  

Changed:
  U   zope.app.publication/trunk/CHANGES.txt
  U   zope.app.publication/trunk/setup.py
  U   zope.app.publication/trunk/src/zope/app/publication/tests/test_browserpublication.py
  U   zope.app.publication/trunk/src/zope/app/publication/zopepublication.py

-=-
Modified: zope.app.publication/trunk/CHANGES.txt
===================================================================
--- zope.app.publication/trunk/CHANGES.txt	2009-05-23 20:22:30 UTC (rev 100292)
+++ zope.app.publication/trunk/CHANGES.txt	2009-05-23 20:23:34 UTC (rev 100293)
@@ -16,6 +16,9 @@
   zope.publisher.defaultview, making it accessible to other packages
   that need it.
 
+- Look up the application controller through a utility registration
+  rather than a direct reference.
+
 3.6.0 (2009-05-18)
 ------------------
 

Modified: zope.app.publication/trunk/setup.py
===================================================================
--- zope.app.publication/trunk/setup.py	2009-05-23 20:22:30 UTC (rev 100292)
+++ zope.app.publication/trunk/setup.py	2009-05-23 20:23:34 UTC (rev 100293)
@@ -57,6 +57,7 @@
               'zope.app.publisher',
               'zope.app.zptpage',
               'zope.principalregistry',
+              'zope.app.applicationcontrol>=3.5.0',
               ]),
     install_requires=['zope.interface',
                       'ZODB3',
@@ -65,7 +66,6 @@
                       'zope.deferredimport',
                       'zope.error',
                       'zope.i18n',
-                      'zope.app.applicationcontrol',
                       'zope.browser>=1.2',
                       'zope.publisher>=3.8.0',
                       'zope.traversing>=3.7.0',

Modified: zope.app.publication/trunk/src/zope/app/publication/tests/test_browserpublication.py
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/tests/test_browserpublication.py	2009-05-23 20:22:30 UTC (rev 100292)
+++ zope.app.publication/trunk/src/zope/app/publication/tests/test_browserpublication.py	2009-05-23 20:23:34 UTC (rev 100293)
@@ -237,6 +237,8 @@
     def testTraverseNameApplicationControl(self):
         from zope.app.applicationcontrol.applicationcontrol \
              import applicationController, applicationControllerRoot
+        from zope.traversing.interfaces import IEtcNamespace
+        ztapi.provideUtility(IEtcNamespace, applicationController, 'process')
         pub = self.klass(self.db)
         r = self._createRequest('/++etc++process',pub)
         ac = pub.traverseName(r,

Modified: zope.app.publication/trunk/src/zope/app/publication/zopepublication.py
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/zopepublication.py	2009-05-23 20:22:30 UTC (rev 100292)
+++ zope.app.publication/trunk/src/zope/app/publication/zopepublication.py	2009-05-23 20:23:34 UTC (rev 100293)
@@ -35,12 +35,11 @@
 from zope.security.checker import ProxyFactory
 from zope.security.proxy import removeSecurityProxy
 from zope.traversing.interfaces import IPhysicallyLocatable
+from zope.traversing.interfaces import IEtcNamespace
 from zope.location import LocationProxy
 from zope.error.interfaces import IErrorReportingUtility
 
 import zope.authentication.interfaces
-from zope.app.applicationcontrol.applicationcontrol \
-     import applicationControllerRoot
 from zope.browser.interfaces import ISystemErrorView
 from zope.app.publication.interfaces import BeforeTraverseEvent
 from zope.app.publication.interfaces import EndRequestEvent
@@ -137,12 +136,14 @@
         pass
 
     def getApplication(self, request):
-        # If the first name is '++etc++process', then we should
-        # get it rather than look in the database!
+        # If '++etc++process' is in the path, then we should
+        # get the parent of the application controller rather than
+        # open the database.
         stack = request.getTraversalStack()
 
         if '++etc++process' in stack:
-            return applicationControllerRoot
+            obj = zope.component.getUtility(IEtcNamespace, 'process')
+            return obj.__parent__
 
         # Open the database.
         conn = self.db.open()



More information about the Checkins mailing list