[Zope3-checkins] SVN: Zope3/trunk/bin/ analogs for the new zopectl features so they work for in-place instances

Zachery Bir zbir at urbanape.com
Wed Dec 7 11:11:20 EST 2005


Log message for revision 40623:
  analogs for the new zopectl features so they work for in-place instances

Changed:
  U   Zope3/trunk/bin/debugzope
  A   Zope3/trunk/bin/scriptzope

-=-
Modified: Zope3/trunk/bin/debugzope
===================================================================
--- Zope3/trunk/bin/debugzope	2005-12-07 15:38:56 UTC (rev 40622)
+++ Zope3/trunk/bin/debugzope	2005-12-07 16:11:20 UTC (rev 40623)
@@ -55,5 +55,6 @@
     del startup
     from zope.app.debug import Debugger
     debugger = app = Debugger.fromDatabase(db)
+    root = app.root()
     del db
     del Debugger

Added: Zope3/trunk/bin/scriptzope
===================================================================
--- Zope3/trunk/bin/scriptzope	2005-12-07 15:38:56 UTC (rev 40622)
+++ Zope3/trunk/bin/scriptzope	2005-12-07 16:11:20 UTC (rev 40623)
@@ -0,0 +1,62 @@
+#!/usr/bin/env python2.4
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (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.
+#
+##############################################################################
+"""Script to run the Zope Application Server from the Python prompt.
+
+$Id$
+"""
+import os
+import sys
+
+os.environ["PYTHONINSPECT"] = "true"
+
+SCRIPT_NAME = os.path.abspath(__file__)
+INSTANCE_HOME = os.path.dirname(os.path.dirname(SCRIPT_NAME))
+del SCRIPT_NAME
+SOFTWARE_HOME = os.path.join(INSTANCE_HOME, "src")
+
+if SOFTWARE_HOME not in sys.path:
+    sys.path.insert(0, SOFTWARE_HOME)
+
+CONFIG_FILE = os.path.join(INSTANCE_HOME, "zope.conf")
+if not os.path.exists(CONFIG_FILE):
+    CONFIG_FILE += ".in"
+
+
+def startup():
+    # This removes the script directory from sys.path, which we do
+    # since there are no modules here.
+    #
+    basepath = filter(None, sys.path)
+
+    sys.path[:] = [os.path.join(INSTANCE_HOME, "lib", "python"),
+                   SOFTWARE_HOME] + basepath
+
+    from zope.app.server.main import debug
+    db = debug(["-C", CONFIG_FILE])
+    if "PYTHONSTARTUP" in os.environ:
+        execfile(os.environ["PYTHONSTARTUP"])
+    return db
+
+
+if __name__ == '__main__':
+    from zope.app.debug import Debugger
+
+    db = startup()
+    root = Debugger.fromDatabase(db).root()
+    del startup, db, Debugger
+
+    script = sys.argv[1]
+    execfile(script)
+    sys.exit()


Property changes on: Zope3/trunk/bin/scriptzope
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list