[Zope-Checkins] CVS: Zope/lib/python/App - ApplicationManager.py:1.81.24.1

Andreas Jung andreas@andreas-jung.com
Sat, 9 Nov 2002 03:43:26 -0500


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv26094/lib/python/App

Modified Files:
      Tag: ajung-restructuredtext-integration-branch
	ApplicationManager.py 
Log Message:
merge from trunk


=== Zope/lib/python/App/ApplicationManager.py 1.81 => 1.81.24.1 ===
--- Zope/lib/python/App/ApplicationManager.py:1.81	Wed Aug 14 17:31:40 2002
+++ Zope/lib/python/App/ApplicationManager.py	Sat Nov  9 03:42:55 2002
@@ -28,6 +28,7 @@
 from cStringIO import StringIO
 from AccessControl import getSecurityManager
 import zLOG
+import Lifetime
 
 try: import thread
 except: get_ident=lambda: 0
@@ -326,12 +327,12 @@
             zLOG.LOG("ApplicationManager", zLOG.INFO,
                      "Restart requested by %s" % user)
             for db in Globals.opened: db.close()
-            raise SystemExit, """<html>
+            Lifetime.shutdown(1)
+            return """<html>
             <head><meta HTTP-EQUIV=REFRESH CONTENT="5; URL=%s/manage_main">
             </head>
             <body>Zope is restarting</body></html>
             """ % URL1
-            sys.exit(1)
 
     def manage_shutdown(self):
         """Shut down the application"""
@@ -341,8 +342,13 @@
             user = 'unknown user'
         zLOG.LOG("ApplicationManager", zLOG.INFO,
                  "Shutdown requested by %s" % user)
-        for db in Globals.opened: db.close()
-        sys.exit(0)
+        #for db in Globals.opened: db.close()
+        Lifetime.shutdown(0)
+        return """<html>
+        <head>
+        </head>
+        <body>Zope is shutting down</body></html>
+        """
 
     def manage_pack(self, days=0, REQUEST=None):
         """Pack the database"""