Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
126d9717
Commit
126d9717
authored
Jan 04, 2015
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CommandSpec in ScriptWriter, removing now unused methods.
parent
254c2f03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
33 deletions
+3
-33
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+3
-33
No files found.
setuptools/command/easy_install.py
View file @
126d9717
...
...
@@ -2014,39 +2014,9 @@ class ScriptWriter(object):
@
classmethod
def
get_header
(
cls
,
script_text
=
""
,
executable
=
None
):
"""Create a #! line, getting options (if any) from script_text"""
executable
=
executable
or
nt_quote_arg
(
CommandSpec
.
launcher
)
options
=
cls
.
_extract_options
(
script_text
)
options
=
cls
.
_handle_non_ascii_exe
(
executable
,
options
)
tmpl
=
'#!{executable} {options}
\
n
'
if
options
else
'#!{executable}
\
n
'
executable
=
fix_jython_executable
(
executable
,
options
)
return
tmpl
.
format
(
**
locals
())
@
classmethod
def
_extract_options
(
cls
,
orig_script
):
"""
Extract any options from the first line of the script.
"""
first
=
(
orig_script
+
'
\
n
'
).
splitlines
()[
0
]
match
=
_first_line_re
().
match
(
first
)
options
=
match
.
group
(
1
)
or
''
if
match
else
''
return
options
.
strip
()
@
classmethod
def
_handle_non_ascii_exe
(
cls
,
executable
,
options
):
if
isascii
(
executable
):
return
options
# Non-ascii path to sys.executable, use -x to prevent warnings
if
not
options
:
return
'-x'
if
not
options
.
strip
().
startswith
(
'-'
):
# punt, we can't do it, let the warning happen anyway
return
options
return
'-x'
+
options
.
strip
()[
1
:]
cmd
=
CommandSpec
.
from_param
(
executable
)
cmd
.
install_options
(
script_text
)
return
cmd
.
as_header
()
class
WindowsScriptWriter
(
ScriptWriter
):
...
...
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