[Zope3-checkins] SVN: Zope3/trunk/zopeskel/bin/scriptzope. new scriptzope script to allow for running arbitrary filesystem scripts

Zachery Bir zbir at urbanape.com
Wed Dec 7 10:35:38 EST 2005


Log message for revision 40619:
  new scriptzope script to allow for running arbitrary filesystem scripts

Changed:
  A   Zope3/trunk/zopeskel/bin/scriptzope.bat.in
  A   Zope3/trunk/zopeskel/bin/scriptzope.in

-=-
Added: Zope3/trunk/zopeskel/bin/scriptzope.bat.in
===================================================================
--- Zope3/trunk/zopeskel/bin/scriptzope.bat.in	2005-12-07 15:34:58 UTC (rev 40618)
+++ Zope3/trunk/zopeskel/bin/scriptzope.bat.in	2005-12-07 15:35:38 UTC (rev 40619)
@@ -0,0 +1,4 @@
+ at echo off
+set PYTHON=<<PYTHON>>
+set INSTANCE_HOME=<<INSTANCE_HOME>>
+"%PYTHON%" -i "%INSTANCE_HOME%\bin\scriptzope" %1 %2 %3 %4 %5 %6 %7


Property changes on: Zope3/trunk/zopeskel/bin/scriptzope.bat.in
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Added: Zope3/trunk/zopeskel/bin/scriptzope.in
===================================================================
--- Zope3/trunk/zopeskel/bin/scriptzope.in	2005-12-07 15:34:58 UTC (rev 40618)
+++ Zope3/trunk/zopeskel/bin/scriptzope.in	2005-12-07 15:35:38 UTC (rev 40619)
@@ -0,0 +1,55 @@
+#!<<PYTHON>> -i
+##############################################################################
+#
+# 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
+
+import paths
+paths.addPackagePaths()
+
+SOFTWARE_HOME = r"<<SOFTWARE_HOME>>"
+INSTANCE_HOME = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+CONFIG_FILE = os.path.join(INSTANCE_HOME, "etc", "zope.conf")
+
+
+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/zopeskel/bin/scriptzope.in
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list