Commit 3e11424d authored by georgyberdyshev's avatar georgyberdyshev

Added Jython support.

Signed-off-by: default avatarGeorgy Berdyshev - Георгий Бердышев <codingmaster@gmail.com>


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@90480 62d5b8a3-27da-0310-9561-8e5933582275
parent d52e6074
...@@ -43,6 +43,11 @@ pkg_resources_loc = pkg_resources.working_set.find( ...@@ -43,6 +43,11 @@ pkg_resources_loc = pkg_resources.working_set.find(
_isurl = re.compile('([a-zA-Z0-9+.-]+)://').match _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): class MissingOption(zc.buildout.UserError, KeyError):
"""A required option was missing """A required option was missing
""" """
...@@ -780,6 +785,10 @@ class Buildout(UserDict.DictMixin): ...@@ -780,6 +785,10 @@ class Buildout(UserDict.DictMixin):
if not __debug__: if not __debug__:
args.insert(0, '-O') args.insert(0, '-O')
args.insert(0, zc.buildout.easy_install._safe_arg (sys.executable)) args.insert(0, zc.buildout.easy_install._safe_arg (sys.executable))
if is_jython:
sys.exit(subprocess.Popen([sys.executable] + list(args)).wait())
else:
sys.exit(os.spawnv(os.P_WAIT, sys.executable, args)) sys.exit(os.spawnv(os.P_WAIT, sys.executable, args))
def _load_extensions(self): def _load_extensions(self):
...@@ -831,6 +840,16 @@ class Buildout(UserDict.DictMixin): ...@@ -831,6 +840,16 @@ class Buildout(UserDict.DictMixin):
setup=setup, setup=setup,
__file__ = setup, __file__ = setup,
)) ))
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, os.spawnl(os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable), tsetup,
*[zc.buildout.easy_install._safe_arg(a) *[zc.buildout.easy_install._safe_arg(a)
for a in args]) for a in args])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment