[Zope3-checkins] CVS: Zope3/src/zope/component - __init__.py:1.12 interfaces.py:1.9
Richard Jones
richard@commonground.com.au
Fri, 11 Jul 2003 21:22:19 -0400
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv12737
Modified Files:
__init__.py interfaces.py
Log Message:
Bring getView, queryView, getDefaultViewName and queryDefaultViewName in line
with their interface spec.
=== Zope3/src/zope/component/__init__.py 1.11 => 1.12 ===
--- Zope3/src/zope/component/__init__.py:1.11 Fri May 23 18:16:49 2003
+++ Zope3/src/zope/component/__init__.py Fri Jul 11 21:22:13 2003
@@ -140,32 +140,27 @@
# View service
-def getView(wrapped_object, name, request, context=None):
+def getView(object, name, request, context=None):
if context is None:
- context = wrapped_object
- return getService(context,
- 'Views').getView(wrapped_object, name, request)
+ context = object
+ return getService(context, 'Views').getView(object, name, request)
-def queryView(wrapped_object, name, request, default=None, context=None):
+def queryView(object, name, request, default=None, context=None):
if context is None:
- context = wrapped_object
+ context = object
return getService(context,
- 'Views').queryView(wrapped_object, name,
- request, default)
+ 'Views').queryView(object, name, request, default)
-def getDefaultViewName(wrapped_object, request, context=None):
+def getDefaultViewName(object, request, context=None):
if context is None:
- context = wrapped_object
- return getService(context,
- 'Views').getDefaultViewName(wrapped_object,
- request)
+ context = object
+ return getService(context, 'Views').getDefaultViewName(object, request)
-def queryDefaultViewName(wrapped_object, request, default=None, context=None):
+def queryDefaultViewName(object, request, default=None, context=None):
if context is None:
- context = wrapped_object
+ context = object
return getService(context,
- 'Views').queryDefaultViewName(wrapped_object,
- request, default)
+ 'Views').queryDefaultViewName(object, request, default)
# Resource service
=== Zope3/src/zope/component/interfaces.py 1.8 => 1.9 ===
--- Zope3/src/zope/component/interfaces.py:1.8 Tue Jun 24 11:29:51 2003
+++ Zope3/src/zope/component/interfaces.py Fri Jul 11 21:22:13 2003
@@ -181,26 +181,32 @@
# View service
- def getView(wrapped_object, name, request):
+ def getView(object, name, request, context=None):
"""Get a named view for a given object.
The request must implement IPresentationRequest: it provides
the view type and the skin name. The nearest one to the
object is found. If a matching view cannot be found, raises
ComponentLookupError.
+
+ If context is not specified, attempts to use wrapping around
+ object to specify a context.
"""
- def queryView(wrapped_object, name, request, default=None):
+ def queryView(object, name, request, default=None, context=None):
"""Look for a named view for a given object.
The request must implement IPresentationRequest: it provides the view
type and the skin name. The nearest one to the object is
found. If a matching view cannot be found, returns default.
+ If context is not specified, attempts to use wrapping around
+ object to specify a context.
+
"""
- def getDefaultViewName(wrapped_object, request):
+ def getDefaultViewName(object, request, context=None):
"""Get the name of the default view for the object and request.
The request must implement IPresentationRequest, and provides the
@@ -208,15 +214,21 @@
If a matching default view name cannot be found, raises
NotFoundError.
+ If context is not specified, attempts to use wrapping around
+ object to specify a context.
+
"""
- def queryDefaultViewName(wrapped_object, request, default=None):
+ def queryDefaultViewName(object, request, default=None, context=None):
"""Look for the name of the default view for the object and request.
The request must implement IPresentationRequest, and provides the
desired view type. The nearest one to the object is found.
If a matching default view name cannot be found, returns the
default.
+
+ If context is not specified, attempts to use wrapping around
+ object to specify a context.
"""