From 8ac603100d9d1516db79d9ec5f2bfeafcfa194d1 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Tue, 5 Nov 2024 08:31:46 +0100 Subject: [PATCH] fix: better user information if a needed package is not installed --- src/rougail/config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rougail/config.py b/src/rougail/config.py index e7cd3e10c..a92486c96 100644 --- a/src/rougail/config.py +++ b/src/rougail/config.py @@ -403,7 +403,7 @@ suffix: disabled: variable: upgrade""" for process in processes: - if processes[process] or process == "output": + if processes[process]: objects = processes[process] rougail_process += """ {NAME}: @@ -443,14 +443,22 @@ suffix: DEFAULT=objects[0]["name"] ) else: + if process == 'output': + prop = 'hidden' + else: + prop = 'disabled' rougail_process += """ {NAME}: description: Select for {NAME} - hidden: true mandatory: false + {PROP}: true multi: true + default: ["You haven't installed \\\"{NAME}\\\" package for rougail"] + validators: + - jinja: Please install a rougail-{NAME}-* package. """.format( NAME=normalize_family(process), + PROP=prop, ) rougail_options += rougail_process convert = FakeRougailConvert(add_extra_options)