summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2011-05-31 07:18:24 (GMT)
committerTarek Ziade <tarek@ziade.org>2011-05-31 07:18:24 (GMT)
commit441531f6e66e159b58a02663857a13c38719eb0b (patch)
tree6fded332e836379108f1ea8ab4edd1108b48acd0
parent90fb9283fc342339ef6687d4927d3b74b2b73ecd (diff)
downloadcpython-441531f6e66e159b58a02663857a13c38719eb0b.zip
cpython-441531f6e66e159b58a02663857a13c38719eb0b.tar.gz
cpython-441531f6e66e159b58a02663857a13c38719eb0b.tar.bz2
improved pysetup list UI
-rw-r--r--Lib/packaging/run.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/packaging/run.py b/Lib/packaging/run.py
index 03b80c6..6e4816d 100644
--- a/Lib/packaging/run.py
+++ b/Lib/packaging/run.py
@@ -337,13 +337,21 @@ def _run(dispatcher, args, **kw):
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)