diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-04 15:49:50 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-04 15:49:50 -0500 |
commit | 4108a12a41f3c413f2ea5e8ede3075d67067cba5 (patch) | |
tree | 2f60fd43979eb38fd6e7a6a699b2ac08b5c8dead | |
parent | 76dd319a776b3fb7bc7836eb18429ab407379ea9 (diff) | |
download | external_python_setuptools-4108a12a41f3c413f2ea5e8ede3075d67067cba5.tar.gz external_python_setuptools-4108a12a41f3c413f2ea5e8ede3075d67067cba5.tar.bz2 external_python_setuptools-4108a12a41f3c413f2ea5e8ede3075d67067cba5.zip |
Extract method for getting script args
-rwxr-xr-x | setuptools/command/easy_install.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index c68fe757..4e05d670 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1904,15 +1904,19 @@ class ScriptWriter(object): """ Yield write_script() argument tuples for a distribution's entrypoints """ - gen_class = cls.get_writer(wininst) - spec = str(dist.as_requirement()) + writer = cls.get_writer(wininst) header = get_script_header("", executable, wininst) + return cls._gen_args(dist, writer, header) + + @classmethod + def _gen_args(cls, dist, writer, header): + spec = str(dist.as_requirement()) for type_ in 'console', 'gui': group = type_ + '_scripts' for name, ep in dist.get_entry_map(group).items(): - script_text = gen_class.template % locals() - for res in gen_class._get_script_args(type_, name, header, - script_text): + script_text = writer.template % locals() + for res in writer._get_script_args(type_, name, header, + script_text): yield res @classmethod |