[Checkins] SVN: zc.buildout/branches/help-api/src/zc/buildout/buildout.py Added Jython support.
Godefroid Chapelle
gotcha at bubblenet.be
Sun Mar 29 17:25:38 EDT 2009
Log message for revision 98543:
Added Jython support.
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 zc.buildout/branches/help-api/src/zc/buildout/buildout.py
-=-
Modified: zc.buildout/branches/help-api/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/help-api/src/zc/buildout/buildout.py 2009-03-29 21:25:31 UTC (rev 98542)
+++ zc.buildout/branches/help-api/src/zc/buildout/buildout.py 2009-03-29 21:25:38 UTC (rev 98543)
@@ -41,6 +41,11 @@
_isurl = re.compile('([a-zA-Z0-9+.-]+)://').match
+is_jython = sys.platform.startswith('java')
+
+if is_jython:
+ import subprocess
+
class MissingOption(zc.buildout.UserError, KeyError):
"""A required option was missing
"""
@@ -779,8 +784,12 @@
if not __debug__:
args.insert(0, '-O')
args.insert(0, zc.buildout.easy_install._safe_arg (sys.executable))
- sys.exit(os.spawnv(os.P_WAIT, sys.executable, args))
+ if is_jython:
+ sys.exit(subprocess.Popen([sys.executable] + list(args)).wait())
+ else:
+ sys.exit(os.spawnv(os.P_WAIT, sys.executable, args))
+
def _load_extensions(self):
__doing__ = 'Loading extensions.'
specs = self['buildout'].get('extensions', '').split()
@@ -830,9 +839,19 @@
setup=setup,
__file__ = setup,
))
- os.spawnl(os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable), tsetup,
- *[zc.buildout.easy_install._safe_arg(a)
- for a in args])
+ if is_jython:
+ arg_list = list()
+
+ for a in args:
+ add_args.append(zc.buildout.easy_install._safe_arg(a))
+
+ subprocess.Popen([zc.buildout.easy_install._safe_arg(sys.executable)] + list(tsetup) +
+ arg_list).wait()
+
+ else:
+ os.spawnl(os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable), tsetup,
+ *[zc.buildout.easy_install._safe_arg(a)
+ for a in args])
finally:
os.close(fd)
os.remove(tsetup)
More information about the Checkins
mailing list