Compare commits
2 commits
5ce01380bf
...
636cd59e7a
| Author | SHA1 | Date | |
|---|---|---|---|
| 636cd59e7a | |||
| 0500688079 |
6 changed files with 64 additions and 3 deletions
|
|
@ -1,3 +1,9 @@
|
|||
## 0.2.0a33 (2025-11-21)
|
||||
|
||||
### Feat
|
||||
|
||||
- add inaccessible_read_write_modes and inaccessible_modes options
|
||||
|
||||
## 0.2.0a32 (2025-11-08)
|
||||
|
||||
### Fix
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail.cli"
|
||||
version = "0.2.0a32"
|
||||
version = "0.2.0a33"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "CLI for Rougail"
|
||||
|
|
|
|||
|
|
@ -175,6 +175,29 @@ def load_user_datas(rougailconfig):
|
|||
rougail = Rougail(rougailconfig)
|
||||
layer_name = "_".join(layers[-1])
|
||||
subconfig = rougail.run(name=layer_name)
|
||||
try:
|
||||
read_write = set()
|
||||
read_only = set()
|
||||
if rougailconfig["cli.inaccessible_read_write_modes"]:
|
||||
read_write = set(rougailconfig["cli.inaccessible_read_write_modes"])
|
||||
if rougailconfig["cli.inaccessible_modes"]:
|
||||
read_only = set(rougailconfig["cli.inaccessible_modes"])
|
||||
read_write |= read_only
|
||||
if read_write:
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_write", "append") | read_write), "read_write", "append"
|
||||
)
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
|
||||
)
|
||||
subconfig.property.read_write()
|
||||
if read_only:
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_only", "append") | read_only), "read_only", "append"
|
||||
)
|
||||
subconfig.property.read_write()
|
||||
except:
|
||||
pass
|
||||
metaconfig = subconfig
|
||||
if last_layers:
|
||||
for layer in layers[:-1]:
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.2.0a32"
|
||||
__version__ = "0.2.0a33"
|
||||
|
|
|
|||
|
|
@ -58,6 +58,38 @@ cli:
|
|||
hidden: true
|
||||
|
||||
read_write: false # {_('Configuration in output step is in read_write mode')}
|
||||
|
||||
inaccessible_read_write_modes:
|
||||
description: {_('Modes that should not be accessible in read_write mode')}
|
||||
multi: true
|
||||
mandatory: false
|
||||
disabled:
|
||||
jinja: |
|
||||
{{% if not modes_level %}}
|
||||
No mode
|
||||
{{% endif %}}
|
||||
validators:
|
||||
- type: jinja
|
||||
jinja: |
|
||||
{{% if _.inaccessible_read_write_modes not in modes_level %}}
|
||||
not in modes_level ({{modes_level}})
|
||||
{{% endif %}}
|
||||
|
||||
inaccessible_modes:
|
||||
description: {_('Modes that should not be accessible')}
|
||||
multi: true
|
||||
mandatory: false
|
||||
disabled:
|
||||
jinja: |
|
||||
{{% if not modes_level %}}
|
||||
No mode
|
||||
{{% endif %}}
|
||||
validators:
|
||||
- type: jinja
|
||||
jinja: |
|
||||
{{% if _.inaccessible_modes not in modes_level %}}
|
||||
not in modes_level ({{modes_level}})
|
||||
{{% endif %}}
|
||||
"""
|
||||
return {
|
||||
"options": options,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
"[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| \n\n**my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | \nA description. +\n**Default**: my_value \n|====\n\n"
|
||||
"[cols=\"1a,1a\"]\n|====\n| Variable | Description \n| **my_variable** +\n`https://rougail.readthedocs.io/en/latest/variable.html#variables-types[string]` `mandatory` | A description. +\n**Default**: my_value \n|====\n\n"
|
||||
Loading…
Reference in a new issue