[Zope3-checkins] CVS: Zope3/src/zope/app/traversing - namespace.py:1.7
Jim Fulton
jim@zope.com
Thu, 6 Mar 2003 17:13:30 -0500
Update of /cvs-repository/Zope3/src/zope/app/traversing
In directory cvs.zope.org:/tmp/cvs-serv8664
Modified Files:
namespace.py
Log Message:
Changed view lookup to raise a not found error, as opposed to a
ComponentLookupError when a view can't be found.
=== Zope3/src/zope/app/traversing/namespace.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/traversing/namespace.py:1.6 Tue Feb 11 21:17:37 2003
+++ Zope3/src/zope/app/traversing/namespace.py Thu Mar 6 17:13:29 2003
@@ -22,7 +22,7 @@
from zope.proxy.context import getWrapperContext
from zope.configuration.action import Action
from zope.component import queryAdapter, getAdapter, getServiceManager
-from zope.component import queryDefaultViewName, getView, getService
+from zope.component import queryDefaultViewName, queryView, getService
from zope.app.services.servicenames import Resources
from zope.app.interfaces.traversing import ITraversable
@@ -225,7 +225,11 @@
raise UnexpectedParameters(parameters)
if not request:
raise NoRequest(pname)
- return getView(ob, name, request)
+ view = queryView(ob, name, request)
+ if view is None:
+ raise NotFoundError(ob, name)
+
+ return view
def resource(name, parameters, pname, ob, request):
if parameters: