Commit 89132919 authored by Jason R. Coombs's avatar Jason R. Coombs

Use a single, multiline literal to express the template for clarity.

--HG--
extra : rebase_source : df5f817f45451b3a2c4093c12bb7b2b51f8ff3b7
parent e8319c9e
[setuptools.file_finders] [setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl svn_cvs = setuptools.command.sdist:_default_revctrl
[egg_info.writers] [egg_info.writers]
depends.txt = setuptools.command.egg_info:warn_depends_obsolete depends.txt = setuptools.command.egg_info:warn_depends_obsolete
top_level.txt = setuptools.command.egg_info:write_toplevel_names top_level.txt = setuptools.command.egg_info:write_toplevel_names
namespace_packages.txt = setuptools.command.egg_info:overwrite_arg namespace_packages.txt = setuptools.command.egg_info:overwrite_arg
eager_resources.txt = setuptools.command.egg_info:overwrite_arg eager_resources.txt = setuptools.command.egg_info:overwrite_arg
dependency_links.txt = setuptools.command.egg_info:overwrite_arg dependency_links.txt = setuptools.command.egg_info:overwrite_arg
requires.txt = setuptools.command.egg_info:write_requirements requires.txt = setuptools.command.egg_info:write_requirements
PKG-INFO = setuptools.command.egg_info:write_pkg_info PKG-INFO = setuptools.command.egg_info:write_pkg_info
entry_points.txt = setuptools.command.egg_info:write_entries entry_points.txt = setuptools.command.egg_info:write_entries
[setuptools.installation] [setuptools.installation]
eggsecutable = setuptools.command.easy_install:bootstrap eggsecutable = setuptools.command.easy_install:bootstrap
[console_scripts] [console_scripts]
easy_install = setuptools.command.easy_install:main easy_install = setuptools.command.easy_install:main
easy_install-3.3 = setuptools.command.easy_install:main easy_install-3.3 = setuptools.command.easy_install:main
[distutils.setup_keywords] [distutils.setup_keywords]
dependency_links = setuptools.dist:assert_string_list dependency_links = setuptools.dist:assert_string_list
packages = setuptools.dist:check_packages packages = setuptools.dist:check_packages
exclude_package_data = setuptools.dist:check_package_data exclude_package_data = setuptools.dist:check_package_data
use_2to3_exclude_fixers = setuptools.dist:assert_string_list use_2to3_exclude_fixers = setuptools.dist:assert_string_list
package_data = setuptools.dist:check_package_data package_data = setuptools.dist:check_package_data
use_2to3 = setuptools.dist:assert_bool use_2to3 = setuptools.dist:assert_bool
tests_require = setuptools.dist:check_requirements tests_require = setuptools.dist:check_requirements
entry_points = setuptools.dist:check_entry_points entry_points = setuptools.dist:check_entry_points
extras_require = setuptools.dist:check_extras extras_require = setuptools.dist:check_extras
include_package_data = setuptools.dist:assert_bool include_package_data = setuptools.dist:assert_bool
eager_resources = setuptools.dist:assert_string_list eager_resources = setuptools.dist:assert_string_list
zip_safe = setuptools.dist:assert_bool zip_safe = setuptools.dist:assert_bool
install_requires = setuptools.dist:check_requirements install_requires = setuptools.dist:check_requirements
use_2to3_fixers = setuptools.dist:assert_string_list use_2to3_fixers = setuptools.dist:assert_string_list
test_suite = setuptools.dist:check_test_suite test_suite = setuptools.dist:check_test_suite
test_loader = setuptools.dist:check_importable test_loader = setuptools.dist:check_importable
namespace_packages = setuptools.dist:check_nsp namespace_packages = setuptools.dist:check_nsp
convert_2to3_doctests = setuptools.dist:assert_string_list convert_2to3_doctests = setuptools.dist:assert_string_list
[distutils.commands] [distutils.commands]
bdist_egg = setuptools.command.bdist_egg:bdist_egg bdist_egg = setuptools.command.bdist_egg:bdist_egg
egg_info = setuptools.command.egg_info:egg_info egg_info = setuptools.command.egg_info:egg_info
alias = setuptools.command.alias:alias alias = setuptools.command.alias:alias
sdist = setuptools.command.sdist:sdist sdist = setuptools.command.sdist:sdist
bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm
test = setuptools.command.test:test test = setuptools.command.test:test
easy_install = setuptools.command.easy_install:easy_install easy_install = setuptools.command.easy_install:easy_install
register = setuptools.command.register:register register = setuptools.command.register:register
setopt = setuptools.command.setopt:setopt setopt = setuptools.command.setopt:setopt
install = setuptools.command.install:install install = setuptools.command.install:install
install_scripts = setuptools.command.install_scripts:install_scripts install_scripts = setuptools.command.install_scripts:install_scripts
bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst
build_ext = setuptools.command.build_ext:build_ext build_ext = setuptools.command.build_ext:build_ext
rotate = setuptools.command.rotate:rotate rotate = setuptools.command.rotate:rotate
develop = setuptools.command.develop:develop develop = setuptools.command.develop:develop
install_lib = setuptools.command.install_lib:install_lib install_lib = setuptools.command.install_lib:install_lib
upload_docs = setuptools.command.upload_docs:upload_docs upload_docs = setuptools.command.upload_docs:upload_docs
install_egg_info = setuptools.command.install_egg_info:install_egg_info install_egg_info = setuptools.command.install_egg_info:install_egg_info
build_py = setuptools.command.build_py:build_py build_py = setuptools.command.build_py:build_py
saveopts = setuptools.command.saveopts:saveopts saveopts = setuptools.command.saveopts:saveopts
...@@ -22,6 +22,7 @@ import re ...@@ -22,6 +22,7 @@ import re
import stat import stat
import random import random
import platform import platform
import textwrap
from glob import glob from glob import glob
from distutils import log, dir_util from distutils import log, dir_util
...@@ -1786,18 +1787,17 @@ class ScriptWriter(object): ...@@ -1786,18 +1787,17 @@ class ScriptWriter(object):
gui apps. gui apps.
""" """
template = ( template = textwrap.dedent("""
"# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n" # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
"__requires__ = %(spec)r\n" __requires__ = %(spec)r
"import sys\n" import sys
"from pkg_resources import load_entry_point\n" from pkg_resources import load_entry_point
"\n"
"if __name__ == '__main__':" if __name__ == '__main__':
"\n" sys.exit(
" sys.exit(\n" load_entry_point(%(spec)r, %(group)r, %(name)r)()
" load_entry_point(%(spec)r, %(group)r, %(name)r)()\n" )
" )\n" """).lstrip()
)
@classmethod @classmethod
def get_script_args(cls, dist, executable=sys_executable, wininst=False): def get_script_args(cls, dist, executable=sys_executable, wininst=False):
......
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