[Zope3-checkins] CVS: Zope3/utilities - runurl.py:1.3.2.1
Grégoire Weber
zope@i-con.ch
Sun, 22 Jun 2003 10:27:07 -0400
Update of /cvs-repository/Zope3/utilities
In directory cvs.zope.org:/tmp/cvs-serv28993/utilities
Modified Files:
Tag: cw-mail-branch
runurl.py
Log Message:
Synced up with HEAD
=== Zope3/utilities/runurl.py 1.3 => 1.3.2.1 ===
--- Zope3/utilities/runurl.py:1.3 Thu May 15 15:01:37 2003
+++ Zope3/utilities/runurl.py Sun Jun 22 10:27:05 2003
@@ -61,6 +61,10 @@
--help
Output this usage information.
+
+ --build
+
+ Run from a build directory
$Id$
"""
@@ -74,7 +78,6 @@
argv = sys.argv
script = argv[0]
- app = _doimport(script)
args = argv[1:]
@@ -83,7 +86,7 @@
args,
'b:r:p:d:c:hi:w',
['basic=', 'run=', 'profile=', 'database=', 'config=', 'help',
- 'input=', 'warmup', 'hotshot='])
+ 'input=', 'warmup', 'build', 'hotshot='])
except getopt.GetoptError:
print __doc__ % {'script': script}
raise
@@ -91,6 +94,7 @@
basic = run = warm = profilef = database = config = hotshotf = None
stdin = ''
+ src = 'src'
for name, value in options:
if name in ('-b', '--basic'):
basic = value
@@ -100,6 +104,11 @@
profilef = value
elif name in ('--hotshot', ):
hotshotf = value
+ elif name in ('--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)
+
elif name in ('-d', '--database'):
database = value
elif name in ('-c', '--config'):
@@ -123,6 +132,7 @@
name, value = arg.split('=', 1)
env[name]=value
+ app = _doimport(script, src)
app = app.Application(database, config)
if warm:
@@ -174,7 +184,7 @@
environment=environment)
-def _doimport(script):
+def _doimport(script, src):
try:
import zope.app
except ImportError:
@@ -182,7 +192,7 @@
dir = os.path.split(script)[0]
# dir dir containing the dir containing the script (Zope3)
dir = os.path.split(dir)[0]
- sys.path.append(os.path.join(dir, 'src'))
+ sys.path.append(os.path.join(dir, src))
from zope import app
return app