[Zope3-checkins] CVS: Zope3/src/zope/app/browser/applicationcontrol - servercontrol.py:1.1.2.2
Fred L. Drake, Jr.
fred@zope.com
Tue, 24 Dec 2002 02:01:46 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/applicationcontrol
In directory cvs.zope.org:/tmp/cvs-serv19226
Modified Files:
Tag: NameGeddon-branch
servercontrol.py
Log Message:
- fixup import
- normalize whitespace
=== Zope3/src/zope/app/browser/applicationcontrol/servercontrol.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/browser/applicationcontrol/servercontrol.py:1.1.2.1 Mon Dec 23 14:30:59 2002
+++ Zope3/src/zope/app/browser/applicationcontrol/servercontrol.py Tue Dec 24 02:01:44 2002
@@ -2,41 +2,42 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
__doc__ = """ Server Control View
$Id$ """
from zope.publisher.browser import BrowserView
-from Zope.App.PageTemplate import ViewPageTemplateFile
+from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
from zope.app.interfaces.applicationcontrol.servercontrol \
import IServerControl
from zope.component import getUtility
+
class ServerControlView(BrowserView):
-
+
def serverControl(self):
# XXX Refactor alarm! This is *required*. We really
- # rely on it beeing there. If it was a utility,
+ # rely on it being there. If it was a utility,
# we wouldn't care, if the ServerControl is gone,
# but actually we do. Maybe this should be a service ...
return getUtility(self.context, IServerControl)
-
+
def action(self):
"""Do the shutdown/restart!"""
if 'restart' in self.request:
- return self.serverControl().restart() or "You restarted the server."
+ return (self.serverControl().restart()
+ or "You restarted the server.")
elif 'shutdown' in self.request:
- return self.serverControl().shutdown() or \
- "You shut down the server."
+ return (self.serverControl().shutdown()
+ or "You shut down the server.")
index = ViewPageTemplateFile('server-control.pt')
-