[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser - RuntimeInfoView.py:1.1.2.3 browser.zcml:1.1.2.6 index.pt:1.1.2.2 ApplicationControlView.py:NONE
Jim Fulton
jim@zope.com
Fri, 7 Jun 2002 10:41:33 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv12187/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser
Modified Files:
Tag: Zope-3x-branch
RuntimeInfoView.py browser.zcml index.pt
Removed Files:
Tag: Zope-3x-branch
ApplicationControlView.py
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals):
- RenameAllowToRequire
- GroupClassRelatedDirectivesInClassDirective
- ViewInterfaceAndSimplification
- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes
- TwoArgumentViewConstructors
- ImplementsInZCML
- SimpleViewCreationInZCML
- RemoveGetView
- ReplaceProtectWithAllow
- ViewMethodsAsViews
- MergeProtectionAndComponentDefinitions
There were also various security fixes resulting of better integration
of security with components.
=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/RuntimeInfoView.py 1.1.2.2 => 1.1.2.3 ===
"""
-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()
@@ -51,7 +46,8 @@
uptime = uptime - minutes * 60
seconds = uptime
- formatted['Uptime'] = "%s%02d:%02d:%02d" % (((days or "") and "%d days, " % days), hours, minutes, seconds)
+ formatted['Uptime'] = "%s%02d:%02d:%02d" % (
+ ((days or "") and "%d days, " % days), hours, minutes, seconds)
return formatted
=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/browser.zcml 1.1.2.5 => 1.1.2.6 ===
<!-- ApplicationControl View Directives -->
-
- <browser:defaultView name="index"
- for="Zope.App.OFS.ApplicationControl.IApplicationControl."
- factory=".ApplicationControlView." />
-
- <security:protectClass
- class=".ApplicationControlView."
- permission_id="Zope.ManageApplication"
- names="index" />
-
+ <browser:defaultView
+ name="index.html"
+ for="Zope.App.OFS.ApplicationControl.IApplicationControl."
+ permission="Zope.ManageApplication"
+ template="index.pt"
+ />
<!-- RuntimeInfo View Directives -->
- <browser:view name="runtimeinfo"
- for="Zope.App.OFS.ApplicationControl.IApplicationControl."
- factory=".RuntimeInfoView." />
+ <browser:view
+ for="Zope.App.OFS.ApplicationControl.IApplicationControl."
+ factory=".RuntimeInfoView."
+ permission="Zope.ManageApplication" >
- <!-- Hint: also register the 'runtimeinfo' view as ApplicationControl plugin -->
- <application-control:registerView name="runtimeinfo"
- title="Runtime Information" />
+ <browser:page name="RuntimeInfo.html" attribute="index" />
+ </browser:view>
+
- <security:protectClass
- class=".RuntimeInfoView."
- permission_id="Zope.ManageApplication"
- names="index, runtimeInfo" />
+ <!-- Hint:
+ also register the 'runtimeinfo' view as ApplicationControl plugin -->
+ <application-control:registerView
+ name="RuntimeInfo.html"
+ title="Runtime Information" />
-
</zopeConfigure>
=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/index.pt 1.1.2.1 => 1.1.2.2 ===
<!-- XXX /ApplicationController;etc/${info/name} is a workaround for the unavailable
absolute_url function. -->
- <li tal:repeat="info context/getListOfViews"><a tal:attributes="href string:/ApplicationController;;etc/${info/name};;view" tal:content="info/title">Foo Title</a></li>
+ <li tal:repeat="info context/getListOfViews"><a
+ tal:attributes="href
+ string:/etc::ApplicationController/view::${info/name}"
+ tal:content="info/title"
+ >Foo Title</a></li>
</ul>
</div>
=== Removed File Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/ApplicationControlView.py ===