[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - ViewService.py:1.1.2.2 __init__.py:1.1.6.10
Andreas Jung
andreas@digicool.com
Thu, 10 Jan 2002 11:03:34 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv32566
Modified Files:
Tag: Zope-3x-branch
ViewService.py __init__.py
Log Message:
added getRequestView()
=== Zope3/lib/python/Zope/ComponentArchitecture/ViewService.py 1.1.2.1 => 1.1.2.2 ===
return default
+
+ def getRequestView(self, object, name, request, default=None):
+ '''See interface IViewService'''
+
+
+ type = request.getViewType()
+ skin = request.getViewSkin()
+
+ return self.getView(object, name, type, default, skin)
+
def provideView(self, forInterface, name, type, maker, layer=''):
'''See interface IViewService'''
@@ -57,6 +67,7 @@
reg.register(forInterface, type, maker)
+
def defineSkin(self, skin, layers):
'''See interface IViewService'''
self.__skins[skin] = layers
@@ -67,5 +78,6 @@
viewService = ViewService()
getView = viewService.getView
provideView = viewService.provideView
+getRequestView = viewService.getRequestView
defineSkin = viewService.defineSkin
_clear = viewService._clear
=== Zope3/lib/python/Zope/ComponentArchitecture/__init__.py 1.1.6.9 => 1.1.6.10 ===
from hooks import provideFactory, createObject
from Service import defineService, provideService, getService
-from ViewService import getView, provideView, defineSkin
+from ViewService import getView, provideView, defineSkin, getRequestView
def _clear():
from hooks import _clear; _clear()