[Zope3-checkins] CVS: Zope3 - z3.py:1.19

Jim Fulton jim@zope.com
Wed, 11 Jun 2003 16:12:33 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv13923

Modified Files:
	z3.py 
Log Message:
Added a --build option. If this option is provided, then Zope will run
from a build directory.


=== Zope3/z3.py 1.18 => 1.19 ===
--- Zope3/z3.py:1.18	Tue Apr 22 08:08:13 2003
+++ Zope3/z3.py	Wed Jun 11 16:12:32 2003
@@ -17,11 +17,14 @@
 $Id$
 """
 
-import os, sys, time
+import os, sys, time, getopt
 
 basepath = filter(None, sys.path)
 
 def run(argv=sys.argv):
+
+    
+    
     # Record start times (real time and CPU time)
     t0 = time.time()
     c0 = time.clock()
@@ -38,9 +41,17 @@
         sys.exit(1)
 
     # setting python paths
-    program = argv[0]
+    program = argv.pop(0)
+    if argv == ['--build']:
+        from distutils.util import get_platform
+        PLAT_SPEC = "%s-%s" % (get_platform(), sys.version[0:3])
+        src = os.path.join("build", "lib.%s" % PLAT_SPEC)
+    else:
+        src='src'
+
+    
     here = os.path.join(os.getcwd(), os.path.split(program)[0])
-    srcdir = os.path.abspath('src')
+    srcdir = os.path.abspath(src)
     sys.path = [srcdir, here] + basepath
 
     # Initialize the logging module.