Compare commits
No commits in common. "92df0ec569ae9ab42a538ee15c4c4ef4e16f9b72" and "f6e08b4ebf925b8270d66fac4f317e1a3b66d5b9" have entirely different histories.
92df0ec569
...
f6e08b4ebf
19 changed files with 107 additions and 139 deletions
|
|
@ -1,9 +1,3 @@
|
|||
## 0.2.0a44 (2026-05-04)
|
||||
|
||||
### Feat
|
||||
|
||||
- multi layers
|
||||
|
||||
## 0.2.0a43 (2026-03-26)
|
||||
|
||||
### Feat
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
|||
|
||||
[project]
|
||||
name = "rougail.cli"
|
||||
version = "0.2.0a44"
|
||||
version = "0.2.0a43"
|
||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||
readme = "README.md"
|
||||
description = "CLI for Rougail"
|
||||
|
|
|
|||
|
|
@ -83,7 +83,6 @@ def _main(arguments, do_not_print):
|
|||
def load_cmd_user_data(rougailconfig, arguments):
|
||||
rougailconfig.generate_config()
|
||||
cmd_config = rougailconfig.config
|
||||
cmd_config.information.set("description_type", "path_and_description")
|
||||
origin_prop = cmd_config.property.default("read_write", "append")
|
||||
cmd_config.property.setdefault(
|
||||
frozenset(origin_prop | {"not_for_commandline"}), "read_write", "append"
|
||||
|
|
@ -112,7 +111,7 @@ def load_cmd_user_data(rougailconfig, arguments):
|
|||
if isinstance(warning, dict):
|
||||
for w, var in warning.items():
|
||||
if var:
|
||||
warn(UserWarning(_('unable to load {0}, {1}').format(var.option.impl_get_display_name(var, with_quote=True), w)))
|
||||
warn(UserWarning(f'unable to load "{var.option.impl_get_display_name(var)}", {str(w)}'))
|
||||
else:
|
||||
warn(w)
|
||||
else:
|
||||
|
|
@ -178,25 +177,27 @@ def manage_warnings(warnings):
|
|||
|
||||
|
||||
def load_user_data(rougailconfig):
|
||||
layer_datas = []
|
||||
layer_datas = {}
|
||||
if not rougailconfig["cli.load_config"]:
|
||||
return None, None, None, {"errors": [], "warnings": []}
|
||||
try:
|
||||
user_data_names = rougailconfig["step.user_data"]
|
||||
except PropertiesOptionError:
|
||||
user_data_names = []
|
||||
has_layers = rougailconfig["cli.layers"]
|
||||
if has_layers:
|
||||
layers = [[ud] for ud in user_data_names]
|
||||
last_layers = len(layers) - 1
|
||||
else:
|
||||
layers = [user_data_names]
|
||||
last_layers = 0
|
||||
if rougailconfig["tiramisu_cache"]:
|
||||
load_from_tiramisu_cache = rougailconfig["cli.load_from_tiramisu_cache"]
|
||||
else:
|
||||
load_from_tiramisu_cache = False
|
||||
rougail = Rougail(rougailconfig, load_from_tiramisu_cache=load_from_tiramisu_cache)
|
||||
has_layers = rougailconfig["cli.layers"]
|
||||
last_layers = len(user_data_names) - 1
|
||||
if has_layers and user_data_names:
|
||||
layer_name = user_data_names[-1]
|
||||
else:
|
||||
layer_name = None
|
||||
subconfig = metaconfig = rougail.run(name=layer_name)
|
||||
layer_name = "_".join(layers[-1])
|
||||
subconfig = rougail.run(name=layer_name)
|
||||
try:
|
||||
read_write = set()
|
||||
read_only = set()
|
||||
|
|
@ -209,112 +210,87 @@ def load_user_data(rougailconfig):
|
|||
read_only |= modes
|
||||
read_write |= modes
|
||||
if read_write:
|
||||
metaconfig.property.setdefault(
|
||||
frozenset(metaconfig.property.default("read_write", "append") | read_write), "read_write", "append"
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_write", "append") | read_write), "read_write", "append"
|
||||
)
|
||||
metaconfig.property.setdefault(
|
||||
frozenset(metaconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_only", "remove") | (read_write - read_only)), "read_only", "remove"
|
||||
)
|
||||
for p in read_write:
|
||||
metaconfig.permissive.add(p)
|
||||
subconfig.permissive.add(p)
|
||||
if read_only:
|
||||
metaconfig.property.setdefault(
|
||||
frozenset(metaconfig.property.default("read_only", "append") | read_only), "read_only", "append"
|
||||
subconfig.property.setdefault(
|
||||
frozenset(subconfig.property.default("read_only", "append") | read_only), "read_only", "append"
|
||||
)
|
||||
for p in read_only:
|
||||
metaconfig.permissive.add(p)
|
||||
subconfig.permissive.add(p)
|
||||
if read_write or read_only:
|
||||
metaconfig.property.read_write()
|
||||
subconfig.property.read_write()
|
||||
except:
|
||||
pass
|
||||
metaconfig.information.set("description_type", rougailconfig["cli.description_type"])
|
||||
rougail_user_datas = {}
|
||||
interactive_user_datas = {}
|
||||
for ud_idx, user_data_name in enumerate(reversed(user_data_names)):
|
||||
path = (
|
||||
Path(__file__).parent.parent
|
||||
/ ("user_data_" + user_data_name)
|
||||
/ "__init__.py"
|
||||
)
|
||||
if not path.is_file():
|
||||
raise Exception(
|
||||
_('cannot find "user_data" module "{0}"').format(user_data_name)
|
||||
)
|
||||
module = load_modules("rougail.user_data_" + user_data_name, str(path))
|
||||
rougail_user_data = module.RougailUserData
|
||||
has_several_layers = hasattr(rougail_user_data, 'has_several_layers') and rougail_user_data.has_several_layers
|
||||
if has_layers and has_several_layers:
|
||||
layers_len = rougail_user_data(None, rougailconfig=rougailconfig).count_layers()
|
||||
else:
|
||||
layers_len = 1
|
||||
for idx in range(layers_len):
|
||||
if ud_idx and has_layers:
|
||||
metaconfig = MetaConfig([metaconfig], name=user_data_name)
|
||||
if not idx:
|
||||
has_interactive_user_data = hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data
|
||||
if has_interactive_user_data:
|
||||
interactive_user_datas[user_data_name] = rougail_user_data
|
||||
else:
|
||||
if interactive_user_datas:
|
||||
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_datas), user_data_name))
|
||||
rougail_user_datas[user_data_name] = rougail_user_data
|
||||
root_metaconfig = metaconfig
|
||||
subconfig.information.set("description_type", rougailconfig["cli.description_type"])
|
||||
metaconfig = subconfig
|
||||
if last_layers:
|
||||
for layer in reversed(layers[:-1]):
|
||||
layer_name = "_".join(layer)
|
||||
metaconfig = MetaConfig([metaconfig], name=layer_name)
|
||||
metaconfig.owner.set(metaconfig.path())
|
||||
subconfig = metaconfig
|
||||
err_warn = {"errors": [], "warnings": []}
|
||||
invalid_user_data_error = rougailconfig["cli.invalid_user_data_error"]
|
||||
unknown_user_data_error = rougailconfig["cli.unknown_user_data_error"]
|
||||
user_datas = []
|
||||
for idx, user_data_name in enumerate(reversed(rougail_user_datas)):
|
||||
rougail_user_data = rougail_user_datas[user_data_name]
|
||||
if has_layers and idx:
|
||||
metaconfig = metaconfig.config(user_data_name)
|
||||
metaconfig.owner.set(metaconfig.path())
|
||||
for ud_idx, user_data in enumerate(rougail_user_data(
|
||||
interactive_user_data = {}
|
||||
for idx, layer in enumerate(layers):
|
||||
if idx:
|
||||
subconfig = subconfig.config("_".join(layer))
|
||||
subconfig.owner.set(subconfig.path())
|
||||
layer_name = subconfig.path()
|
||||
# data user
|
||||
user_data = []
|
||||
if has_layers:
|
||||
layer_datas[layer_name] = {}
|
||||
for user_data_name in layer:
|
||||
path = (
|
||||
Path(__file__).parent.parent
|
||||
/ ("user_data_" + user_data_name)
|
||||
/ "__init__.py"
|
||||
)
|
||||
if not path.is_file():
|
||||
raise Exception(
|
||||
_('cannot find "user_data" module "{0}"').format(user_data_name)
|
||||
)
|
||||
module = load_modules("rougail.user_data_" + user_data_name, str(path))
|
||||
rougail_user_data = module.RougailUserData
|
||||
if hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data:
|
||||
interactive_user_data.setdefault(layer_name, {})[user_data_name] = rougail_user_data
|
||||
continue
|
||||
elif interactive_user_data:
|
||||
raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_data), user_data_name))
|
||||
for ud in rougail_user_data(
|
||||
subconfig,
|
||||
rougailconfig=rougailconfig,
|
||||
).run()):
|
||||
if has_layers and ud_idx:
|
||||
metaconfig = metaconfig.config(user_data_name)
|
||||
metaconfig.owner.set(metaconfig.path())
|
||||
if has_layers:
|
||||
layer_datas.append(user_data["source"])
|
||||
new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||
for level, datas in new_err_warn.items():
|
||||
if datas:
|
||||
err_warn[level].extend(datas)
|
||||
else:
|
||||
user_datas.append(user_data)
|
||||
if user_datas and not has_layers:
|
||||
new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||
for level, datas in new_err_warn.items():
|
||||
if datas:
|
||||
err_warn[level].extend(datas)
|
||||
user_datas = []
|
||||
for idx, user_data_name in enumerate(reversed(interactive_user_datas)):
|
||||
rougail_user_data = interactive_user_datas[user_data_name]
|
||||
if has_layers and idx:
|
||||
metaconfig = metaconfig.config(user_data_name)
|
||||
metaconfig.owner.set(metaconfig.path())
|
||||
for ud_idx, user_data in enumerate(rougail_user_data(
|
||||
subconfig,
|
||||
rougailconfig=rougailconfig,
|
||||
).run()):
|
||||
if has_layers and ud_idx:
|
||||
metaconfig = metaconfig.config(user_data_name)
|
||||
metaconfig.owner.set(metaconfig.path())
|
||||
if has_layers:
|
||||
layer_datas.append(user_data["source"])
|
||||
new_err_warn = UserData(metaconfig).user_data([user_data], invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||
for level, datas in new_err_warn.items():
|
||||
if datas:
|
||||
err_warn[level].extend(datas)
|
||||
else:
|
||||
user_datas.append(user_data)
|
||||
if user_datas and not has_layers:
|
||||
new_err_warn = UserData(metaconfig).user_data(user_datas, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||
for level, datas in new_err_warn.items():
|
||||
if datas:
|
||||
err_warn[level].extend(datas)
|
||||
return layer_datas, root_metaconfig, subconfig, err_warn
|
||||
).run():
|
||||
if has_layers:
|
||||
layer_datas[layer_name].setdefault(user_data_name, []).append(ud["source"])
|
||||
user_data.append(ud)
|
||||
if user_data:
|
||||
new_err_warn = UserData(subconfig).user_data(user_data, invalid_user_data_error=invalid_user_data_error, unknown_user_data_error=unknown_user_data_error)
|
||||
for level, datas in new_err_warn.items():
|
||||
if datas:
|
||||
err_warn[level].extend(datas)
|
||||
for layer_name, interactive_user_data in interactive_user_data.items():
|
||||
for layer, rougail_user_data in interactive_user_data.items():
|
||||
if has_layers and len(layers) > 1:
|
||||
subconfig = subconfig.config("_".join(layer))
|
||||
subconfig.owner.set(subconfig.path())
|
||||
for user_data in rougail_user_data(
|
||||
subconfig,
|
||||
rougailconfig=rougailconfig,
|
||||
).run():
|
||||
if has_layers:
|
||||
layer_datas[layer_name].setdefault(user_data_name, []).append(user_data["source"])
|
||||
|
||||
return layer_datas, metaconfig, subconfig, err_warn
|
||||
|
||||
|
||||
def get_output(rougailconfig, metaconfig, config, err_warn, layer_datas):
|
||||
|
|
@ -352,5 +328,6 @@ def main(arguments=None, do_not_print=False):
|
|||
except Exception as err:
|
||||
if print_traceback:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
exit(_("ERROR: {0}").format(err))
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
__version__ = "0.2.0a44"
|
||||
__version__ = "0.2.0a43"
|
||||
|
|
|
|||
|
|
@ -2,14 +2,11 @@
|
|||
│ Variable [32mModified value[0m │
|
||||
│ (⏳ Original default value) │
|
||||
╰──────────────────────────────────────╯
|
||||
╭───────────── Layers ─────────────╮
|
||||
│ • environment variable │
|
||||
│ • the YAML file "yaml/file.yml" │
|
||||
│ • the YAML file "yaml/file2.yml" │
|
||||
│ • Bitwarden │
|
||||
╰──────────────────────────────────╯
|
||||
╭─────────── Layers ────────────╮
|
||||
│ environment variable │
|
||||
│ the YAML file "yaml/file.yml" │
|
||||
│ Bitwarden │
|
||||
╰───────────────────────────────╯
|
||||
Variables:
|
||||
[94m┗━━ [0m📓 a description: [32ma second yaml value[0m ◀ loaded from the YAML file
|
||||
[94m [0m"yaml/file2.yml" (⏳ a yaml value ◀ loaded from the YAML file
|
||||
[94m [0m"yaml/file.yml" ⏳ my env value ◀ loaded from environment variable ⏳
|
||||
[94m [0mmy_value)
|
||||
[94m┗━━ [0m📓 a description: [32ma yaml value[0m ◀ loaded from the YAML file "yaml/file.yml"
|
||||
[94m [0m(⏳ my env value ◀ loaded from environment variable ⏳ my_value)
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
my_variable: a second yaml value
|
||||
|
|
@ -1 +1 @@
|
|||
"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n"
|
||||
"\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503\u001b[1m \u001b[0m\u001b[1mVariable \u001b[0m\u001b[1m \u001b[0m\u2503\u001b[1m \u001b[0m\u001b[1mDescription \u001b[0m\u001b[1m \u001b[0m\u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 \u001b[1mmy_variable\u001b[0m \u2502 A description. \u2502\n\u2502 \u001b[1;7m string \u001b[0m \u001b[1;7m mandatory \u001b[0m \u2502 \u001b[1mDefault\u001b[0m: my_value \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"
|
||||
|
|
@ -1 +1 @@
|
|||
"[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|===="
|
||||
"[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"
|
||||
|
|
@ -1 +1 @@
|
|||
["unable to load \"s\" (Main namespace name), it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""]
|
||||
["unable to load \"Main namespace name\", it's a symlink option so we cannot set the value \"doc\", it will be ignored when loading from the YAML file \"symlink_rougailcli.yml\""]
|
||||
|
|
@ -1 +1 @@
|
|||
["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings.yml\""]
|
||||
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings.yml\""]
|
||||
|
|
@ -3,5 +3,5 @@ main_structural_directories:
|
|||
- structures
|
||||
doc:
|
||||
output_format: console
|
||||
bitwarden:
|
||||
mock_enable: true
|
||||
json:
|
||||
mandatory: true
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ main_structural_directories:
|
|||
- structures
|
||||
doc:
|
||||
output_format: console
|
||||
bitwarden:
|
||||
mock_enable: true
|
||||
json:
|
||||
mandatory: true
|
||||
cli:
|
||||
warnings: false
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings3.yml\""]
|
||||
["unable to load \"test mandatories variables before display in JSON\", family \"Export configuration to JSON format\" has property disabled, so cannot access to \"test mandatories variables before display in JSON\", it will be ignored when loading from the YAML file \"warnings3.yml\""]
|
||||
|
|
@ -4,5 +4,5 @@ main_structural_directories:
|
|||
- structures_warnings
|
||||
doc:
|
||||
output_format: console
|
||||
bitwarden:
|
||||
mock_enable: true
|
||||
json:
|
||||
mandatory: true
|
||||
|
|
|
|||
|
|
@ -4,5 +4,7 @@ main_structural_directories:
|
|||
- structures_warnings
|
||||
doc:
|
||||
output_format: console
|
||||
json:
|
||||
mandatory: true
|
||||
cli:
|
||||
warnings: false
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
||||
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||
|
|
@ -1 +1 @@
|
|||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
||||
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||
|
|
@ -1 +1 @@
|
|||
"{\n \"my_variable\": {\n \"path\": \"my_variable\",\n \"name\": \"my_variable\",\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\"\n }\n}"
|
||||
"{\n \"my_variable\": {\n \"type\": \"variable\",\n \"default\": {\n \"name\": \"Default\",\n \"values\": \"my_value\"\n },\n \"variable_type\": \"string\",\n \"path\": \"my_variable\",\n \"names\": [\n \"my_variable\"\n ],\n \"description\": \"A description.\",\n \"properties\": [\n {\n \"type\": \"property\",\n \"name\": \"mandatory\",\n \"ori_name\": \"mandatory\",\n \"access_control\": false\n }\n ],\n \"gen_examples\": [\n \"my_value\"\n ],\n \"mandatory_without_value\": false\n }\n}"
|
||||
|
|
@ -25,7 +25,7 @@ def test_cli():
|
|||
|
||||
def test_cli_boolean():
|
||||
with chdir(test_dir / 'cli'):
|
||||
ret = main(['--main_structural_directories', 'structures', '--cli.warnings'], do_not_print=True)
|
||||
ret = main(['--main_structural_directories', 'structures', '--display.mandatory'], do_not_print=True)
|
||||
filename = Path('result.txt')
|
||||
if not filename.is_file():
|
||||
with filename.open('w') as fh:
|
||||
|
|
@ -37,7 +37,7 @@ def test_cli_boolean():
|
|||
|
||||
def test_cli_boolean_no():
|
||||
with chdir(test_dir / 'cli'):
|
||||
ret = main(['--main_structural_directories', 'structures', '--cli.no-warnings'], do_not_print=True)
|
||||
ret = main(['--main_structural_directories', 'structures', '--display.no-mandatory'], do_not_print=True)
|
||||
filename = Path('result.txt')
|
||||
if not filename.is_file():
|
||||
with filename.open('w') as fh:
|
||||
|
|
@ -116,7 +116,7 @@ def test_cli_user_datas_user_datas_layers():
|
|||
save = os.environ.copy()
|
||||
os.environ["ROUGAIL_MY_VARIABLE"] = "my env value"
|
||||
with chdir(test_dir / 'cli'):
|
||||
ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', 'yaml/file2.yml', '--bitwarden.mock_enable'], do_not_print=True)
|
||||
ret = main(['--main_structural_directories', 'structures', '--cli.layers', '--step.user_data', 'environment', 'yaml', 'bitwarden', '--yaml.filename', 'yaml/file.yml', '--bitwarden.mock_enable'], do_not_print=True)
|
||||
filename = Path('result_user_datas_layers.txt')
|
||||
if not filename.is_file():
|
||||
with filename.open('w') as fh:
|
||||
|
|
|
|||
Loading…
Reference in a new issue