mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
improved pysetup list UI
This commit is contained in:
parent
90fb9283fc
commit
441531f6e6
1 changed files with 9 additions and 1 deletions
|
@ -337,13 +337,21 @@ def _run(dispatcher, args, **kw):
|
||||||
def _list(dispatcher, args, **kw):
|
def _list(dispatcher, args, **kw):
|
||||||
opts = _parse_args(args[1:], '', ['all'])
|
opts = _parse_args(args[1:], '', ['all'])
|
||||||
dists = get_distributions(use_egg_info=True)
|
dists = get_distributions(use_egg_info=True)
|
||||||
if 'all' in opts:
|
if 'all' in opts or opts['args'] == []:
|
||||||
results = dists
|
results = dists
|
||||||
else:
|
else:
|
||||||
results = [d for d in dists if d.name.lower() in opts['args']]
|
results = [d for d in dists if d.name.lower() in opts['args']]
|
||||||
|
|
||||||
|
number = 0
|
||||||
for dist in results:
|
for dist in results:
|
||||||
print('%s %s at %s' % (dist.name, dist.metadata['version'], dist.path))
|
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)
|
@action_help(search_usage)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue