@@ -52,31 +52,33 @@ def __init__(self, *args, **kw):
52
52
53
53
self .parser .insert_option_group (0 , cmd_opts )
54
54
55
- def run (self , options , packages_queried ):
56
- if not packages_queried :
55
+ def run (self , options , args ):
56
+ if not args :
57
57
logger .warning ('ERROR: Please provide a package name or names.' )
58
58
return ERROR
59
+
59
60
format_options = {
60
61
'json' : print_json ,
61
62
'header' : print_header_format ,
62
63
}
63
64
64
65
print_with_format = format_options [options .format_choice ]
65
66
66
- print_distributions (packages_queried , options , print_with_format )
67
+ print_distributions (args , list_files = options .files ,
68
+ verbose = options .verbose ,
69
+ print_with_format = print_with_format )
67
70
68
71
69
- def print_distributions (packages , options , print_with_format ):
72
+ def print_distributions (packages , list_files , verbose , print_with_format ):
70
73
"""
71
- Gather information for all installed distributions and print the
74
+ Gather information for all installed packages and print the
72
75
information in either header (default) format or json format.
73
76
"""
74
77
distributions = search_packages_info (packages )
75
78
info = []
76
79
77
80
for dist in distributions :
78
- package_info = get_package_info (dist , list_files = options .files ,
79
- verbose = options .verbose )
81
+ package_info = get_package_info (dist , list_files , verbose )
80
82
info .append (OrderedDict (package_info ))
81
83
82
84
if not info :
0 commit comments