2024-11-27 16:50:48 +01:00
|
|
|
"""
|
|
|
|
|
Silique (https://www.silique.fr)
|
2025-02-10 09:54:59 +01:00
|
|
|
Copyright (C) 2024-2025
|
2024-11-27 16:50:48 +01:00
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify it
|
|
|
|
|
under the terms of the GNU Lesser General Public License as published by the
|
|
|
|
|
Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
|
|
|
|
details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
2025-05-08 21:30:51 +02:00
|
|
|
from .i18n import _
|
|
|
|
|
|
2024-11-27 16:50:48 +01:00
|
|
|
|
|
|
|
|
def get_rougail_config(
|
|
|
|
|
*,
|
|
|
|
|
backward_compatibility=True,
|
|
|
|
|
) -> dict:
|
2025-05-08 21:30:51 +02:00
|
|
|
options = f"""
|
2024-11-27 16:50:48 +01:00
|
|
|
console:
|
2025-09-30 21:58:58 +02:00
|
|
|
description: {_('Configuration for rougail-console')}
|
2024-11-27 16:50:48 +01:00
|
|
|
disabled:
|
|
|
|
|
jinja: |
|
2025-05-08 21:30:51 +02:00
|
|
|
{{% if step.output is propertyerror or step.output != 'console' %}}
|
2024-11-27 16:50:48 +01:00
|
|
|
disabled
|
2025-05-08 21:30:51 +02:00
|
|
|
{{% endif %}}
|
|
|
|
|
|
|
|
|
|
show_secrets: false # {_('Show secrets instead of obscuring them')}
|
2025-04-01 21:08:44 +02:00
|
|
|
|
2025-09-29 10:47:37 +02:00
|
|
|
mandatory:
|
2025-10-05 21:36:16 +02:00
|
|
|
description: {_('test mandatories variables before display in console')}
|
2025-09-29 10:47:37 +02:00
|
|
|
type: boolean
|
|
|
|
|
default:
|
|
|
|
|
jinja: |-
|
|
|
|
|
{{% if cli.read_write is defined and cli.read_write %}}
|
|
|
|
|
false
|
|
|
|
|
{{% else %}}
|
|
|
|
|
true
|
|
|
|
|
{{% endif %}}
|
2025-04-01 21:08:44 +02:00
|
|
|
|
2025-05-08 21:30:51 +02:00
|
|
|
key_is_description: true # {_("In tree the key is the family or variable description inside of it's name")}
|
2025-11-21 08:08:17 +01:00
|
|
|
|
|
|
|
|
undocumented_modes:
|
|
|
|
|
description: {_('Variables with those modes are not documented')}
|
|
|
|
|
multi: true
|
|
|
|
|
mandatory: false
|
|
|
|
|
disabled:
|
|
|
|
|
jinja: |
|
|
|
|
|
{{% if not modes_level %}}
|
|
|
|
|
there is no mode
|
|
|
|
|
{{% endif %}}
|
|
|
|
|
description: {_('disabled when there is no mode available')}
|
|
|
|
|
validators:
|
|
|
|
|
- jinja: |
|
|
|
|
|
{{% if _.undocumented_modes not in modes_level %}}
|
|
|
|
|
this mode is not available
|
|
|
|
|
{{% endif %}}
|
|
|
|
|
description: {_('verify if disable modes already exists')}
|
2024-11-27 16:50:48 +01:00
|
|
|
"""
|
|
|
|
|
return {
|
|
|
|
|
"name": "console",
|
|
|
|
|
"process": "output",
|
|
|
|
|
"options": options,
|
|
|
|
|
"level": 40,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ("get_rougail_config",)
|