cpython: improved pysetup list UI
http://hg.python.org/cpython/rev/b18294799807 changeset: 70546:b18294799807 user: Tarek Ziade <tarek@ziade.org> date: Tue May 31 09:18:24 2011 +0200 summary: improved pysetup list UI files: Lib/packaging/run.py | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Lib/packaging/run.py b/Lib/packaging/run.py --- a/Lib/packaging/run.py +++ b/Lib/packaging/run.py @@ -337,13 +337,21 @@ def _list(dispatcher, args, **kw): opts = _parse_args(args[1:], '', ['all']) dists = get_distributions(use_egg_info=True) - if 'all' in opts: + if 'all' in opts or opts['args'] == []: results = dists else: results = [d for d in dists if d.name.lower() in opts['args']] + number = 0 for dist in results: print('%s %s at %s' % (dist.name, dist.metadata['version'], dist.path)) + number +=1 + + print('') + if number == 0: + print('Nothing seems to be installed.') + else: + print('Found %d projects installed.' % number) @action_help(search_usage) -- Repository URL: http://hg.python.org/cpython
participants (1)
-
tarek.ziade