diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-07-25 03:12:51 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-07-25 03:12:51 +0000 |
| commit | 54bb8e4003534a9af54028ef719eda5ba6088bac (patch) | |
| tree | bdae8c0810e7a1a4ecf7e93669cbba45f0de9fcb /setuptools/dist.py | |
| parent | 1c40632b88d76aea178e751483645ec3d32c81d9 (diff) | |
| download | python-setuptools-git-54bb8e4003534a9af54028ef719eda5ba6088bac.tar.gz | |
Misc. bug fixes and doc additions. Add 'iter_entry_points()' API.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041153
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index a603ade0..40234b4e 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -16,20 +16,17 @@ def get_command_class(self, command): if command in self.cmdclass: return self.cmdclass[command] - for dist in pkg_resources.working_set: - if dist.get_entry_info('distutils.commands',command): - cmdclass = dist.load_entry_point('distutils.commands',command) - self.cmdclass[command] = cmdclass - return cmdclass + for ep in pkg_resources.iter_entry_points('distutils.commands',command): + self.cmdclass[command] = cmdclass = ep.load() + return cmdclass else: return _old_get_command_class(self, command) def print_commands(self): - for dist in pkg_resources.working_set: - for cmd,ep in dist.get_entry_map('distutils.commands').items(): - if cmd not in self.cmdclass: - cmdclass = ep.load() # don't require extras, we're not running - self.cmdclass[cmd] = cmdclass + for ep in pkg_resources.iter_entry_points('distutils.commands'): + if ep.name not in self.cmdclass: + cmdclass = ep.load(False) # don't require extras, we're not running + self.cmdclass[ep.name] = cmdclass return _old_print_commands(self) for meth in 'print_commands', 'get_command_class': @@ -39,6 +36,9 @@ for meth in 'print_commands', 'get_command_class': sequence = tuple, list + + + class Distribution(_Distribution): """Distribution with support for features, tests, and package data |
