From b2fb656dc0a2877bd0d8434b2fb15a8f2629fe21 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Thu, 24 Feb 2022 10:01:19 -0300 Subject: [PATCH] [arch] improvement: displaying 'description' and 'version' as primary fields for repository packages (info) --- CHANGELOG.md | 4 +++- bauh/gems/arch/controller.py | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f83177e..4323cd8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - Arch - - info dialog: displaying the "executable" field if the package is recognized as an application + - info dialog: + - displaying the "executable" field if the package is recognized as an application + - displaying "description" and "version" as primary fields for repository packages - removing the "%U" parameter before launching applications to prevent error messages - minor code refactoring diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index a321560b..0d380b4c 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -1557,6 +1557,13 @@ class ArchManager(SoftwareManager): if pkg.installed: info['installed files'] = pacman.list_installed_files(pkg.name) + for attr in ('version', 'description'): + val = info.get(attr) + + if val is not None: + info[f'03_{attr}'] = val + del info[attr] + return info def get_info(self, pkg: ArchPackage) -> dict: