[Zope3-checkins] SVN: Zope3/trunk/ Fixes 98256.
Christian Theune
ct at gocept.com
Sat Apr 21 07:35:21 EDT 2007
Log message for revision 74321:
Fixes 98256.
Changed:
U Zope3/trunk/doc/CHANGES.txt
U Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.pt
U Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.py
U Zope3/trunk/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.py
U Zope3/trunk/src/zope/app/applicationcontrol/interfaces.py
U Zope3/trunk/src/zope/app/applicationcontrol/runtimeinfo.py
-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/doc/CHANGES.txt 2007-04-21 11:35:21 UTC (rev 74321)
@@ -16,6 +16,9 @@
- #99402: zope.app.component.vocabulary.UtilityNameTerm was implement
the wrong interface incorrectly
+ - #98256: Added patch that adds information about developer mode in the
+ application control panel.
+
------------------------------------------------------------------
Zope 3.4.0a1 (2007/04/19)
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.pt
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.pt 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.pt 2007-04-21 11:35:21 UTC (rev 74321)
@@ -49,6 +49,11 @@
tal:content="runtime_info/ProcessId">ID</div>
</div>
<div class="row">
+ <div class="label" i18n:translate="">Developer mode</div>
+ <div class="field"
+ tal:content="runtime_info/DeveloperMode">ID</div>
+ </div>
+ <div class="row">
<div class="label" i18n:translate="">Python path</div>
<div class="field">
<ul>
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.py 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/runtimeinfo.py 2007-04-21 11:35:21 UTC (rev 74321)
@@ -32,7 +32,8 @@
"PreferredEncoding",
"FileSystemEncoding",
"CommandLine",
- "ProcessId"
+ "ProcessId",
+ "DeveloperMode",
)
_unavailable = _("Unavailable")
Modified: Zope3/trunk/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.py 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/src/zope/app/applicationcontrol/browser/tests/test_runtimeinfoview.py 2007-04-21 11:35:21 UTC (rev 74321)
@@ -43,7 +43,7 @@
assert_keys = ['ZopeVersion', 'PythonVersion', 'PythonPath',
'SystemPlatform', 'PreferredEncoding', 'FileSystemEncoding',
- 'CommandLine', 'ProcessId', 'Uptime' ]
+ 'CommandLine', 'ProcessId', 'Uptime', 'DeveloperMode' ]
test_keys = test_format.keys()
assert_keys.sort()
@@ -60,7 +60,7 @@
assert_keys = ['ZopeVersion', 'PythonVersion', 'PythonPath',
'SystemPlatform', 'PreferredEncoding', 'FileSystemEncoding',
- 'CommandLine', 'ProcessId', 'Uptime']
+ 'CommandLine', 'ProcessId', 'Uptime', 'DeveloperMode' ]
test_keys = test_format.keys()
assert_keys.sort()
Modified: Zope3/trunk/src/zope/app/applicationcontrol/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/interfaces.py 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/src/zope/app/applicationcontrol/interfaces.py 2007-04-21 11:35:21 UTC (rev 74321)
@@ -30,6 +30,9 @@
class IRuntimeInfo(Interface):
"""Runtime Information Adapter for Application Control"""
+ def getDeveloperMode():
+ """Return the current developer mode setting"""
+
def getPreferredEncoding():
"""Return the encoding used for text data, according
to user system preferences"""
Modified: Zope3/trunk/src/zope/app/applicationcontrol/runtimeinfo.py
===================================================================
--- Zope3/trunk/src/zope/app/applicationcontrol/runtimeinfo.py 2007-04-21 11:31:31 UTC (rev 74320)
+++ Zope3/trunk/src/zope/app/applicationcontrol/runtimeinfo.py 2007-04-21 11:35:21 UTC (rev 74321)
@@ -37,6 +37,7 @@
from zope.app.applicationcontrol.interfaces import IApplicationControl
from zope.app.applicationcontrol.interfaces import IZopeVersion
+from zope.app.appsetup import appsetup
class RuntimeInfo(object):
"""Runtime information."""
@@ -47,6 +48,15 @@
def __init__(self, context):
self.context = context
+ def getDeveloperMode(self):
+ """See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
+ cc=appsetup.getConfigContext()
+ if cc == None: # make the test run
+ return 'undefined'
+ if cc.hasFeature('devmode'):
+ return 'On'
+ return 'Off'
+
def getPreferredEncoding(self):
"""See zope.app.applicationcontrol.interfaces.IRuntimeInfo"""
if locale is not None:
More information about the Zope3-Checkins
mailing list