Compare commits
3 commits
a29a14d3f3
...
06bd8f207d
| Author | SHA1 | Date | |
|---|---|---|---|
| 06bd8f207d | |||
| 008a9fbc3d | |||
| a8f8c35bdc |
6 changed files with 58 additions and 38 deletions
|
|
@ -1,3 +1,10 @@
|
|||
## 0.2.0a3 (2025-02-17)
|
||||
|
||||
### Fix
|
||||
|
||||
- do not display default value with default_value_makes_sense set to False
|
||||
- translate ERRORS
|
||||
|
||||
## 0.2.0a2 (2025-02-10)
|
||||
|
||||
### Feat
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"POT-Creation-Date: 2024-11-01 11:03+0100\n"
|
||||
"PO-Revision-Date: 2024-11-01 11:04+0100\n"
|
||||
"POT-Creation-Date: 2025-02-15 18:38+0100\n"
|
||||
"PO-Revision-Date: 2025-02-15 18:39+0100\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
|
|
@ -16,42 +16,46 @@ msgstr ""
|
|||
"Generated-By: pygettext.py 1.5\n"
|
||||
"X-Generator: Poedit 3.5\n"
|
||||
|
||||
#: src/rougail/output_exporter/__init__.py:73
|
||||
#: src/rougail/output_console/__init__.py:88
|
||||
msgid "The following variables are mandatory but have no value:"
|
||||
msgstr "Les variables suiveuses sont obligatoire mais n'ont pas de valeur :"
|
||||
|
||||
#: src/rougail/output_exporter/__init__.py:84
|
||||
#: src/rougail/output_console/__init__.py:99
|
||||
msgid "The following variables are inaccessible but are empty and mandatory :"
|
||||
msgstr "Les variables suiveuses sont inaccessibles mais sont vides et obligatoires :"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:53
|
||||
#: src/rougail/output_console/__init__.py:182
|
||||
msgid "Undocumented variable"
|
||||
msgstr "Variable non documentée"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:54
|
||||
#: src/rougail/output_console/__init__.py:183
|
||||
msgid "Undocumented but modified variable"
|
||||
msgstr "Variable non documentée mais modifiée"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:57
|
||||
#: src/rougail/output_console/__init__.py:186
|
||||
msgid "Unmodifiable variable"
|
||||
msgstr "Variable non modifiable"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:61
|
||||
#: src/rougail/output_console/__init__.py:190
|
||||
msgid "Default value"
|
||||
msgstr "Valeur par défaut"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:62
|
||||
#: src/rougail/output_console/__init__.py:191
|
||||
msgid "Modified value"
|
||||
msgstr "Valeur modifiée"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:63
|
||||
#: src/rougail/output_console/__init__.py:192
|
||||
msgid "Original default value"
|
||||
msgstr "Valeur par défaut d'origine"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:67
|
||||
#: src/rougail/output_console/__init__.py:196
|
||||
msgid "Caption"
|
||||
msgstr "Légende"
|
||||
|
||||
#: src/rougail/output_exporter/output/console.py:92
|
||||
#: src/rougail/output_console/__init__.py:203
|
||||
msgid "ERRORS"
|
||||
msgstr "ERREURS"
|
||||
|
||||
#: src/rougail/output_console/__init__.py:223
|
||||
msgid "Variables:"
|
||||
msgstr "Variables :"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2024-11-27 16:46+0100\n"
|
||||
"POT-Creation-Date: 2025-02-15 18:39+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -15,43 +15,47 @@ msgstr ""
|
|||
"Generated-By: pygettext.py 1.5\n"
|
||||
|
||||
|
||||
#: src/rougail/output_console/__init__.py:82
|
||||
#: src/rougail/output_console/__init__.py:88
|
||||
msgid "The following variables are mandatory but have no value:"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:93
|
||||
#: src/rougail/output_console/__init__.py:99
|
||||
msgid "The following variables are inaccessible but are empty and mandatory :"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:170
|
||||
#: src/rougail/output_console/__init__.py:182
|
||||
msgid "Undocumented variable"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:171
|
||||
#: src/rougail/output_console/__init__.py:183
|
||||
msgid "Undocumented but modified variable"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:174
|
||||
#: src/rougail/output_console/__init__.py:186
|
||||
msgid "Unmodifiable variable"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:178
|
||||
#: src/rougail/output_console/__init__.py:190
|
||||
msgid "Default value"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:179
|
||||
#: src/rougail/output_console/__init__.py:191
|
||||
msgid "Modified value"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:180
|
||||
#: src/rougail/output_console/__init__.py:192
|
||||
msgid "Original default value"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:184
|
||||
#: src/rougail/output_console/__init__.py:196
|
||||
msgid "Caption"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:209
|
||||
#: src/rougail/output_console/__init__.py:203
|
||||
msgid "ERRORS"
|
||||
msgstr ""
|
||||
|
||||
#: src/rougail/output_console/__init__.py:223
|
||||
msgid "Variables:"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail.output_console"
|
||||
version = "0.2.0a2"
|
||||
version = "0.2.0a3"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "Rougail output console"
|
||||
|
|
|
|||
|
|
@ -76,6 +76,9 @@ class RougailOutputConsole:
|
|||
except (ConfigError, PropertiesOptionError) as err:
|
||||
self.errors.append(f"Error in config: {err}")
|
||||
return
|
||||
except ValueError as err:
|
||||
self.errors.append(str(err))
|
||||
return
|
||||
for option in mandatories:
|
||||
try:
|
||||
option.value.get()
|
||||
|
|
@ -109,7 +112,6 @@ class RougailOutputConsole:
|
|||
errors = self.user_data_errors + self.errors
|
||||
if errors:
|
||||
self.display_errors(errors)
|
||||
if self.errors:
|
||||
return False
|
||||
warnings = self.user_data_warnings + self.warnings
|
||||
if warnings:
|
||||
|
|
@ -198,7 +200,7 @@ class RougailOutputConsole:
|
|||
errors,
|
||||
) -> None:
|
||||
tree = Tree(
|
||||
":stop_sign: ERRORS",
|
||||
f":stop_sign: {_('ERRORS')}",
|
||||
guide_style="bold bright_red",
|
||||
)
|
||||
for error in errors:
|
||||
|
|
@ -297,18 +299,21 @@ class OutputFamily:
|
|||
elif "advanced" in properties:
|
||||
variable_color = self.root.variable_advanced_and_modified_color
|
||||
color = None
|
||||
try:
|
||||
default_value = option.value.default()
|
||||
except ConfigError:
|
||||
if option.ismulti():
|
||||
default_value = []
|
||||
else:
|
||||
default_value = None
|
||||
if leader_index is not None:
|
||||
if len(default_value) > leader_index:
|
||||
default_value = default_value[leader_index]
|
||||
else:
|
||||
default_value = None
|
||||
if option.information.get("default_value_makes_sense", True):
|
||||
try:
|
||||
default_value = option.value.default()
|
||||
except ConfigError:
|
||||
if option.ismulti():
|
||||
default_value = []
|
||||
else:
|
||||
default_value = None
|
||||
if leader_index is not None:
|
||||
if len(default_value) > leader_index:
|
||||
default_value = default_value[leader_index]
|
||||
else:
|
||||
default_value = None
|
||||
else:
|
||||
default_value = None
|
||||
if value is undefined:
|
||||
value = option.value.get()
|
||||
key = self.colorize(
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue