packages: updated package details with location info.

This commit is contained in:
Marcin Kuzminski 2020-05-19 12:24:38 +02:00
parent 159aca46c7
commit ddd8fcad75
3 changed files with 17 additions and 9 deletions

View file

@ -143,8 +143,9 @@ def python_info():
def py_modules():
mods = dict([(p.project_name, p.version)
mods = dict([(p.project_name, {'version': p.version, 'location': p.location})
for p in pkg_resources.working_set])
value = sorted(mods.items(), key=lambda k: k[0].lower())
return SysInfoRes(value=value)

View file

@ -46,12 +46,19 @@
<h3 class="panel-title">${_('Python Packages')}</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal settings dt-400">
% for dt, dd in c.py_modules['human_value']:
<dt>${dt}${':' if dt else '---'}</dt>
<dd>${dd}${'' if dt else '---'}</dd>
% endfor
</dl>
<table>
<th></th>
<th></th>
<th></th>
% for name, package_data in c.py_modules['human_value']:
<tr>
<td>${name.lower()}</td>
<td>${package_data['version']}</td>
<td>(${package_data['location']})</td>
</tr>
% endfor
</table>
</div>
</div>

View file

@ -40,8 +40,8 @@ ${value}
PYTHON PACKAGES
---------------
% for key, value in c.py_modules['human_value']:
${'{:<60}'.format(key)}: ${value}
% for name, package_data in c.py_modules['human_value']:
${'{:<60}'.format(name)}: ${'{:<20}'.format(package_data['version'])} (${package_data['location']})
% endfor
</pre>