From 07cd4e46d2a482467b244926e525c51adcc32b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Sun, 21 Mar 2010 22:35:15 +0000 Subject: [PATCH] cli/install: Make package lists more readable and colorize messages --- pisi/operations/install.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pisi/operations/install.py b/pisi/operations/install.py index 29973e2a..93270c65 100644 --- a/pisi/operations/install.py +++ b/pisi/operations/install.py @@ -45,8 +45,9 @@ def install_pkg_names(A, reinstall = False): Ap = set(filter(lambda x: not installdb.has_package(x), A)) d = A - Ap if len(d) > 0: - ctx.ui.warning(_("The following package(s) are already installed and are not going to be installed again:\n") + - util.strlist(d)) + ctx.ui.warning(_("The following package(s) are already installed " + "and are not going to be installed again:")) + ctx.ui.info(util.format_by_columns(sorted(d))) A = Ap if len(A)==0: @@ -68,8 +69,8 @@ def install_pkg_names(A, reinstall = False): order = operations.helper.reorder_base_packages(order) if len(order) > 1: - ctx.ui.info(_("Following packages will be installed in the respective " - "order to satisfy dependencies:\n") + util.strlist(order)) + ctx.ui.info(util.colorize(_("Following packages will be installed:"), "brightblue")) + ctx.ui.info(util.format_by_columns(sorted(order))) total_size, cached_size = operations.helper.calculate_download_sizes(order) total_size, symbol = util.human_readable_size(total_size) @@ -131,8 +132,9 @@ def install_pkg_files(package_URIs, reinstall = False): else: tobe_installed.append(x) if already_installed: - ctx.ui.warning(_("The following package(s) are already installed and are not going to be installed again:\n") + - util.strlist(already_installed)) + ctx.ui.warning(_("The following package(s) are already installed " + "and are not going to be installed again:")) + ctx.ui.info(util.format_by_columns(sorted(already_installed))) package_URIs = tobe_installed if ctx.config.get_option('ignore_dependency'): @@ -193,9 +195,9 @@ def install_pkg_files(package_URIs, reinstall = False): # if so, then invoke install_pkg_names extra_packages = [x.package for x in dep_unsatis] if extra_packages: - ctx.ui.info(_("""The following packages will be installed -in the respective order to satisfy extra dependencies: -""") + util.strlist(extra_packages)) + ctx.ui.warning(_("The following packages will be installed " + "in order to satisfy dependencies:")) + ctx.ui.info(util.format_by_columns(sorted(extra_packages))) if not ctx.ui.confirm(_('Do you want to continue?')): raise Exception(_('External dependencies not satisfied')) install_pkg_names(extra_packages, reinstall=True)