diff --git a/bauh/gems/arch/pacman.py b/bauh/gems/arch/pacman.py index 68691a4b..697f6df6 100644 --- a/bauh/gems/arch/pacman.py +++ b/bauh/gems/arch/pacman.py @@ -3,6 +3,8 @@ from typing import List, Set from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess +RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]') + def is_enabled() -> bool: try: @@ -48,12 +50,15 @@ def get_info_dict(pkg_name: str) -> dict: if info_list: info_dict = {} for info_data in info_list: - attr = info_data[0].lower() + attr = info_data[0].lower().strip() info_dict[attr] = info_data[1] if '\n' not in info_data[1] else ' '.join([l.strip() for l in info_data[1].split('\n')]) if info_dict[attr] == 'None': info_dict[attr] = None + if attr == 'optional deps' and info_dict[attr]: + info_dict[attr] = RE_DEPS.findall(info_dict[attr]) + return info_dict diff --git a/bauh/view/qt/info.py b/bauh/view/qt/info.py index fdffc597..13893064 100644 --- a/bauh/view/qt/info.py +++ b/bauh/view/qt/info.py @@ -48,7 +48,12 @@ class InfoDialog(QDialog): for idx, attr in enumerate(sorted(app.keys())): if attr not in IGNORED_ATTRS and app[attr]: i18n_key = app['__app__'].model.get_type() + '.info.' + attr.lower() - val = str(app[attr]).strip() + + if isinstance(app[attr], list): + val = '\n'.join([str(e) for e in app[attr]]) + else: + val = str(app[attr]).strip() + full_val = None i18n_val = locale_keys.get('{}.{}'.format(i18n_key, val.lower()))