[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser - RuntimeInfoView.py:1.3 runtimeinfo.pt:1.3

Christian Theune ct@gocept.com
Sat, 7 Dec 2002 12:16:03 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser
In directory cvs.zope.org:/tmp/cvs-serv4330/Views/Browser

Modified Files:
	RuntimeInfoView.py runtimeinfo.pt 
Log Message:
Changed behaviour when failing to acquire information about runtime.


=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/RuntimeInfoView.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/RuntimeInfoView.py:1.2	Mon Jun 10 19:27:54 2002
+++ Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/RuntimeInfoView.py	Sat Dec  7 12:16:02 2002
@@ -20,13 +20,27 @@
 from Zope.App.OFS.ApplicationControl.IRuntimeInfo import IRuntimeInfo
 from Zope.App.PageTemplate import ViewPageTemplateFile
 from Zope.ComponentArchitecture import getAdapter
+from Zope.ComponentArchitecture import ComponentLookupError
 
 class RuntimeInfoView(BrowserView):
     
     def runtimeInfo(self):
-        # XXX what are we going to do if this fails???
-        runtime_info = getAdapter(self.context, IRuntimeInfo)
-        formatted = {}  # contains formatted runtime information
+        formatted = {}  # will contain formatted runtime information
+        
+        try:
+            runtime_info = getAdapter(self.context, IRuntimeInfo)
+        except ComponentLookupError:
+            # XXX We avoid having errors in the ApplicationController,
+            # because all those things need to stay accessible.
+            # Everybody ok with that?
+            formatted['ZopeVersion'] = "N/A"
+            formatted['PythonVersion'] = "N/A"
+            formatted['PythonPath'] = "N/A"
+            formatted['SystemPlatform'] = "N/A"
+            formatted['CommandLine'] = "N/A"
+            formatted['ProcessId'] = "N/A"
+            formatted['Hint'] = "Could not retrieve runtime information."
+        
         formatted['ZopeVersion'] = runtime_info.getZopeVersion()
         formatted['PythonVersion'] = runtime_info.getPythonVersion()
         formatted['PythonPath'] = runtime_info.getPythonPath()


=== Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/runtimeinfo.pt 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/runtimeinfo.pt:1.2	Mon Jun 10 19:27:54 2002
+++ Zope3/lib/python/Zope/App/OFS/ApplicationControl/Views/Browser/runtimeinfo.pt	Sat Dec  7 12:16:02 2002
@@ -16,6 +16,10 @@
       <ul>
         <li tal:repeat="path runtime_info/PythonPath" tal:content="path">path</li>
       </ul>
+   <!-- # XXX UI folks: following line want's special attention. The hardcoding should
+          be removed someday. -->
+   <li tal:condition="runtime_info/Hint | nothing" style="color:red;"
+       tal:content="runtime_info/Hint" />
 </ul>
 
 </div>