Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.buildout
Commits
0a85b307
Commit
0a85b307
authored
Aug 27, 2008
by
Georgy Berdyshev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Jython support.
Signed-off-by:
Georgy Berdyshev - Георгий Бердышев
<
codingmaster@gmail.com
>
parent
4d4be3f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
11 deletions
+42
-11
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+42
-11
No files found.
src/zc/buildout/easy_install.py
View file @
0a85b307
...
...
@@ -50,6 +50,14 @@ logger = logging.getLogger('zc.buildout.easy_install')
url_match
=
re
.
compile
(
'[a-z0-9+.-]+://'
).
match
is_jython
=
sys
.
platform
.
startswith
(
'java'
)
if
is_jython
:
import
subprocess
import
java.lang.System
jython_os_name
=
(
java
.
lang
.
System
.
getProperties
()[
'os.name'
]).
lower
()
setuptools_loc
=
pkg_resources
.
working_set
.
find
(
pkg_resources
.
Requirement
.
parse
(
'setuptools'
)
).
location
...
...
@@ -303,8 +311,18 @@ class Installer:
logger
.
debug
(
'Running easy_install:
\
n
%s "%s"
\
n
path=%s
\
n
'
,
self
.
_executable
,
'" "'
.
join
(
args
),
path
)
if
is_jython
:
extra_env
=
dict
(
os
.
environ
,
PYTHONPATH
=
path
)
else
:
args
+=
(
dict
(
os
.
environ
,
PYTHONPATH
=
path
),
)
sys
.
stdout
.
flush
()
# We want any pending output first
if
is_jython
:
exit_code
=
subprocess
.
Popen
(
[
_safe_arg
(
self
.
_executable
)]
+
list
(
args
),
env
=
extra_env
).
wait
()
else
:
exit_code
=
os
.
spawnle
(
os
.
P_WAIT
,
self
.
_executable
,
_safe_arg
(
self
.
_executable
),
*
args
)
...
...
@@ -863,6 +881,9 @@ def develop(setup, dest,
if
log_level
<
logging
.
DEBUG
:
logger
.
debug
(
"in: %r
\
n
%s"
,
directory
,
' '
.
join
(
args
))
if
is_jython
:
assert
subprocess
.
Popen
([
_safe_arg
(
executable
)]
+
args
).
wait
()
==
0
else
:
assert
os
.
spawnl
(
os
.
P_WAIT
,
executable
,
_safe_arg
(
executable
),
*
args
)
==
0
return
_copyeggs
(
tmp3
,
dest
,
'.egg-link'
,
undo
)
...
...
@@ -967,8 +988,13 @@ def _script(module_name, attrs, path, dest, executable, arguments,
generated
.
append
(
dest
)
return
generated
script_template
=
'''
\
#!%(python)s
if
is_jython
and
jython_os_name
==
'linux'
:
script_header
=
'#!/usr/bin/env %(python)s'
else
:
script_header
=
'#!%(python)s'
script_template
=
script_header
+
'''
\
import sys
sys.path[0:0] = [
...
...
@@ -1013,8 +1039,9 @@ def _pyscript(path, dest, executable):
generated
.
append
(
dest
)
return
generated
py_script_template
=
'''
\
#!%(python)s
py_script_template
=
script_header
+
'''
\
import sys
sys.path[0:0] = [
...
...
@@ -1135,5 +1162,9 @@ def redo_pyc(egg):
if
__debug__
:
args
.
append
(
'-O'
)
args
.
extend
([
'-m'
,
'py_compile'
,
filepath
])
if
is_jython
:
subprocess
.
call
([
sys
.
executable
,
args
])
else
:
os
.
spawnv
(
os
.
P_WAIT
,
sys
.
executable
,
args
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment