[Checkins] SVN: Zope3/branches/jim-adapter/src/zope/traversing/namespace.py avoid circular import problems and clean up imports a bit

Philipp von Weitershausen philikon at philikon.de
Wed Apr 5 09:26:43 EDT 2006


Log message for revision 66524:
  avoid circular import problems and clean up imports a bit
  

Changed:
  U   Zope3/branches/jim-adapter/src/zope/traversing/namespace.py

-=-
Modified: Zope3/branches/jim-adapter/src/zope/traversing/namespace.py
===================================================================
--- Zope3/branches/jim-adapter/src/zope/traversing/namespace.py	2006-04-05 13:01:35 UTC (rev 66523)
+++ Zope3/branches/jim-adapter/src/zope/traversing/namespace.py	2006-04-05 13:26:42 UTC (rev 66524)
@@ -25,9 +25,8 @@
 from zope.publisher.interfaces.browser import IBrowserSkinType
 from zope.publisher.browser import applySkin
 from zope.security.proxy import removeSecurityProxy
-
 from zope.traversing.interfaces import ITraversable, IPathAdapter
-from zope.traversing.interfaces import TraversalError
+from zope.traversing.interfaces import TraversalError, IContainmentRoot
 
 class UnexpectedParameters(TraversalError):
     "Unexpected namespace parameters were provided."
@@ -294,10 +293,6 @@
            """
         return self.context[name]
 
-from zope.app.applicationcontrol.applicationcontrol \
-     import applicationController
-from zope.traversing.interfaces import IContainmentRoot
-
 class etc(SimpleHandler):
 
     def traverse(self, name, ignored):
@@ -314,8 +309,13 @@
 
         ob = self.context
 
+        # TODO: lift dependency on zope.app
         if (name in ('process', 'ApplicationController')
             and IContainmentRoot.providedBy(ob)):
+            # import the application controller here to avoid circular
+            # import problems
+            from zope.app.applicationcontrol.applicationcontrol \
+                 import applicationController
             return applicationController
 
         if name not in ('site',):



More information about the Checkins mailing list