[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser - RuntimeInfoView.py:1.1.2.2.4.1
Jim Fulton
jim@zope.com
Wed, 29 May 2002 11:10:07 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser
Modified Files:
Tag: Zope3InWonderland-branch
RuntimeInfoView.py
Log Message:
- Added permission_id attribute to adapter and utility directives.
- Got rid of old getView, getResource, and getDefaultViewName.
Renamed getRequestView to getView (and so on).
Changed view interface to use context, rather than getContext.
Introduced notion of presentation types (e.g. IBrowserPresentation,
which is cleaner than IBrowserPublisher).
- Began converting to get/queryFoo, which is much nicer.
- Many formatting fixups.
=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/RuntimeInfoView.py 1.1.2.2 => 1.1.2.2.4.1 ===
"""
-from Zope.Publisher.Browser.AttributePublisher import AttributePublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.App.OFS.ApplicationControl.IRuntimeInfo import IRuntimeInfo
from Zope.App.PageTemplate import ViewPageTemplateFile
from Zope.ComponentArchitecture import getAdapter
-class RuntimeInfoView(AttributePublisher):
-
- def __init__(self, context):
- self._context = context
-
- def getContext(self):
- return self._context
+class RuntimeInfoView(BrowserView):
def runtimeInfo(self):
- runtime_info = getAdapter(self.getContext(), IRuntimeInfo) # XXX what are we going to do if this fails???
+ # XXX what are we going to do if this fails???
+ runtime_info = getAdapter(self.context, IRuntimeInfo)
formatted = {} # contains formatted runtime information
formatted['ZopeVersion'] = runtime_info.getZopeVersion()
formatted['PythonVersion'] = runtime_info.getPythonVersion()