from .app import PpApplication
-__version__ = '0.6.1'
+__version__ = '0.6.2'
LOG = logging.getLogger(__name__)
title_base = 'Modul'
title_name = 'Name komplett'
title_vendor = 'Vendor'
+ title_uversion = "Upstream Version"
title_version = 'Version'
len_base = len(title_base)
len_name = len(title_name)
len_vendor = len(title_vendor)
+ len_uversion = len(title_uversion)
len_version = len(title_version)
for b_name in self.modules.keys():
if module_info['vendor']:
if len(module_info['vendor']) > len_vendor:
len_vendor = len(module_info['vendor'])
+ if module_info['upstream_version']:
+ if len(module_info['upstream_version']) > len_uversion:
+ len_uversion = len(module_info['upstream_version'])
if module_info['version']:
if len(module_info['version']) > len_version:
len_version = len(module_info['version'])
- template = (
- '{{base:<{lb}}} {{name:<{ln}}} {{vendor:<{lven}}} {{version:<{lver}}}'.format(
- lb=len_base, ln=len_name, lven=len_vendor, lver=len_version))
- len_total = len_base + len_name + len_vendor + len_version + 10
+ template = ((
+ '{{base:<{lb}}} {{name:<{ln}}} {{vendor:<{lven}}} '
+ '{{uversion:<{luver}}} {{version:<{lver}}}').format(
+ lb=len_base, ln=len_name, lven=len_vendor,
+ luver=len_uversion, lver=len_version))
+ len_total = len_base + len_name + len_vendor + len_uversion + len_version + 12
if self.verbose > 1:
LOG.debug("Module line template: {!r}".format(template))
print()
print(template.format(
- base=title_base, name=title_name, vendor=title_vendor, version=title_version))
+ base=title_base, name=title_name, vendor=title_vendor,
+ uversion=title_uversion, version=title_version))
print('=' * len_total)
for b_name in sorted(self.modules.keys(), key=str.lower):
if module_info['vendor']:
vendor_name = module_info['vendor']
+ uver = '~'
+ if module_info['upstream_version']:
+ uver = module_info['upstream_version']
+
version = '~'
if module_info['version']:
version = module_info['version']
print(template.format(
- base=base_name, name=mod_name, vendor=vendor_name, version=version))
+ base=base_name, name=mod_name, vendor=vendor_name,
+ uversion=uver, version=version))
print()
self.modules[base_name] = module_info
upstream_version = self.get_upstream_version(module_info)
self.modules[base_name]['upstream_version'] = upstream_version
+ if not self.verbose:
+ if upstream_version:
+ print('.', end='', flush=True)
+ else:
+ print('~', end='', flush=True)
+ else:
+ print('!', end='', flush=True)
+ if not self.verbose:
+ print()
if self.verbose > 2:
LOG.debug("Found module information:\n{}".format(pp(self.modules)))