Little refactory.

This commit is contained in:
Rafael Caricio 2012-09-07 18:18:48 -04:00
parent 16f76e24bd
commit 63459a2707
1 changed files with 3 additions and 3 deletions

View File

@ -21,6 +21,7 @@ class StatusCommand(Command):
results = search_packages_info(query)
print_results(results)
def search_packages_info(query):
"""
Gather details from installed distributions. Print distribution name,
@ -59,9 +60,8 @@ def print_results(distributions):
logger.notify("Version: %s" % dist['version'])
logger.notify("Location: %s" % dist['location'])
logger.notify("Files:")
filelist = dist.get('files', None)
if filelist:
for i, line in enumerate(open(filelist)):
if 'files' in dist:
for i, line in enumerate(open(dist['files'])):
logger.notify(" %s" % line.strip())
if i > 20:
logger.notify(" and more.")