Commit e1194b1e authored by Jim Fulton's avatar Jim Fulton

Merge pull request #53 from reinout/fix-distutilsscripts-on-windows

Fixed filename of distutils-scripts on windows. Fixes #52
parents 7c9f4f39 1c711155
...@@ -33,7 +33,6 @@ import subprocess ...@@ -33,7 +33,6 @@ import subprocess
import sys import sys
import tempfile import tempfile
import zc.buildout import zc.buildout
import zipimport
_oprp = getattr(os.path, 'realpath', lambda path: path) _oprp = getattr(os.path, 'realpath', lambda path: path)
def realpath(path): def realpath(path):
...@@ -1022,8 +1021,6 @@ base = os.path.dirname(os.path.abspath(os.path.realpath(__file__))) ...@@ -1022,8 +1021,6 @@ base = os.path.dirname(os.path.abspath(os.path.realpath(__file__)))
""" """
def _script(module_name, attrs, path, dest, arguments, initialization, rsetup): def _script(module_name, attrs, path, dest, arguments, initialization, rsetup):
generated = []
script = dest
if is_win32: if is_win32:
dest += '-script.py' dest += '-script.py'
...@@ -1042,6 +1039,8 @@ def _script(module_name, attrs, path, dest, arguments, initialization, rsetup): ...@@ -1042,6 +1039,8 @@ def _script(module_name, attrs, path, dest, arguments, initialization, rsetup):
def _distutils_script(path, dest, script_content, initialization, rsetup): def _distutils_script(path, dest, script_content, initialization, rsetup):
if is_win32:
dest += '-script.py'
lines = script_content.splitlines(True) lines = script_content.splitlines(True)
if not ('#!' in lines[0]) and ('python' in lines[0]): if not ('#!' in lines[0]) and ('python' in lines[0]):
......
...@@ -912,6 +912,18 @@ Buildout also installs those: ...@@ -912,6 +912,18 @@ Buildout also installs those:
>>> ls(distbin) >>> ls(distbin)
- distutilsscript - distutilsscript
Like for console_scripts, the output is a list of the scripts
generated. Likewise, on windows two files, an ``.exe`` and a script with
``-script.py`` appended, are generated:
>>> import os, sys
>>> if sys.platform == 'win32':
... scripts == [os.path.join(distbin, 'distutilsscript.exe'),
... os.path.join(distbin, 'distutilsscript-script.py')]
... else:
... scripts == [os.path.join(distbin, 'distutilsscript')]
True
It also works for zipped eggs: It also works for zipped eggs:
>>> distdir2 = tmpdir('distutilsscriptdir2') >>> distdir2 = tmpdir('distutilsscriptdir2')
......
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