[Checkins] SVN: zope.schema/trunk/bootstrap.py Added support to bootstrap on Jython.
Georgy Berdyshev
codingmaster at gmail.com
Wed Aug 27 19:41:17 EDT 2008
Log message for revision 90503:
Added support to bootstrap on Jython.
Signed-off-by: Georgy Berdyshev - ?\208?\147?\208?\181?\208?\190?\209?\128?\208?\179?\208?\184?\208?\185 ?\208?\145?\208?\181?\209?\128?\208?\180?\209?\139?\209?\136?\208?\181?\208?\178 <codingmaster at gmail.com>
Changed:
U zope.schema/trunk/bootstrap.py
-=-
Modified: zope.schema/trunk/bootstrap.py
===================================================================
--- zope.schema/trunk/bootstrap.py 2008-08-27 23:38:15 UTC (rev 90502)
+++ zope.schema/trunk/bootstrap.py 2008-08-27 23:41:16 UTC (rev 90503)
@@ -17,7 +17,7 @@
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
-$Id: bootstrap.py 72703 2007-02-20 11:49:26Z jim $
+$Id$
"""
import os, shutil, sys, tempfile, urllib2
@@ -31,20 +31,36 @@
import pkg_resources
+is_jython = sys.platform.startswith('java')
+
+if is_jython:
+ import subprocess
+
cmd = 'from setuptools.command.easy_install import main; main()'
if sys.platform == 'win32':
cmd = '"%s"' % cmd # work around spawn lamosity on windows
ws = pkg_resources.working_set
-assert os.spawnle(
- os.P_WAIT, sys.executable, sys.executable,
- '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
- dict(os.environ,
- PYTHONPATH=
- ws.find(pkg_resources.Requirement.parse('setuptools')).location
- ),
- ) == 0
+if is_jython:
+ assert subprocess.Popen(
+ [sys.executable] + ['-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout'],
+ env = dict(os.environ,
+ PYTHONPATH =
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ).wait() == 0
+
+else:
+ assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
ws.add_entry(tmpeggs)
ws.require('zc.buildout')
import zc.buildout.buildout
More information about the Checkins
mailing list