From 8b717bfa697887c567b9081c6dec6631b778eebe Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 19 Jun 2022 17:50:36 +0300 Subject: [PATCH] Fixed messages --- slpkg/views/views.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/slpkg/views/views.py b/slpkg/views/views.py index 902b54f5..21daa5fa 100644 --- a/slpkg/views/views.py +++ b/slpkg/views/views.py @@ -25,6 +25,8 @@ class ViewMessage: version = SBoQueries(sbo).version() self._view_build(sbo, version) + self._view_total(slackbuilds, dependencies, method='build') + def install_packages(self, slackbuilds: list, dependencies: list): print('The following packages will be installed or upgraded:\n') @@ -38,12 +40,15 @@ class ViewMessage: version = SBoQueries(sbo).version() self._view_install(sbo, version) - self._view_total(slackbuilds, dependencies) + self._view_total(slackbuilds, dependencies, method='install') def _view_build(self, sbo: str, version: str): color = self.colors() if self.utils.is_installed(f'{sbo}-{version}-'): + print(f'[{color["YELLOW"]} build {color["ENDC"]}] -> ' + f'{sbo}-{version}') + else: print(f'[{color["CYAN"]} build {color["ENDC"]}] -> ' f'{sbo}-{version}') @@ -57,7 +62,7 @@ class ViewMessage: print(f'[{color["CYAN"]} install {color["ENDC"]}] -> ' f'{sbo}-{version}') - def _view_total(self, slackbuilds: list, dependencies: list): + def _view_total(self, slackbuilds: list, dependencies: list, method): color = self.colors() slackbuilds.extend(dependencies) @@ -70,8 +75,12 @@ class ViewMessage: else: installed += 1 - print(f'\n{color["GREY"]}Total {installed} will be installed and ' - f'{upgraded} will be upgraded.{color["ENDC"]}') + if method == 'install': + print(f'\n{color["GREY"]}Total {installed} will be installed and ' + f'{upgraded} will be upgraded.{color["ENDC"]}') + else: + print(f'\n{color["GREY"]}Total {installed + upgraded} packages ' + f'will be build.{color["ENDC"]}') def remove_packages(self): print('The following packages will be removed:\n')