]> granicus.if.org Git - python/commitdiff
improved pysetup list UI
authorTarek Ziade <tarek@ziade.org>
Tue, 31 May 2011 07:18:24 +0000 (09:18 +0200)
committerTarek Ziade <tarek@ziade.org>
Tue, 31 May 2011 07:18:24 +0000 (09:18 +0200)
Lib/packaging/run.py

index 03b80c6a05c6e39591a90b0f26a7d990252a39c6..6e4816d76fabafe6ba8b20f4b11a3fde2a2274be 100644 (file)
@@ -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)