fix: error format

This commit is contained in:
egarette@silique.fr 2025-10-16 08:16:11 +02:00
parent 1ef52a2e07
commit 7733d6240f

View file

@ -105,17 +105,11 @@ class RougailOutputConsole:
else: else:
current_options.setdefault(None, []).append(description) current_options.setdefault(None, []).append(description)
if options: if options:
self.errors.append( self.errors.append({_("The following variables are mandatory but have no value:"): options})
_("The following variables are mandatory but have no value:")
)
self.errors.append(options)
elif options_with_error: elif options_with_error:
self.errors.append( self.errors.append({_(
_(
"The following variables are inaccessible but are empty and mandatory:" "The following variables are inaccessible but are empty and mandatory:"
) ): self.errors.append([option.description() for option in options_with_error])})
)
self.errors.append([option.description() for option in options_with_error])
def exporter(self) -> bool: def exporter(self) -> bool:
if self.is_mandatory: if self.is_mandatory:
@ -225,9 +219,8 @@ class RougailOutputConsole:
f"[bold][bright_red]:stop_sign: {_('ERRORS')}[/bright_red][/bold]", f"[bold][bright_red]:stop_sign: {_('ERRORS')}[/bright_red][/bold]",
guide_style="bold bright_red", guide_style="bold bright_red",
) )
sub_tree = tree
for error in errors: for error in errors:
sub_tree = self.display_error(sub_tree, error) self.display_error(tree, error)
self.out.append(tree) self.out.append(tree)
def display_error(self, tree, error): def display_error(self, tree, error):