Compare commits
No commits in common. "3849c42cba2e92e55fd3dfd647b3f0c23e5aa7d4" and "dfd31c4fb4aab9bd176c1752926b791540460f84" have entirely different histories.
3849c42cba
...
dfd31c4fb4
263 changed files with 7223 additions and 706 deletions
|
|
@ -5,8 +5,8 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: \n"
|
"Project-Id-Version: \n"
|
||||||
"POT-Creation-Date: 2024-12-15 16:50+0100\n"
|
"POT-Creation-Date: 2024-11-25 09:10+0100\n"
|
||||||
"PO-Revision-Date: 2024-12-15 16:55+0100\n"
|
"PO-Revision-Date: 2024-11-25 09:11+0100\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
|
|
@ -16,31 +16,31 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
"X-Generator: Poedit 3.5\n"
|
"X-Generator: Poedit 3.5\n"
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:143
|
#: src/rougail/annotator/family.py:141
|
||||||
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"le mode d'une variable par défaut \"{0}\" n'est pas un mode valide, les "
|
"le mode d'une variable par défaut \"{0}\" n'est pas un mode valide, les "
|
||||||
"modes valides sont {1}"
|
"modes valides sont {1}"
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:149
|
#: src/rougail/annotator/family.py:147
|
||||||
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"le mode d'une famille par défaut \"{0}\" n'est pas un mode valide, les modes "
|
"le mode d'une famille par défaut \"{0}\" n'est pas un mode valide, les modes "
|
||||||
"valides sont {1}"
|
"valides sont {1}"
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:181
|
#: src/rougail/annotator/family.py:179
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"le mode \"{0}\" pour \"{1}\" n'est pas un mode valide, les modes valides "
|
"le mode \"{0}\" pour \"{1}\" n'est pas un mode valide, les modes valides "
|
||||||
"sont {2}"
|
"sont {2}"
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:185
|
#: src/rougail/annotator/family.py:183
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"le mode \"{0}\" pour \"{1}\" n'est pas un mode valide, aucun mode ne sont "
|
"le mode \"{0}\" pour \"{1}\" n'est pas un mode valide, aucun mode ne sont "
|
||||||
"définis"
|
"définis"
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:249
|
#: src/rougail/annotator/family.py:247
|
||||||
msgid ""
|
msgid ""
|
||||||
"the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the "
|
"the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the "
|
||||||
"higher family mode \"{2}\""
|
"higher family mode \"{2}\""
|
||||||
|
|
@ -48,7 +48,7 @@ msgstr ""
|
||||||
"la variable \"{0}\" est obligatoire donc dans le mode \"{1}\" mais la "
|
"la variable \"{0}\" est obligatoire donc dans le mode \"{1}\" mais la "
|
||||||
"famille a un mode supérieur \"{2}\""
|
"famille a un mode supérieur \"{2}\""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:287
|
#: src/rougail/annotator/family.py:285
|
||||||
msgid ""
|
msgid ""
|
||||||
"the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode "
|
"the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode "
|
||||||
"\"{2}\""
|
"\"{2}\""
|
||||||
|
|
@ -56,7 +56,7 @@ msgstr ""
|
||||||
"la variable suiveuse \"{0}\" a le mode \"{1}\" mais la variable leader a un "
|
"la variable suiveuse \"{0}\" a le mode \"{1}\" mais la variable leader a un "
|
||||||
"mode supérieur \"{2}\""
|
"mode supérieur \"{2}\""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:320
|
#: src/rougail/annotator/family.py:318
|
||||||
msgid ""
|
msgid ""
|
||||||
"the family \"{0}\" is in \"{1}\" mode but variables and families inside have "
|
"the family \"{0}\" is in \"{1}\" mode but variables and families inside have "
|
||||||
"the higher modes \"{2}\""
|
"the higher modes \"{2}\""
|
||||||
|
|
@ -64,7 +64,7 @@ msgstr ""
|
||||||
"la famille \"{0}\" a le mode \"{1}\" mais les variables et les familles à "
|
"la famille \"{0}\" a le mode \"{1}\" mais les variables et les familles à "
|
||||||
"l'intérieur ont des modes supérieurs \"{2}\""
|
"l'intérieur ont des modes supérieurs \"{2}\""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:338
|
#: src/rougail/annotator/family.py:336
|
||||||
msgid ""
|
msgid ""
|
||||||
"the variable \"{0}\" is in \"{1}\" mode but family has the higher family "
|
"the variable \"{0}\" is in \"{1}\" mode but family has the higher family "
|
||||||
"mode \"{2}\""
|
"mode \"{2}\""
|
||||||
|
|
@ -102,64 +102,6 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"la variable \"{0}\" a la valeur par défaut invalide \"{1}\" devrait être {2}"
|
"la variable \"{0}\" a la valeur par défaut invalide \"{1}\" devrait être {2}"
|
||||||
|
|
||||||
#: src/rougail/config.py:216
|
|
||||||
msgid "Directories where dictionary files are placed"
|
|
||||||
msgstr "Répertoires où sont placés les fichiers de structure"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:227
|
|
||||||
msgid "Sort dictionaries from differents directories"
|
|
||||||
msgstr "Trier les fichiers de structure à partir de différents répertoires"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:232
|
|
||||||
msgid "Main namespace name"
|
|
||||||
msgstr "Nom de l'espace de nom principal"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:238
|
|
||||||
msgid "Extra namespaces"
|
|
||||||
msgstr "Espaces de nom supplémentaires"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:245
|
|
||||||
msgid "Extra namespace name"
|
|
||||||
msgstr "Nom de l'espace de nom supplémentaire"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:251
|
|
||||||
msgid "Directories where extra dictionary files are placed"
|
|
||||||
msgstr ""
|
|
||||||
"Répertoires où sont placés les fichiers de structure de l'espace de nom "
|
|
||||||
"supplémentaire"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:262
|
|
||||||
msgid "Update dictionaries to newest Rougail format version"
|
|
||||||
msgstr ""
|
|
||||||
"Mettre à jour le fichier de structure vers la dernière version du format de "
|
|
||||||
"Rougail"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:263
|
|
||||||
msgid "Do not update dictionaries to newest Rougail format version"
|
|
||||||
msgstr ""
|
|
||||||
"Ne pas mettre à jour le fichier de structure vers la dernière version du "
|
|
||||||
"format de Rougail"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:267
|
|
||||||
msgid "Update informations"
|
|
||||||
msgstr "Mise à jour des informations"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:273
|
|
||||||
msgid "Directories where dictionary files will be placed"
|
|
||||||
msgstr "Répertoires où sont placés les fichiers de structure"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:278
|
|
||||||
msgid "Directories where extra files will be placed"
|
|
||||||
msgstr "Répertoires où sont placés les fichiers de structure supplémentaire"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:290
|
|
||||||
msgid "File with functions"
|
|
||||||
msgstr "Fichier avec les fonctions"
|
|
||||||
|
|
||||||
#: src/rougail/config.py:302
|
|
||||||
msgid "All modes level available"
|
|
||||||
msgstr "Tous les niveaux de modes valides"
|
|
||||||
|
|
||||||
#: src/rougail/convert.py:281
|
#: src/rougail/convert.py:281
|
||||||
msgid ""
|
msgid ""
|
||||||
"A variable or a family located in the \"{0}\" namespace shall not be used in "
|
"A variable or a family located in the \"{0}\" namespace shall not be used in "
|
||||||
|
|
@ -168,19 +110,15 @@ msgstr ""
|
||||||
"Une variable ou une famille localisé dans l'espace de nom \"{0}\" ne devrait "
|
"Une variable ou une famille localisé dans l'espace de nom \"{0}\" ne devrait "
|
||||||
"pas être utilisé dans l'espace de nom \"{1}\""
|
"pas être utilisé dans l'espace de nom \"{1}\""
|
||||||
|
|
||||||
#: src/rougail/convert.py:480
|
#: src/rougail/convert.py:477
|
||||||
msgid "unknown type {0} for {1}"
|
msgid "unknown type {0} for {1}"
|
||||||
msgstr "type {0} inconnu pour {1}"
|
msgstr "type {0} inconnu pour {1}"
|
||||||
|
|
||||||
#: src/rougail/convert.py:613
|
#: src/rougail/convert.py:1347
|
||||||
msgid "The family \"{0}\" already exists and it is not redefined"
|
|
||||||
msgstr "La famille \"{0}\" existe déjà et n'est pas redéfinie"
|
|
||||||
|
|
||||||
#: src/rougail/convert.py:1356
|
|
||||||
msgid "duplicate dictionary file name {0}"
|
msgid "duplicate dictionary file name {0}"
|
||||||
msgstr "nom de fichier {0} de dictionnaire dupliqué"
|
msgstr "nom de fichier {0} de dictionnaire dupliqué"
|
||||||
|
|
||||||
#: src/rougail/convert.py:1403
|
#: src/rougail/convert.py:1394
|
||||||
msgid "Cannot execute annotate multiple time"
|
msgid "Cannot execute annotate multiple time"
|
||||||
msgstr "Ne peut exécuter l'annotation plusieurs fois"
|
msgstr "Ne peut exécuter l'annotation plusieurs fois"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-12-15 16:57+0100\n"
|
"POT-Creation-Date: 2024-11-25 09:10+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|
@ -15,35 +15,35 @@ msgstr ""
|
||||||
"Generated-By: pygettext.py 1.5\n"
|
"Generated-By: pygettext.py 1.5\n"
|
||||||
|
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:143
|
#: src/rougail/annotator/family.py:141
|
||||||
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default variable mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:149
|
#: src/rougail/annotator/family.py:147
|
||||||
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
msgid "default family mode \"{0}\" is not a valid mode, valid modes are {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:181
|
#: src/rougail/annotator/family.py:179
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, valid modes are {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:185
|
#: src/rougail/annotator/family.py:183
|
||||||
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
msgid "mode \"{0}\" for \"{1}\" is not a valid mode, no modes are available"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:249
|
#: src/rougail/annotator/family.py:247
|
||||||
msgid "the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the higher family mode \"{2}\""
|
msgid "the variable \"{0}\" is mandatory so in \"{1}\" mode but family has the higher family mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:287
|
#: src/rougail/annotator/family.py:285
|
||||||
msgid "the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode \"{2}\""
|
msgid "the follower \"{0}\" is in \"{1}\" mode but leader have the higher mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:320
|
#: src/rougail/annotator/family.py:318
|
||||||
msgid "the family \"{0}\" is in \"{1}\" mode but variables and families inside have the higher modes \"{2}\""
|
msgid "the family \"{0}\" is in \"{1}\" mode but variables and families inside have the higher modes \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/annotator/family.py:338
|
#: src/rougail/annotator/family.py:336
|
||||||
msgid "the variable \"{0}\" is in \"{1}\" mode but family has the higher family mode \"{2}\""
|
msgid "the variable \"{0}\" is in \"{1}\" mode but family has the higher family mode \"{2}\""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
@ -67,75 +67,19 @@ msgstr ""
|
||||||
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
msgid "the variable \"{0}\" has an unvalid default value \"{1}\" should be in {2}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/config.py:216
|
|
||||||
msgid "Directories where dictionary files are placed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:227
|
|
||||||
msgid "Sort dictionaries from differents directories"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:232
|
|
||||||
msgid "Main namespace name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:238
|
|
||||||
msgid "Extra namespaces"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:245
|
|
||||||
msgid "Extra namespace name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:251
|
|
||||||
msgid "Directories where extra dictionary files are placed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:262
|
|
||||||
msgid "Update dictionaries to newest Rougail format version"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:263
|
|
||||||
msgid "Do not update dictionaries to newest Rougail format version"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:267
|
|
||||||
msgid "Update informations"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:273
|
|
||||||
msgid "Directories where dictionary files will be placed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:278
|
|
||||||
msgid "Directories where extra files will be placed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:290
|
|
||||||
msgid "File with functions"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/config.py:302
|
|
||||||
msgid "All modes level available"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/convert.py:281
|
#: src/rougail/convert.py:281
|
||||||
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
msgid "A variable or a family located in the \"{0}\" namespace shall not be used in the \"{1}\" namespace"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:480
|
#: src/rougail/convert.py:477
|
||||||
msgid "unknown type {0} for {1}"
|
msgid "unknown type {0} for {1}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:613
|
#: src/rougail/convert.py:1347
|
||||||
msgid "The family \"{0}\" already exists and it is not redefined"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: src/rougail/convert.py:1356
|
|
||||||
msgid "duplicate dictionary file name {0}"
|
msgid "duplicate dictionary file name {0}"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: src/rougail/convert.py:1403
|
#: src/rougail/convert.py:1394
|
||||||
msgid "Cannot execute annotate multiple time"
|
msgid "Cannot execute annotate multiple time"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ from warnings import warn
|
||||||
|
|
||||||
from .convert import RougailConvert
|
from .convert import RougailConvert
|
||||||
from .config import RougailConfig
|
from .config import RougailConfig
|
||||||
|
from .update import RougailUpgrade
|
||||||
from .utils import normalize_family
|
from .utils import normalize_family
|
||||||
from .object_model import CONVERT_OPTION
|
from .object_model import CONVERT_OPTION
|
||||||
from .user_datas import UserDatas
|
from .user_datas import UserDatas
|
||||||
|
|
@ -68,10 +69,18 @@ class Rougail(UserDatas):
|
||||||
self.converted = RougailConvert(self.rougailconfig)
|
self.converted = RougailConvert(self.rougailconfig)
|
||||||
self.config = None
|
self.config = None
|
||||||
|
|
||||||
|
def add_path_prefix(
|
||||||
|
self,
|
||||||
|
path_prefix: str,
|
||||||
|
) -> None:
|
||||||
|
"""Add a prefix"""
|
||||||
|
self.converted.load_config()
|
||||||
|
self.converted.parse_directories(path_prefix)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Get Tiramisu Config"""
|
"""Get Tiramisu Config"""
|
||||||
if not self.config:
|
if not self.config:
|
||||||
tiram_obj = self.converted.save()
|
tiram_obj = self.converted.save(self.rougailconfig["tiramisu_cache"])
|
||||||
optiondescription = {}
|
optiondescription = {}
|
||||||
custom_types = {
|
custom_types = {
|
||||||
custom.__name__: custom
|
custom.__name__: custom
|
||||||
|
|
@ -94,4 +103,4 @@ class Rougail(UserDatas):
|
||||||
return self.run()
|
return self.run()
|
||||||
|
|
||||||
|
|
||||||
__all__ = ("Rougail", "RougailConfig")
|
__all__ = ("Rougail", "RougailConfig", "RougailUpgrade")
|
||||||
|
|
|
||||||
|
|
@ -71,38 +71,30 @@ class SpaceAnnotator: # pylint: disable=R0903
|
||||||
if extra_annotator in ANNOTATORS:
|
if extra_annotator in ANNOTATORS:
|
||||||
continue
|
continue
|
||||||
get_annotators(ANNOTATORS, extra_annotator)
|
get_annotators(ANNOTATORS, extra_annotator)
|
||||||
for structural in objectspace.structurals:
|
if objectspace.output:
|
||||||
try:
|
try:
|
||||||
get_annotators(
|
get_annotators(ANNOTATORS, f"rougail.output_{objectspace.output}", "annotator")
|
||||||
ANNOTATORS, f"rougail.structural_{structural}", "annotator"
|
|
||||||
)
|
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
for user_data in objectspace.user_datas:
|
for user_data in objectspace.user_datas:
|
||||||
try:
|
try:
|
||||||
get_annotators(
|
get_annotators(ANNOTATORS, f"rougail.user_data_{user_data}", "annotator")
|
||||||
ANNOTATORS, f"rougail.user_data_{user_data}", "annotator"
|
|
||||||
)
|
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
if objectspace.output:
|
for plugin in objectspace.plugins:
|
||||||
try:
|
try:
|
||||||
get_annotators(
|
get_annotators(ANNOTATORS, f"rougail.{plugin}", "annotator")
|
||||||
ANNOTATORS, f"rougail.output_{objectspace.output}", "annotator"
|
|
||||||
)
|
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
annotators = ANNOTATORS["rougail.annotator"].copy()
|
annotators = ANNOTATORS["rougail.annotator"].copy()
|
||||||
for extra_annotator in objectspace.extra_annotators:
|
for extra_annotator in objectspace.extra_annotators:
|
||||||
annotators.extend(ANNOTATORS[extra_annotator])
|
annotators.extend(ANNOTATORS[extra_annotator])
|
||||||
for structural in objectspace.structurals:
|
for plugin in objectspace.plugins:
|
||||||
annotators.extend(ANNOTATORS[f"rougail.structural_{structural}.annotator"])
|
annotators.extend(ANNOTATORS[f"rougail.{plugin}.annotator"])
|
||||||
for user_data in objectspace.user_datas:
|
for user_data in objectspace.user_datas:
|
||||||
annotators.extend(ANNOTATORS[f"rougail.user_data_{user_data}.annotator"])
|
annotators.extend(ANNOTATORS[f"rougail.user_data_{user_data}.annotator"])
|
||||||
if objectspace.output:
|
if objectspace.output:
|
||||||
annotators.extend(
|
annotators.extend(ANNOTATORS[f"rougail.output_{objectspace.output}.annotator"])
|
||||||
ANNOTATORS[f"rougail.output_{objectspace.output}.annotator"]
|
|
||||||
)
|
|
||||||
annotators = sorted(annotators, key=get_level)
|
annotators = sorted(annotators, key=get_level)
|
||||||
functions = {}
|
functions = {}
|
||||||
functions_files = objectspace.functions_files
|
functions_files = objectspace.functions_files
|
||||||
|
|
|
||||||
|
|
@ -126,15 +126,12 @@ class Annotator(Walk):
|
||||||
family.dynamic, VariableCalculation
|
family.dynamic, VariableCalculation
|
||||||
):
|
):
|
||||||
path = family.dynamic.variable
|
path = family.dynamic.variable
|
||||||
if (
|
if family.version != "1.0" and self.objectspace.paths.regexp_relative.search(path):
|
||||||
family.version != "1.0"
|
|
||||||
and self.objectspace.paths.regexp_relative.search(path)
|
|
||||||
):
|
|
||||||
path = self.objectspace.paths.get_full_path(
|
path = self.objectspace.paths.get_full_path(
|
||||||
family.dynamic.variable,
|
family.dynamic.variable,
|
||||||
family.path,
|
family.path,
|
||||||
)
|
)
|
||||||
if family.version == "1.0" and "{{ suffix }}" in path:
|
if family.version == '1.0' and "{{ suffix }}" in path:
|
||||||
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
self.objectspace.informations.add(family.path, "dynamic_variable", path)
|
self.objectspace.informations.add(family.path, "dynamic_variable", path)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,12 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
if not objectspace.paths:
|
if not objectspace.paths:
|
||||||
return
|
return
|
||||||
self.objectspace = objectspace
|
self.objectspace = objectspace
|
||||||
|
if self.objectspace.main_namespace:
|
||||||
|
self.forbidden_name = [self.objectspace.main_namespace]
|
||||||
|
for extra in self.objectspace.extra_dictionaries:
|
||||||
|
self.forbidden_name.append(extra)
|
||||||
|
else:
|
||||||
|
self.forbidden_name = []
|
||||||
# default type inference from a default value with :term:`basic types`
|
# default type inference from a default value with :term:`basic types`
|
||||||
self.basic_types = {
|
self.basic_types = {
|
||||||
str: "string",
|
str: "string",
|
||||||
|
|
@ -133,6 +139,7 @@ class Annotator(Walk): # pylint: disable=R0903
|
||||||
calculated_variable_path = variable.default.variable
|
calculated_variable_path = variable.default.variable
|
||||||
calculated_variable, identifier = self.objectspace.paths.get_with_dynamic(
|
calculated_variable, identifier = self.objectspace.paths.get_with_dynamic(
|
||||||
calculated_variable_path,
|
calculated_variable_path,
|
||||||
|
variable.default.path_prefix,
|
||||||
variable.path,
|
variable.path,
|
||||||
variable.version,
|
variable.version,
|
||||||
variable.namespace,
|
variable.namespace,
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,7 @@ def get_sub_modules():
|
||||||
|
|
||||||
|
|
||||||
def get_level(module):
|
def get_level(module):
|
||||||
return float(module["level"]) + {
|
return module["level"]
|
||||||
"structural": 0.1,
|
|
||||||
"user data": 0.2,
|
|
||||||
"output": 0.3,
|
|
||||||
}.get(module["process"])
|
|
||||||
|
|
||||||
|
|
||||||
class _RougailConfig:
|
class _RougailConfig:
|
||||||
|
|
@ -191,12 +187,10 @@ class FakeRougailConvert(RougailConvert):
|
||||||
self.export_with_import = True
|
self.export_with_import = True
|
||||||
self.internal_functions = []
|
self.internal_functions = []
|
||||||
self.force_optional = False
|
self.force_optional = False
|
||||||
self.structurals = ["commandline"]
|
self.plugins = ["structural_commandline"]
|
||||||
self.user_datas = []
|
self.user_datas = []
|
||||||
self.output = None
|
self.output = None
|
||||||
self.add_extra_options = self.add_extra_options
|
self.add_extra_options = self.add_extra_options
|
||||||
self.tiramisu_cache = False
|
|
||||||
self.load_unexist_redefine = False
|
|
||||||
|
|
||||||
|
|
||||||
def get_rougail_config(
|
def get_rougail_config(
|
||||||
|
|
@ -204,6 +198,10 @@ def get_rougail_config(
|
||||||
backward_compatibility: bool = True,
|
backward_compatibility: bool = True,
|
||||||
add_extra_options: bool = True,
|
add_extra_options: bool = True,
|
||||||
) -> _RougailConfig:
|
) -> _RougailConfig:
|
||||||
|
if backward_compatibility:
|
||||||
|
main_namespace_default = "rougail"
|
||||||
|
else:
|
||||||
|
main_namespace_default = "null"
|
||||||
rougail_options = f"""default_dictionary_format_version:
|
rougail_options = f"""default_dictionary_format_version:
|
||||||
description: Dictionary format version by default, if not specified in dictionary file
|
description: Dictionary format version by default, if not specified in dictionary file
|
||||||
alternative_name: v
|
alternative_name: v
|
||||||
|
|
@ -212,8 +210,82 @@ def get_rougail_config(
|
||||||
- '1.1'
|
- '1.1'
|
||||||
mandatory: false
|
mandatory: false
|
||||||
|
|
||||||
|
main_dictionaries:
|
||||||
|
description: 'Directories where dictionary files are placed'
|
||||||
|
type: unix_filename
|
||||||
|
alternative_name: m
|
||||||
|
params:
|
||||||
|
allow_relative: True
|
||||||
|
test_existence: True
|
||||||
|
types:
|
||||||
|
- directory
|
||||||
|
multi: true
|
||||||
|
|
||||||
|
sort_dictionaries_all:
|
||||||
|
description: Sort dictionaries from differents directories
|
||||||
|
negative_description: Sort dictionaries directory by directory
|
||||||
|
default: false
|
||||||
|
|
||||||
|
main_namespace:
|
||||||
|
description: Main namespace name
|
||||||
|
default: {main_namespace_default}
|
||||||
|
alternative_name: s
|
||||||
|
mandatory: false
|
||||||
|
|
||||||
|
extra_dictionaries:
|
||||||
|
description: Extra namespaces
|
||||||
|
type: leadership
|
||||||
|
disabled:
|
||||||
|
variable: main_namespace
|
||||||
|
when: null
|
||||||
|
|
||||||
|
names:
|
||||||
|
description: 'Extra namespace name'
|
||||||
|
alternative_name: xn
|
||||||
|
multi: true
|
||||||
|
mandatory: false
|
||||||
|
|
||||||
|
directories:
|
||||||
|
description: Directories where extra dictionary files are placed
|
||||||
|
alternative_name: xd
|
||||||
|
type: unix_filename
|
||||||
|
params:
|
||||||
|
allow_relative: true
|
||||||
|
test_existence: true
|
||||||
|
types:
|
||||||
|
- directory
|
||||||
|
multi: true
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
description: Update dictionaries to newest Rougail format version
|
||||||
|
negative_description: Do not update dictionaries to newest Rougail format version
|
||||||
|
default: false
|
||||||
|
|
||||||
|
upgrade_options:
|
||||||
|
description: Update informations
|
||||||
|
disabled:
|
||||||
|
variable: upgrade
|
||||||
|
when: false
|
||||||
|
|
||||||
|
main_dictionaries:
|
||||||
|
description: 'Directories where dictionary files will be placed'
|
||||||
|
default:
|
||||||
|
variable: __.main_dictionaries
|
||||||
|
|
||||||
|
extra_dictionary:
|
||||||
|
description: 'Directories where extra files will be placed'
|
||||||
|
type: unix_filename
|
||||||
|
params:
|
||||||
|
allow_relative: true
|
||||||
|
test_existence: true
|
||||||
|
types:
|
||||||
|
- directory
|
||||||
|
disabled:
|
||||||
|
variable: __.main_namespace
|
||||||
|
when: null
|
||||||
|
|
||||||
functions_files:
|
functions_files:
|
||||||
description: {_("File with functions")}
|
description: File with functions
|
||||||
alternative_name: c
|
alternative_name: c
|
||||||
type: unix_filename
|
type: unix_filename
|
||||||
params:
|
params:
|
||||||
|
|
@ -225,73 +297,74 @@ functions_files:
|
||||||
mandatory: false
|
mandatory: false
|
||||||
|
|
||||||
modes_level:
|
modes_level:
|
||||||
description: {_("All modes level available")}
|
description: All modes level available
|
||||||
multi: true
|
multi: true
|
||||||
mandatory: false
|
mandatory: false
|
||||||
"""
|
"""
|
||||||
if backward_compatibility:
|
if backward_compatibility:
|
||||||
rougail_options += """ default:
|
rougail_options += """
|
||||||
|
default:
|
||||||
- basic
|
- basic
|
||||||
- standard
|
- standard
|
||||||
- advanced
|
- advanced
|
||||||
"""
|
"""
|
||||||
rougail_options += f"""
|
rougail_options += """
|
||||||
default_family_mode:
|
default_family_mode:
|
||||||
description: {_("Default mode for a family")}
|
description: Default mode for a family
|
||||||
default:
|
default:
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if modes_level %}}
|
{% if modes_level %}
|
||||||
{{{{ modes_level[0] }}}}
|
{{ modes_level[0] }}
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
disabled:
|
disabled:
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if not modes_level %}}
|
{% if not modes_level %}
|
||||||
No mode
|
No mode
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
validators:
|
validators:
|
||||||
- type: jinja
|
- type: jinja
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if default_family_mode not in modes_level %}}
|
{% if default_family_mode not in modes_level %}
|
||||||
not in modes_level ({{modes_level}})
|
not in modes_level ({modes_level})
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
default_variable_mode:
|
default_variable_mode:
|
||||||
description: {_("Default mode for a variable")}
|
description: Default mode for a variable
|
||||||
default:
|
default:
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if modes_level %}}
|
{% if modes_level %}
|
||||||
{{% if modes_level | length == 1 %}}
|
{% if modes_level | length == 1 %}
|
||||||
{{{{ modes_level[0] }}}}
|
{{ modes_level[0] }}
|
||||||
{{% else %}}
|
{% else %}
|
||||||
{{{{ modes_level[1] }}}}
|
{{ modes_level[1] }}
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
disabled:
|
disabled:
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if not modes_level %}}
|
{% if not modes_level %}
|
||||||
No mode
|
No mode
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
validators:
|
validators:
|
||||||
- type: jinja
|
- type: jinja
|
||||||
jinja: |
|
jinja: |
|
||||||
{{% if default_variable_mode not in modes_level %}}
|
{% if default_variable_mode not in modes_level %}
|
||||||
not in modes_level ({{modes_level}})
|
not in modes_level ({modes_level})
|
||||||
{{% endif %}}
|
{% endif %}
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
base_option_name:
|
base_option_name:
|
||||||
description: {_("Option name for the base option")}
|
description: Option name for the base option
|
||||||
default: baseoption
|
default: baseoption
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
not_export_with_import:
|
not_export_with_import:
|
||||||
description: {_("In cache file, do not importation of Tiramisu and other dependencies")}
|
description: In cache file, do not importation of Tiramisu and other dependencies
|
||||||
default: false
|
default: false
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
tiramisu_cache:
|
tiramisu_cache:
|
||||||
description: {_("Tiramisu cache filename")}
|
description: Tiramisu cache filename
|
||||||
alternative_name: t
|
alternative_name: t
|
||||||
type: unix_filename
|
type: unix_filename
|
||||||
mandatory: false
|
mandatory: false
|
||||||
|
|
@ -299,52 +372,52 @@ tiramisu_cache:
|
||||||
allow_relative: true
|
allow_relative: true
|
||||||
|
|
||||||
internal_functions:
|
internal_functions:
|
||||||
description: {_("Name of internal functions that we can use as a function")}
|
description: Name of internal functions that we can use as a function
|
||||||
multi: true
|
multi: true
|
||||||
mandatory: false
|
mandatory: false
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
extra_annotators:
|
extra_annotators:
|
||||||
description: {_("Name of extra annotators")}
|
description: Name of extra annotators
|
||||||
|
multi: true
|
||||||
|
mandatory: false
|
||||||
|
commandline: false
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
description: Name of Rougail plugins
|
||||||
multi: true
|
multi: true
|
||||||
mandatory: false
|
mandatory: false
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
suffix:
|
suffix:
|
||||||
description: {_("Suffix add to generated option name")}
|
description: Suffix add to generated option name
|
||||||
default: ''
|
default: ''
|
||||||
mandatory: false
|
mandatory: false
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
force_optional:
|
force_optional:
|
||||||
description: {_("Every variable in calculation are optional")}
|
description: Every variable in calculation are optional
|
||||||
negative_description: {_("Variable in calculation are not optional by default")}
|
negative_description: Variable in calculation are not optional by default
|
||||||
default: False
|
default: False
|
||||||
|
|
||||||
load_unexist_redefine:
|
|
||||||
description: {_("Load redefine variable even if there don't already exists")}
|
|
||||||
negative_description: {_("Load redefine variable even if there don't already exists")}
|
|
||||||
commandline: false
|
|
||||||
default: False
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
processes = {
|
processes = {
|
||||||
"structural": [],
|
"structural": [],
|
||||||
"user data": [],
|
|
||||||
"output": [],
|
"output": [],
|
||||||
|
"user data": [],
|
||||||
}
|
}
|
||||||
for module in get_sub_modules().values():
|
for module in get_sub_modules().values():
|
||||||
data = module.get_rougail_config(backward_compatibility=backward_compatibility)
|
data = module.get_rougail_config()
|
||||||
processes[data["process"]].append(data)
|
processes[data["process"]].append(data)
|
||||||
# reorder
|
# reorder
|
||||||
for process in processes:
|
for process in processes:
|
||||||
processes[process] = list(sorted(processes[process], key=get_level))
|
processes[process] = list(sorted(processes[process], key=get_level))
|
||||||
rougail_process = "step: # Load and exporter steps"
|
rougail_process = """step: # Load and exporter steps
|
||||||
|
disabled:
|
||||||
|
variable: upgrade"""
|
||||||
for process in processes:
|
for process in processes:
|
||||||
if processes[process]:
|
if processes[process]:
|
||||||
objects = processes[process]
|
objects = processes[process]
|
||||||
rougail_process += """
|
rougail_process += """
|
||||||
|
|
||||||
{NAME}:
|
{NAME}:
|
||||||
description: Select for {NAME}
|
description: Select for {NAME}
|
||||||
alternative_name: {NAME[0]}
|
alternative_name: {NAME[0]}
|
||||||
|
|
@ -355,29 +428,26 @@ load_unexist_redefine:
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
rougail_process += f" - {obj['name']}\n"
|
rougail_process += f" - {obj['name']}\n"
|
||||||
if process == "structural":
|
if process == "structural":
|
||||||
rougail_process += """ commandline: false
|
rougail_process += " commandline: false"
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
- directory
|
|
||||||
"""
|
|
||||||
elif process == "user data":
|
elif process == "user data":
|
||||||
rougail_process += """ multi: true
|
rougail_process += """ multi: true
|
||||||
mandatory: false"""
|
mandatory: false
|
||||||
|
"""
|
||||||
hidden_outputs = [
|
hidden_outputs = [
|
||||||
process["name"]
|
process["name"]
|
||||||
for process in processes["output"]
|
for process in processes["output"]
|
||||||
if not process.get("allow_user_data", True)
|
if not process.get("allow_user_data", True)
|
||||||
]
|
]
|
||||||
if hidden_outputs:
|
if hidden_outputs:
|
||||||
rougail_process += """
|
rougail_process += """ hidden:
|
||||||
hidden:
|
|
||||||
type: jinja
|
type: jinja
|
||||||
jinja: |
|
jinja: |
|
||||||
"""
|
"""
|
||||||
for hidden_output in hidden_outputs:
|
for hidden_output in hidden_outputs:
|
||||||
rougail_process += """ {% if _.output == 'NAME' %}
|
rougail_process += """ {% if _.output == 'NAME' %}
|
||||||
Cannot load user data for NAME output
|
Cannot load user data for NAME output
|
||||||
{% endif %}""".replace(
|
{% endif %}
|
||||||
|
""".replace(
|
||||||
"NAME", hidden_output
|
"NAME", hidden_output
|
||||||
)
|
)
|
||||||
elif objects:
|
elif objects:
|
||||||
|
|
@ -385,10 +455,10 @@ load_unexist_redefine:
|
||||||
DEFAULT=objects[0]["name"]
|
DEFAULT=objects[0]["name"]
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if process == "output":
|
if process == 'output':
|
||||||
prop = "hidden"
|
prop = 'hidden'
|
||||||
else:
|
else:
|
||||||
prop = "disabled"
|
prop = 'disabled'
|
||||||
rougail_process += """
|
rougail_process += """
|
||||||
{NAME}:
|
{NAME}:
|
||||||
description: Select for {NAME}
|
description: Select for {NAME}
|
||||||
|
|
@ -403,9 +473,8 @@ load_unexist_redefine:
|
||||||
PROP=prop,
|
PROP=prop,
|
||||||
)
|
)
|
||||||
rougail_options += rougail_process
|
rougail_options += rougail_process
|
||||||
# print(rougail_options)
|
|
||||||
convert = FakeRougailConvert(add_extra_options)
|
convert = FakeRougailConvert(add_extra_options)
|
||||||
convert.init()
|
convert._init()
|
||||||
convert.namespace = None
|
convert.namespace = None
|
||||||
convert.parse_root_file(
|
convert.parse_root_file(
|
||||||
"rougail.config",
|
"rougail.config",
|
||||||
|
|
@ -414,10 +483,8 @@ load_unexist_redefine:
|
||||||
YAML().load(rougail_options),
|
YAML().load(rougail_options),
|
||||||
)
|
)
|
||||||
extra_vars = {}
|
extra_vars = {}
|
||||||
objects = []
|
for process in processes:
|
||||||
for obj in sorted(
|
for obj in processes[process]:
|
||||||
[obj for objects in processes.values() for obj in objects], key=get_level
|
|
||||||
):
|
|
||||||
if "extra_vars" in obj:
|
if "extra_vars" in obj:
|
||||||
extra_vars |= obj["extra_vars"]
|
extra_vars |= obj["extra_vars"]
|
||||||
if not "options" in obj:
|
if not "options" in obj:
|
||||||
|
|
@ -434,7 +501,7 @@ load_unexist_redefine:
|
||||||
YAML().load(option),
|
YAML().load(option),
|
||||||
)
|
)
|
||||||
|
|
||||||
tiram_obj = convert.save()
|
tiram_obj = convert.save(None)
|
||||||
optiondescription = {}
|
optiondescription = {}
|
||||||
exec(tiram_obj, {}, optiondescription) # pylint: disable=W0122
|
exec(tiram_obj, {}, optiondescription) # pylint: disable=W0122
|
||||||
return _RougailConfig(
|
return _RougailConfig(
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
from itertools import chain
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from re import compile, findall
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
Dict,
|
Dict,
|
||||||
|
|
@ -40,6 +42,8 @@ from typing import (
|
||||||
get_type_hints,
|
get_type_hints,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from pydantic import ValidationError
|
||||||
|
from ruamel.yaml import YAML
|
||||||
from ruamel.yaml.comments import CommentedMap
|
from ruamel.yaml.comments import CommentedMap
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
|
||||||
|
|
@ -64,8 +68,7 @@ from .object_model import (
|
||||||
VariableCalculation,
|
VariableCalculation,
|
||||||
)
|
)
|
||||||
from .tiramisureflector import TiramisuReflector
|
from .tiramisureflector import TiramisuReflector
|
||||||
from .utils import load_modules
|
from .utils import get_realpath, normalize_family, load_modules
|
||||||
from .path import Paths
|
|
||||||
from .error import DictConsistencyError
|
from .error import DictConsistencyError
|
||||||
|
|
||||||
property_types = Union[Literal[True], Calculation]
|
property_types = Union[Literal[True], Calculation]
|
||||||
|
|
@ -97,6 +100,218 @@ class Property:
|
||||||
return path in self._properties
|
return path in self._properties
|
||||||
|
|
||||||
|
|
||||||
|
class Paths:
|
||||||
|
regexp_relative = compile(r"^_*\.(.*)$")
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
default_namespace: str,
|
||||||
|
) -> None:
|
||||||
|
self._data: Dict[str, Union[Variable, Family]] = {}
|
||||||
|
self._dynamics: Dict[str:str] = {}
|
||||||
|
if default_namespace is not None:
|
||||||
|
default_namespace = normalize_family(default_namespace)
|
||||||
|
self.default_namespace = default_namespace
|
||||||
|
self.path_prefix = None
|
||||||
|
|
||||||
|
def has_value(self) -> bool:
|
||||||
|
return self._data != {}
|
||||||
|
|
||||||
|
def add(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
data: Any,
|
||||||
|
is_dynamic: bool,
|
||||||
|
dynamic: str,
|
||||||
|
*,
|
||||||
|
force: bool = False,
|
||||||
|
) -> None:
|
||||||
|
self._data[path] = data
|
||||||
|
if not force and is_dynamic:
|
||||||
|
self._dynamics[path] = dynamic
|
||||||
|
|
||||||
|
def get_full_path(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
current_path: str,
|
||||||
|
):
|
||||||
|
relative, subpath = path.split(".", 1)
|
||||||
|
relative_len = len(relative)
|
||||||
|
path_len = current_path.count(".")
|
||||||
|
if path_len + 1 == relative_len:
|
||||||
|
return subpath
|
||||||
|
parent_path = current_path.rsplit(".", relative_len)[0]
|
||||||
|
return parent_path + "." + subpath
|
||||||
|
|
||||||
|
def get_with_dynamic(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
identifier_path: str,
|
||||||
|
current_path: str,
|
||||||
|
version: str,
|
||||||
|
namespace: str,
|
||||||
|
xmlfiles: List[str],
|
||||||
|
) -> Any:
|
||||||
|
identifier = None
|
||||||
|
if version != "1.0" and self.regexp_relative.search(path):
|
||||||
|
path = self.get_full_path(
|
||||||
|
path,
|
||||||
|
current_path,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
path = get_realpath(path, identifier_path)
|
||||||
|
dynamic = None
|
||||||
|
# version 1.0
|
||||||
|
if version == "1.0":
|
||||||
|
if not path in self._data and "{{ suffix }}" not in path:
|
||||||
|
new_path = None
|
||||||
|
current_path = None
|
||||||
|
identifiers = []
|
||||||
|
for name in path.split("."):
|
||||||
|
parent_path = current_path
|
||||||
|
if current_path:
|
||||||
|
current_path += "." + name
|
||||||
|
else:
|
||||||
|
current_path = name
|
||||||
|
if current_path in self._data:
|
||||||
|
if new_path:
|
||||||
|
new_path += "." + name
|
||||||
|
else:
|
||||||
|
new_path = name
|
||||||
|
continue
|
||||||
|
for dynamic_path in self._dynamics:
|
||||||
|
if "." in dynamic_path:
|
||||||
|
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
|
||||||
|
else:
|
||||||
|
parent_dynamic = None
|
||||||
|
name_dynamic = dynamic_path
|
||||||
|
if (
|
||||||
|
parent_dynamic == parent_path
|
||||||
|
and name_dynamic.endswith("{{ identifier }}")
|
||||||
|
and name == name_dynamic.replace("{{ identifier }}", "")
|
||||||
|
):
|
||||||
|
new_path += "." + name_dynamic
|
||||||
|
break
|
||||||
|
regexp = "^" + name_dynamic.replace("{{ identifier }}", "(.*)")
|
||||||
|
finded = findall(regexp, name)
|
||||||
|
if len(finded) != 1 or not finded[0]:
|
||||||
|
continue
|
||||||
|
if finded[0] == "{{ identifier }}":
|
||||||
|
identifiers.append(None)
|
||||||
|
else:
|
||||||
|
identifiers.append(finded[0])
|
||||||
|
if new_path is None:
|
||||||
|
new_path = name_dynamic
|
||||||
|
else:
|
||||||
|
new_path += "." + name_dynamic
|
||||||
|
parent_path = dynamic_path
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
if new_path:
|
||||||
|
new_path += "." + name
|
||||||
|
else:
|
||||||
|
new_path = name
|
||||||
|
path = new_path
|
||||||
|
else:
|
||||||
|
identifiers = None
|
||||||
|
if "{{ suffix }}" in path:
|
||||||
|
path = path.replace("{{ suffix }}", "{{ identifier }}")
|
||||||
|
elif not path in self._data:
|
||||||
|
current_path = None
|
||||||
|
parent_path = None
|
||||||
|
new_path = current_path
|
||||||
|
identifiers = []
|
||||||
|
for name in path.split("."):
|
||||||
|
if current_path:
|
||||||
|
current_path += "." + name
|
||||||
|
else:
|
||||||
|
current_path = name
|
||||||
|
# parent_path, name_path = path.rsplit('.', 1)
|
||||||
|
if current_path in self._data:
|
||||||
|
if new_path:
|
||||||
|
new_path += "." + name
|
||||||
|
else:
|
||||||
|
new_path = name
|
||||||
|
parent_path = current_path
|
||||||
|
continue
|
||||||
|
for dynamic_path in self._dynamics:
|
||||||
|
if "." in dynamic_path:
|
||||||
|
parent_dynamic, name_dynamic = dynamic_path.rsplit(".", 1)
|
||||||
|
else:
|
||||||
|
parent_dynamic = None
|
||||||
|
name_dynamic = dynamic_path
|
||||||
|
if (
|
||||||
|
"{{ identifier }}" not in name_dynamic
|
||||||
|
or parent_path != parent_dynamic
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
regexp = "^" + name_dynamic.replace("{{ identifier }}", "(.*)")
|
||||||
|
finded = findall(regexp, name)
|
||||||
|
if len(finded) != 1 or not finded[0]:
|
||||||
|
continue
|
||||||
|
if finded[0] == "{{ identifier }}":
|
||||||
|
identifiers.append(None)
|
||||||
|
else:
|
||||||
|
identifiers.append(finded[0])
|
||||||
|
if new_path is None:
|
||||||
|
new_path = name_dynamic
|
||||||
|
else:
|
||||||
|
new_path += "." + name_dynamic
|
||||||
|
parent_path = dynamic_path
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
if new_path:
|
||||||
|
new_path += "." + name
|
||||||
|
else:
|
||||||
|
new_path = name
|
||||||
|
if "{{ identifier }}" in name:
|
||||||
|
identifiers.append(None)
|
||||||
|
parent_path = current_path
|
||||||
|
path = new_path
|
||||||
|
else:
|
||||||
|
identifiers = None
|
||||||
|
if path not in self._data:
|
||||||
|
return None, None
|
||||||
|
option = self._data[path]
|
||||||
|
option_namespace = option.namespace
|
||||||
|
if (
|
||||||
|
self.default_namespace not in [namespace, option_namespace]
|
||||||
|
and namespace != option_namespace
|
||||||
|
):
|
||||||
|
msg = _(
|
||||||
|
'A variable or a family located in the "{0}" namespace shall not be used in the "{1}" namespace'
|
||||||
|
).format(option_namespace, namespace)
|
||||||
|
raise DictConsistencyError(msg, 38, xmlfiles)
|
||||||
|
return option, identifiers
|
||||||
|
|
||||||
|
def __getitem__(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
) -> Union[Family, Variable]:
|
||||||
|
if not path in self._data:
|
||||||
|
raise AttributeError(f"cannot find variable or family {path}")
|
||||||
|
return self._data[path]
|
||||||
|
|
||||||
|
def __contains__(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
) -> bool:
|
||||||
|
return path in self._data
|
||||||
|
|
||||||
|
def __delitem__(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
) -> None:
|
||||||
|
logging.info("remove empty family %s", path)
|
||||||
|
del self._data[path]
|
||||||
|
|
||||||
|
def is_dynamic(self, path: str) -> bool:
|
||||||
|
return path in self._dynamics
|
||||||
|
|
||||||
|
def get(self):
|
||||||
|
return self._data.values()
|
||||||
|
|
||||||
|
|
||||||
information_types = Dict[str, Union[str, int, float, bool]]
|
information_types = Dict[str, Union[str, int, float, bool]]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -127,7 +342,7 @@ class ParserVariable:
|
||||||
def __init__(self, rougailconfig):
|
def __init__(self, rougailconfig):
|
||||||
self.rougailconfig = rougailconfig
|
self.rougailconfig = rougailconfig
|
||||||
self.load_config()
|
self.load_config()
|
||||||
self.paths = Paths(None)
|
self.paths = Paths(self.main_namespace)
|
||||||
self.families = []
|
self.families = []
|
||||||
self.variables = []
|
self.variables = []
|
||||||
self.parents = {".": []}
|
self.parents = {".": []}
|
||||||
|
|
@ -135,7 +350,6 @@ class ParserVariable:
|
||||||
self.reflector_names = {}
|
self.reflector_names = {}
|
||||||
self.leaders = []
|
self.leaders = []
|
||||||
self.followers = []
|
self.followers = []
|
||||||
self.dynamics = []
|
|
||||||
self.multis = {}
|
self.multis = {}
|
||||||
self.default_multi = {}
|
self.default_multi = {}
|
||||||
self.jinja = {}
|
self.jinja = {}
|
||||||
|
|
@ -148,11 +362,20 @@ class ParserVariable:
|
||||||
self.properties = Property()
|
self.properties = Property()
|
||||||
# self.choices = Appendable()
|
# self.choices = Appendable()
|
||||||
self.has_dyn_option = False
|
self.has_dyn_option = False
|
||||||
|
self.path_prefix = None
|
||||||
self.is_init = False
|
self.is_init = False
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def load_config(self) -> None:
|
def load_config(self) -> None:
|
||||||
rougailconfig = self.rougailconfig
|
rougailconfig = self.rougailconfig
|
||||||
|
self.sort_dictionaries_all = rougailconfig["sort_dictionaries_all"]
|
||||||
|
try:
|
||||||
|
self.main_dictionaries = rougailconfig["main_dictionaries"]
|
||||||
|
except:
|
||||||
|
self.main_dictionaries = []
|
||||||
|
self.main_namespace = rougailconfig["main_namespace"]
|
||||||
|
if self.main_namespace:
|
||||||
|
self.extra_dictionaries = rougailconfig["extra_dictionaries"]
|
||||||
self.suffix = rougailconfig["suffix"]
|
self.suffix = rougailconfig["suffix"]
|
||||||
self.default_dictionary_format_version = rougailconfig[
|
self.default_dictionary_format_version = rougailconfig[
|
||||||
"default_dictionary_format_version"
|
"default_dictionary_format_version"
|
||||||
|
|
@ -171,39 +394,34 @@ class ParserVariable:
|
||||||
self.add_extra_options = rougailconfig[
|
self.add_extra_options = rougailconfig[
|
||||||
"structural_commandline.add_extra_options"
|
"structural_commandline.add_extra_options"
|
||||||
]
|
]
|
||||||
self.structurals = rougailconfig["step.structural"]
|
|
||||||
self.user_datas = rougailconfig["step.user_data"]
|
self.user_datas = rougailconfig["step.user_data"]
|
||||||
self.output = rougailconfig["step.output"]
|
self.output = rougailconfig["step.output"]
|
||||||
self.tiramisu_cache = rougailconfig["tiramisu_cache"]
|
self.plugins = rougailconfig["plugins"]
|
||||||
self.load_unexist_redefine = rougailconfig["load_unexist_redefine"]
|
|
||||||
|
|
||||||
def init(self):
|
def _init(self):
|
||||||
if self.is_init:
|
if self.is_init:
|
||||||
return
|
return
|
||||||
variable = Variable
|
variable = Variable
|
||||||
family = Family
|
family = Family
|
||||||
|
if self.plugins:
|
||||||
root = Path(__file__).parent
|
root = Path(__file__).parent
|
||||||
self.walker = None
|
for plugin in self.plugins:
|
||||||
for structural_name in self.structurals:
|
module_path = root / plugin / "object_model.py"
|
||||||
structural = f"structural_{structural_name}"
|
|
||||||
module_path = root / structural / "__init__.py"
|
|
||||||
if not module_path.is_file():
|
if not module_path.is_file():
|
||||||
continue
|
continue
|
||||||
module = load_modules(f"rougail.{structural}", str(module_path))
|
module = load_modules(
|
||||||
|
f"rougail.{plugin}.object_model", str(module_path)
|
||||||
|
)
|
||||||
if "Variable" in module.__all__:
|
if "Variable" in module.__all__:
|
||||||
variable = type(
|
variable = type(
|
||||||
variable.__name__ + "_" + structural,
|
variable.__name__ + "_" + plugin,
|
||||||
(variable, module.Variable),
|
(variable, module.Variable),
|
||||||
{},
|
{},
|
||||||
)
|
)
|
||||||
if "Family" in module.__all__:
|
if "Family" in module.__all__:
|
||||||
family = type(
|
family = type(
|
||||||
family.__name__ + "_" + structural, (family, module.Family), {}
|
family.__name__ + "_" + plugin, (family, module.Family), {}
|
||||||
)
|
)
|
||||||
if "Walker" in module.__all__:
|
|
||||||
if self.walker:
|
|
||||||
raise Exception("multiple walker defined!")
|
|
||||||
self.walker = module.Walker
|
|
||||||
self.variable = variable
|
self.variable = variable
|
||||||
self.family = family
|
self.family = family
|
||||||
self.dynamic = type(Dynamic.__name__, (Dynamic, family), {})
|
self.dynamic = type(Dynamic.__name__, (Dynamic, family), {})
|
||||||
|
|
@ -373,7 +591,7 @@ class ParserVariable:
|
||||||
return
|
return
|
||||||
family_obj = {}
|
family_obj = {}
|
||||||
subfamily_obj = {}
|
subfamily_obj = {}
|
||||||
if version != "1.0":
|
if version != '1.0':
|
||||||
exists = obj.pop("exists", None)
|
exists = obj.pop("exists", None)
|
||||||
else:
|
else:
|
||||||
exists = None
|
exists = None
|
||||||
|
|
@ -390,9 +608,7 @@ class ParserVariable:
|
||||||
if family_obj:
|
if family_obj:
|
||||||
if exists in [None, True] and not obj.pop("redefine", False):
|
if exists in [None, True] and not obj.pop("redefine", False):
|
||||||
raise DictConsistencyError(
|
raise DictConsistencyError(
|
||||||
_(
|
_('The family "{0}" already exists and it is not redefined').format(path),
|
||||||
'The family "{0}" already exists and it is not redefined'
|
|
||||||
).format(path),
|
|
||||||
32,
|
32,
|
||||||
[filename],
|
[filename],
|
||||||
)
|
)
|
||||||
|
|
@ -406,7 +622,7 @@ class ParserVariable:
|
||||||
version,
|
version,
|
||||||
typ="family",
|
typ="family",
|
||||||
)
|
)
|
||||||
if self.load_unexist_redefine or exists in [None, True]:
|
if exists in [None, True]:
|
||||||
self.paths.add(
|
self.paths.add(
|
||||||
path,
|
path,
|
||||||
self.paths[path].model_copy(update=obj),
|
self.paths[path].model_copy(update=obj),
|
||||||
|
|
@ -420,13 +636,10 @@ class ParserVariable:
|
||||||
family_is_dynamic = True
|
family_is_dynamic = True
|
||||||
parent_dynamic = path
|
parent_dynamic = path
|
||||||
else:
|
else:
|
||||||
redefine = family_obj.pop("redefine", None)
|
if exists is None and "redefine" in obj and obj["redefine"]:
|
||||||
if not self.load_unexist_redefine and exists is None and redefine:
|
|
||||||
raise Exception(
|
raise Exception(
|
||||||
f'cannot redefine the inexisting family "{path}" in {filename}'
|
f'cannot redefine the inexisting family "{path}" in {filename}'
|
||||||
)
|
)
|
||||||
if exists is True:
|
|
||||||
return
|
|
||||||
extra_attrs = set(family_obj) - self.family_attrs
|
extra_attrs = set(family_obj) - self.family_attrs
|
||||||
if extra_attrs:
|
if extra_attrs:
|
||||||
raise Exception(f"extra attrs ... {extra_attrs}")
|
raise Exception(f"extra attrs ... {extra_attrs}")
|
||||||
|
|
@ -645,9 +858,8 @@ class ParserVariable:
|
||||||
version,
|
version,
|
||||||
)
|
)
|
||||||
self.parse_params(path, obj)
|
self.parse_params(path, obj)
|
||||||
exists = obj.pop("exists", None)
|
|
||||||
if path in self.paths:
|
if path in self.paths:
|
||||||
if not self.load_unexist_redefine and exists is False:
|
if "exists" in obj and not obj.pop("exists"):
|
||||||
return
|
return
|
||||||
if not obj.pop("redefine", False):
|
if not obj.pop("redefine", False):
|
||||||
msg = f'Variable "{path}" already exists'
|
msg = f'Variable "{path}" already exists'
|
||||||
|
|
@ -661,13 +873,12 @@ class ParserVariable:
|
||||||
)
|
)
|
||||||
self.paths[path].xmlfiles.append(filename)
|
self.paths[path].xmlfiles.append(filename)
|
||||||
else:
|
else:
|
||||||
if not self.load_unexist_redefine and exists is True:
|
if "exists" in obj and obj.pop("exists"):
|
||||||
# this variable must exist
|
# this variable must exist
|
||||||
# but it's not the case
|
# but it's not the case
|
||||||
# so do nothing
|
# so do nothing
|
||||||
return
|
return
|
||||||
redefine = obj.pop("redefine", False)
|
if "redefine" in obj and obj["redefine"]:
|
||||||
if not self.load_unexist_redefine and redefine:
|
|
||||||
msg = f'cannot redefine the inexisting variable "{path}"'
|
msg = f'cannot redefine the inexisting variable "{path}"'
|
||||||
raise DictConsistencyError(msg, 46, [filename])
|
raise DictConsistencyError(msg, 46, [filename])
|
||||||
obj["path"] = path
|
obj["path"] = path
|
||||||
|
|
@ -790,6 +1001,7 @@ class ParserVariable:
|
||||||
|
|
||||||
variable["namespace"] = self.namespace
|
variable["namespace"] = self.namespace
|
||||||
variable["version"] = version
|
variable["version"] = version
|
||||||
|
variable["path_prefix"] = self.path_prefix
|
||||||
variable["xmlfiles"] = filename
|
variable["xmlfiles"] = filename
|
||||||
variable_type = self.get_family_or_variable_type(variable)
|
variable_type = self.get_family_or_variable_type(variable)
|
||||||
obj = {
|
obj = {
|
||||||
|
|
@ -866,9 +1078,6 @@ class ParserVariable:
|
||||||
return value["type"] in CALCULATION_TYPES
|
return value["type"] in CALCULATION_TYPES
|
||||||
# auto set type
|
# auto set type
|
||||||
typ = set(CALCULATION_TYPES) & set(value)
|
typ = set(CALCULATION_TYPES) & set(value)
|
||||||
# XXX variable is also set to information
|
|
||||||
if typ == {"variable", "information"}:
|
|
||||||
typ = {"information"}
|
|
||||||
if len(typ) == 1:
|
if len(typ) == 1:
|
||||||
value["type"] = list(typ)[0]
|
value["type"] = list(typ)[0]
|
||||||
return True
|
return True
|
||||||
|
|
@ -893,6 +1102,7 @@ class ParserVariable:
|
||||||
typ = calculation_object.pop("type")
|
typ = calculation_object.pop("type")
|
||||||
|
|
||||||
calculation_object["attribute_name"] = attribute
|
calculation_object["attribute_name"] = attribute
|
||||||
|
calculation_object["path_prefix"] = self.path_prefix
|
||||||
calculation_object["path"] = path
|
calculation_object["path"] = path
|
||||||
calculation_object["inside_list"] = inside_list
|
calculation_object["inside_list"] = inside_list
|
||||||
calculation_object["version"] = version
|
calculation_object["version"] = version
|
||||||
|
|
@ -907,9 +1117,6 @@ class ParserVariable:
|
||||||
if isinstance(val, dict) and "type" not in val:
|
if isinstance(val, dict) and "type" not in val:
|
||||||
# auto set type
|
# auto set type
|
||||||
param_typ = set(CALCULATION_TYPES) & set(val)
|
param_typ = set(CALCULATION_TYPES) & set(val)
|
||||||
# XXX variable is also set to information
|
|
||||||
if param_typ == {"variable", "information"}:
|
|
||||||
param_typ = {"information"}
|
|
||||||
if len(param_typ) == 1:
|
if len(param_typ) == 1:
|
||||||
val["type"] = list(param_typ)[0]
|
val["type"] = list(param_typ)[0]
|
||||||
if not isinstance(val, dict) or "type" not in val:
|
if not isinstance(val, dict) or "type" not in val:
|
||||||
|
|
@ -965,7 +1172,7 @@ class RougailConvert(ParserVariable):
|
||||||
|
|
||||||
def __init__(self, rougailconfig) -> None:
|
def __init__(self, rougailconfig) -> None:
|
||||||
self.annotator = False
|
self.annotator = False
|
||||||
self.has_namespace = False
|
self.yaml = YAML()
|
||||||
super().__init__(rougailconfig)
|
super().__init__(rougailconfig)
|
||||||
|
|
||||||
def search_calculation(
|
def search_calculation(
|
||||||
|
|
@ -995,20 +1202,81 @@ class RougailConvert(ParserVariable):
|
||||||
inside_list.append(key)
|
inside_list.append(key)
|
||||||
return inside_list, outside_list
|
return inside_list, outside_list
|
||||||
|
|
||||||
def create_namespace(
|
def parse_directories(
|
||||||
self, namespace_description: str, namespace_path: Optional[str] = None
|
self,
|
||||||
|
path_prefix: Optional[str] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if namespace_path is None:
|
"""Parse directories content"""
|
||||||
|
self._init()
|
||||||
|
if path_prefix:
|
||||||
|
n_path_prefix = normalize_family(path_prefix)
|
||||||
|
if n_path_prefix in self.parents:
|
||||||
|
raise Exception("pfffff")
|
||||||
|
root_parent = n_path_prefix
|
||||||
|
self.path_prefix = n_path_prefix
|
||||||
|
self.namespace = None
|
||||||
|
self.add_family(
|
||||||
|
n_path_prefix,
|
||||||
|
n_path_prefix,
|
||||||
|
{"description": path_prefix},
|
||||||
|
"",
|
||||||
|
False,
|
||||||
|
None,
|
||||||
|
"",
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
root_parent = "."
|
||||||
|
if self.main_namespace:
|
||||||
|
directory_dict = chain(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
self.main_namespace,
|
||||||
|
self.main_dictionaries,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
self.extra_dictionaries.items(),
|
||||||
|
)
|
||||||
|
for namespace, extra_dirs in directory_dict:
|
||||||
|
if namespace is None:
|
||||||
|
self.namespace = namespace
|
||||||
|
else:
|
||||||
|
self.namespace = normalize_family(namespace)
|
||||||
|
if root_parent == ".":
|
||||||
namespace_path = self.namespace
|
namespace_path = self.namespace
|
||||||
|
else:
|
||||||
|
namespace_path = f"{root_parent}.{self.namespace}"
|
||||||
|
if namespace_path in self.parents:
|
||||||
|
raise Exception("pfff")
|
||||||
|
for idx, filename in enumerate(self.get_sorted_filename(extra_dirs)):
|
||||||
|
if not idx:
|
||||||
self.parse_family(
|
self.parse_family(
|
||||||
"",
|
"",
|
||||||
self.namespace,
|
self.namespace,
|
||||||
namespace_path,
|
namespace_path,
|
||||||
{
|
{
|
||||||
"description": namespace_description,
|
"description": namespace,
|
||||||
},
|
},
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
|
self.parse_variable_file(
|
||||||
|
filename,
|
||||||
|
namespace_path,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.namespace = None
|
||||||
|
if root_parent == ".":
|
||||||
|
namespace_path = ""
|
||||||
|
else:
|
||||||
|
namespace_path = f"{root_parent}"
|
||||||
|
if namespace_path in self.parents:
|
||||||
|
raise Exception("pfff")
|
||||||
|
for filename in self.get_sorted_filename(self.main_dictionaries):
|
||||||
|
self.parse_variable_file(
|
||||||
|
filename,
|
||||||
|
namespace_path,
|
||||||
|
)
|
||||||
|
if path_prefix:
|
||||||
|
self.path_prefix = None
|
||||||
|
|
||||||
def get_comment(
|
def get_comment(
|
||||||
self,
|
self,
|
||||||
|
|
@ -1023,6 +1291,27 @@ class RougailConvert(ParserVariable):
|
||||||
comment = comment.value[1:].strip()
|
comment = comment.value[1:].strip()
|
||||||
return comment
|
return comment
|
||||||
|
|
||||||
|
def parse_variable_file(
|
||||||
|
self,
|
||||||
|
filename: str,
|
||||||
|
path: str,
|
||||||
|
) -> None:
|
||||||
|
"""Parse file"""
|
||||||
|
with open(filename, encoding="utf8") as file_fh:
|
||||||
|
objects = self.yaml.load(file_fh)
|
||||||
|
version = self.validate_file_version(
|
||||||
|
objects,
|
||||||
|
filename,
|
||||||
|
)
|
||||||
|
if objects is None:
|
||||||
|
return
|
||||||
|
self.parse_root_file(
|
||||||
|
filename,
|
||||||
|
path,
|
||||||
|
version,
|
||||||
|
objects,
|
||||||
|
)
|
||||||
|
|
||||||
def parse_root_file(
|
def parse_root_file(
|
||||||
self,
|
self,
|
||||||
filename: str,
|
filename: str,
|
||||||
|
|
@ -1041,6 +1330,38 @@ class RougailConvert(ParserVariable):
|
||||||
comment,
|
comment,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def get_sorted_filename(
|
||||||
|
self,
|
||||||
|
directories: Union[str, List[str]],
|
||||||
|
) -> Iterator[str]:
|
||||||
|
"""Sort filename"""
|
||||||
|
if not isinstance(directories, list):
|
||||||
|
directories = [directories]
|
||||||
|
if self.sort_dictionaries_all:
|
||||||
|
filenames = {}
|
||||||
|
for directory_name in directories:
|
||||||
|
directory = Path(directory_name)
|
||||||
|
if not directory.is_dir():
|
||||||
|
continue
|
||||||
|
if not self.sort_dictionaries_all:
|
||||||
|
filenames = {}
|
||||||
|
for file_path in directory.iterdir():
|
||||||
|
if file_path.suffix not in [".yml", ".yaml"]:
|
||||||
|
continue
|
||||||
|
if file_path.name in filenames:
|
||||||
|
raise DictConsistencyError(
|
||||||
|
_("duplicate dictionary file name {0}").format(file_path.name),
|
||||||
|
78,
|
||||||
|
[filenames[file_path.name][1]],
|
||||||
|
)
|
||||||
|
filenames[file_path.name] = str(file_path)
|
||||||
|
if not self.sort_dictionaries_all:
|
||||||
|
for filename in sorted(filenames):
|
||||||
|
yield filenames[filename]
|
||||||
|
if self.sort_dictionaries_all:
|
||||||
|
for filename in sorted(filenames):
|
||||||
|
yield filenames[filename]
|
||||||
|
|
||||||
def validate_file_version(
|
def validate_file_version(
|
||||||
self,
|
self,
|
||||||
obj: dict,
|
obj: dict,
|
||||||
|
|
@ -1073,7 +1394,6 @@ class RougailConvert(ParserVariable):
|
||||||
):
|
):
|
||||||
"""Apply annotation"""
|
"""Apply annotation"""
|
||||||
if not self.paths.has_value():
|
if not self.paths.has_value():
|
||||||
self.init()
|
|
||||||
self.parse_directories()
|
self.parse_directories()
|
||||||
if self.annotator:
|
if self.annotator:
|
||||||
raise DictConsistencyError(
|
raise DictConsistencyError(
|
||||||
|
|
@ -1082,13 +1402,6 @@ class RougailConvert(ParserVariable):
|
||||||
SpaceAnnotator(self)
|
SpaceAnnotator(self)
|
||||||
self.annotator = True
|
self.annotator = True
|
||||||
|
|
||||||
def parse_directories(self) -> None:
|
|
||||||
if not self.walker:
|
|
||||||
msg = _("cannot find walker in structural {0}!").format(self.structurals)
|
|
||||||
raise DictConsistencyError(msg, 51, None)
|
|
||||||
self.init()
|
|
||||||
self.walker(self)
|
|
||||||
|
|
||||||
def reflect(self) -> None:
|
def reflect(self) -> None:
|
||||||
"""Apply TiramisuReflector"""
|
"""Apply TiramisuReflector"""
|
||||||
functions_files = [
|
functions_files = [
|
||||||
|
|
@ -1101,13 +1414,13 @@ class RougailConvert(ParserVariable):
|
||||||
|
|
||||||
def save(
|
def save(
|
||||||
self,
|
self,
|
||||||
|
filename: str,
|
||||||
):
|
):
|
||||||
"""Return tiramisu object declaration as a string"""
|
"""Return tiramisu object declaration as a string"""
|
||||||
self.init()
|
self._init()
|
||||||
self.annotate()
|
self.annotate()
|
||||||
self.reflect()
|
self.reflect()
|
||||||
output = self.reflector.get_text() + "\n"
|
output = self.reflector.get_text() + "\n"
|
||||||
filename = self.tiramisu_cache
|
|
||||||
if filename:
|
if filename:
|
||||||
with open(filename, "w", encoding="utf-8") as tiramisu:
|
with open(filename, "w", encoding="utf-8") as tiramisu:
|
||||||
tiramisu.write(output)
|
tiramisu.write(output)
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@ class DictConsistencyError(Exception):
|
||||||
self.errno = errno
|
self.errno = errno
|
||||||
|
|
||||||
|
|
||||||
|
class UpgradeError(Exception):
|
||||||
|
"""Error during XML upgrade"""
|
||||||
|
|
||||||
|
|
||||||
## ---- generic exceptions ----
|
## ---- generic exceptions ----
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -27,7 +27,7 @@ from pydantic import (
|
||||||
ConfigDict,
|
ConfigDict,
|
||||||
)
|
)
|
||||||
from tiramisu import undefined
|
from tiramisu import undefined
|
||||||
from .utils import get_jinja_variable_to_param
|
from .utils import get_jinja_variable_to_param, get_realpath
|
||||||
from .error import DictConsistencyError, VariableCalculationDependencyError
|
from .error import DictConsistencyError, VariableCalculationDependencyError
|
||||||
|
|
||||||
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
|
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
|
||||||
|
|
@ -178,6 +178,7 @@ PARAM_TYPES = {
|
||||||
|
|
||||||
|
|
||||||
class Calculation(BaseModel):
|
class Calculation(BaseModel):
|
||||||
|
path_prefix: Optional[str]
|
||||||
path: str
|
path: str
|
||||||
inside_list: bool
|
inside_list: bool
|
||||||
version: str
|
version: str
|
||||||
|
|
@ -188,6 +189,12 @@ class Calculation(BaseModel):
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid")
|
model_config = ConfigDict(extra="forbid")
|
||||||
|
|
||||||
|
def get_realpath(
|
||||||
|
self,
|
||||||
|
path: str,
|
||||||
|
) -> str:
|
||||||
|
return get_realpath(path, self.path_prefix)
|
||||||
|
|
||||||
def get_params(self, objectspace):
|
def get_params(self, objectspace):
|
||||||
if not self.params:
|
if not self.params:
|
||||||
return {}
|
return {}
|
||||||
|
|
@ -201,6 +208,7 @@ class Calculation(BaseModel):
|
||||||
path = self.ori_path
|
path = self.ori_path
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
param["variable"],
|
param["variable"],
|
||||||
|
self.path_prefix,
|
||||||
path,
|
path,
|
||||||
self.version,
|
self.version,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
|
|
@ -212,12 +220,7 @@ class Calculation(BaseModel):
|
||||||
raise DictConsistencyError(msg, 22, self.xmlfiles)
|
raise DictConsistencyError(msg, 22, self.xmlfiles)
|
||||||
continue
|
continue
|
||||||
if not isinstance(variable, objectspace.variable):
|
if not isinstance(variable, objectspace.variable):
|
||||||
if isinstance(variable, objectspace.family):
|
raise Exception("pfff it's a family")
|
||||||
msg = f'the variable "{variable["name"]}" is in fact a family in attribute "{self.attribute_name}" for "{self.path}"'
|
|
||||||
raise DictConsistencyError(msg, 42, self.xmlfiles)
|
|
||||||
else:
|
|
||||||
msg = f'unknown object "{variable}" in attribute "{self.attribute_name}" for "{self.path}"'
|
|
||||||
raise DictConsistencyError(msg, 44, self.xmlfiles)
|
|
||||||
param["variable"] = variable
|
param["variable"] = variable
|
||||||
if identifier:
|
if identifier:
|
||||||
param["identifier"] = identifier
|
param["identifier"] = identifier
|
||||||
|
|
@ -229,6 +232,7 @@ class Calculation(BaseModel):
|
||||||
path = self.ori_path
|
path = self.ori_path
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
param["variable"],
|
param["variable"],
|
||||||
|
self.path_prefix,
|
||||||
path,
|
path,
|
||||||
self.version,
|
self.version,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
|
|
@ -310,6 +314,7 @@ class JinjaCalculation(Calculation):
|
||||||
objectspace,
|
objectspace,
|
||||||
variable.xmlfiles,
|
variable.xmlfiles,
|
||||||
objectspace.functions,
|
objectspace.functions,
|
||||||
|
self.path_prefix,
|
||||||
self.version,
|
self.version,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
):
|
):
|
||||||
|
|
@ -408,18 +413,15 @@ class _VariableCalculation(Calculation):
|
||||||
path = self.ori_path
|
path = self.ori_path
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
self.variable,
|
self.variable,
|
||||||
|
self.path_prefix,
|
||||||
path,
|
path,
|
||||||
self.version,
|
self.version,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
self.xmlfiles,
|
self.xmlfiles,
|
||||||
)
|
)
|
||||||
if variable and not isinstance(variable, objectspace.variable):
|
if variable and not isinstance(variable, objectspace.variable):
|
||||||
if isinstance(variable, objectspace.family):
|
# FIXME remove the pfff
|
||||||
msg = f'the variable "{variable.path}" is in fact a family in attribute "{self.attribute_name}" for "{self.path}"'
|
raise Exception("pfff it's a family")
|
||||||
raise DictConsistencyError(msg, 47, self.xmlfiles)
|
|
||||||
else:
|
|
||||||
msg = f'unknown object "{variable}" in attribute "{self.attribute_name}" for "{self.path}"'
|
|
||||||
raise DictConsistencyError(msg, 48, self.xmlfiles)
|
|
||||||
return variable, identifier
|
return variable, identifier
|
||||||
|
|
||||||
def get_params(
|
def get_params(
|
||||||
|
|
@ -432,13 +434,9 @@ class _VariableCalculation(Calculation):
|
||||||
):
|
):
|
||||||
if not variable:
|
if not variable:
|
||||||
if not objectspace.force_optional:
|
if not objectspace.force_optional:
|
||||||
if self.ori_path is None:
|
msg = f'Variable not found "{self.variable}" for attribut "{self.attribute_name}" for variable "{self.path}"'
|
||||||
path = self.path
|
|
||||||
else:
|
|
||||||
path = self.ori_path
|
|
||||||
msg = f'Variable not found "{self.variable}" for attribut "{self.attribute_name}" in variable "{path}"'
|
|
||||||
raise DictConsistencyError(msg, 88, self.xmlfiles)
|
raise DictConsistencyError(msg, 88, self.xmlfiles)
|
||||||
return {None: [["example"]]}
|
return {None: [['example']]}
|
||||||
param = {
|
param = {
|
||||||
"type": "variable",
|
"type": "variable",
|
||||||
"variable": variable,
|
"variable": variable,
|
||||||
|
|
@ -499,7 +497,7 @@ class _VariableCalculation(Calculation):
|
||||||
multi = objectspace.multis[self.path] == "submulti"
|
multi = objectspace.multis[self.path] == "submulti"
|
||||||
else:
|
else:
|
||||||
multi = self.path in objectspace.multis
|
multi = self.path in objectspace.multis
|
||||||
if multi and not self.inside_list:
|
if multi:
|
||||||
params["__internal_multi"] = True
|
params["__internal_multi"] = True
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
@ -516,11 +514,7 @@ class VariableCalculation(_VariableCalculation):
|
||||||
msg = f'"{self.attribute_name}" variable shall not have an "optional" attribute for variable "{self.variable}"'
|
msg = f'"{self.attribute_name}" variable shall not have an "optional" attribute for variable "{self.variable}"'
|
||||||
raise DictConsistencyError(msg, 33, self.xmlfiles)
|
raise DictConsistencyError(msg, 33, self.xmlfiles)
|
||||||
variable, identifier = self.get_variable(objectspace)
|
variable, identifier = self.get_variable(objectspace)
|
||||||
if (
|
if not variable and self.optional or (objectspace.force_optional and self.attribute_name == "default"):
|
||||||
not variable
|
|
||||||
and self.optional
|
|
||||||
or (objectspace.force_optional and self.attribute_name == "default")
|
|
||||||
):
|
|
||||||
raise VariableCalculationDependencyError()
|
raise VariableCalculationDependencyError()
|
||||||
params = self.get_params(
|
params = self.get_params(
|
||||||
objectspace,
|
objectspace,
|
||||||
|
|
@ -606,6 +600,7 @@ class InformationCalculation(Calculation):
|
||||||
path = self.ori_path
|
path = self.ori_path
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
self.variable,
|
self.variable,
|
||||||
|
self.path_prefix,
|
||||||
path,
|
path,
|
||||||
self.version,
|
self.version,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
|
|
@ -709,16 +704,16 @@ class IndexCalculation(Calculation):
|
||||||
|
|
||||||
CALCULATION_TYPES = {
|
CALCULATION_TYPES = {
|
||||||
"jinja": JinjaCalculation,
|
"jinja": JinjaCalculation,
|
||||||
"information": InformationCalculation,
|
|
||||||
"variable": VariableCalculation,
|
"variable": VariableCalculation,
|
||||||
|
"information": InformationCalculation,
|
||||||
"identifier": IdentifierCalculation,
|
"identifier": IdentifierCalculation,
|
||||||
"suffix": IdentifierCalculation,
|
"suffix": IdentifierCalculation,
|
||||||
"index": IndexCalculation,
|
"index": IndexCalculation,
|
||||||
}
|
}
|
||||||
CALCULATION_PROPERTY_TYPES = {
|
CALCULATION_PROPERTY_TYPES = {
|
||||||
"jinja": JinjaCalculation,
|
"jinja": JinjaCalculation,
|
||||||
"information": InformationCalculation,
|
|
||||||
"variable": VariablePropertyCalculation,
|
"variable": VariablePropertyCalculation,
|
||||||
|
"information": InformationCalculation,
|
||||||
"identifier": IdentifierPropertyCalculation,
|
"identifier": IdentifierPropertyCalculation,
|
||||||
"index": IndexCalculation,
|
"index": IndexCalculation,
|
||||||
}
|
}
|
||||||
|
|
@ -727,18 +722,14 @@ BASETYPE_CALC = Union[StrictBool, StrictInt, StrictFloat, StrictStr, Calculation
|
||||||
|
|
||||||
class Family(BaseModel):
|
class Family(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
# informations
|
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
|
type: Literal["family", "leadership", "dynamic"] = "family"
|
||||||
|
path: str
|
||||||
help: Optional[str] = None
|
help: Optional[str] = None
|
||||||
mode: Optional[str] = None
|
mode: Optional[str] = None
|
||||||
# validation
|
|
||||||
type: Literal["family", "leadership", "dynamic"] = "family"
|
|
||||||
# properties
|
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
disabled: Union[bool, Calculation] = False
|
disabled: Union[bool, Calculation] = False
|
||||||
# others
|
|
||||||
namespace: Optional[str]
|
namespace: Optional[str]
|
||||||
path: str
|
|
||||||
version: str
|
version: str
|
||||||
xmlfiles: List[str] = []
|
xmlfiles: List[str] = []
|
||||||
|
|
||||||
|
|
@ -752,34 +743,30 @@ class Dynamic(Family):
|
||||||
|
|
||||||
|
|
||||||
class Variable(BaseModel):
|
class Variable(BaseModel):
|
||||||
name: str
|
# type will be set dynamically in `annotator/value.py`, default is None
|
||||||
# user informations
|
|
||||||
description: Optional[str] = None
|
|
||||||
help: Optional[str] = None
|
|
||||||
mode: Optional[str] = None
|
|
||||||
examples: Optional[list] = None
|
|
||||||
test: Optional[list] = None
|
|
||||||
# validations
|
|
||||||
## type will be set dynamically in `annotator/value.py`, default is None
|
|
||||||
type: str = None
|
type: str = None
|
||||||
params: Optional[List[Param]] = None
|
name: str
|
||||||
regexp: Optional[str] = None
|
description: Optional[str] = None
|
||||||
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
|
||||||
multi: Optional[bool] = None
|
|
||||||
validators: Optional[List[Calculation]] = None
|
|
||||||
# value
|
|
||||||
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
||||||
# properties
|
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
||||||
auto_save: bool = False
|
regexp: Optional[str] = None
|
||||||
mandatory: Union[None, bool, Calculation] = None
|
params: Optional[List[Param]] = None
|
||||||
empty: Union[None, bool, Calculation] = True
|
validators: Optional[List[Calculation]] = None
|
||||||
|
multi: Optional[bool] = None
|
||||||
unique: Optional[bool] = None
|
unique: Optional[bool] = None
|
||||||
|
help: Optional[str] = None
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
disabled: Union[bool, Calculation] = False
|
disabled: Union[bool, Calculation] = False
|
||||||
# others
|
mandatory: Union[None, bool, Calculation] = None
|
||||||
|
empty: Union[None, bool, Calculation] = True
|
||||||
|
auto_save: bool = False
|
||||||
|
mode: Optional[str] = None
|
||||||
|
test: Optional[list] = None
|
||||||
|
examples: Optional[list] = None
|
||||||
path: str
|
path: str
|
||||||
namespace: Optional[str]
|
namespace: Optional[str]
|
||||||
version: str
|
version: str
|
||||||
|
path_prefix: Optional[str]
|
||||||
xmlfiles: List[str] = []
|
xmlfiles: List[str] = []
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||||
|
|
@ -792,6 +779,7 @@ class SymLink(BaseModel):
|
||||||
opt: Variable
|
opt: Variable
|
||||||
namespace: Optional[str]
|
namespace: Optional[str]
|
||||||
version: str
|
version: str
|
||||||
|
path_prefix: Optional[str]
|
||||||
xmlfiles: List[str] = []
|
xmlfiles: List[str] = []
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid")
|
model_config = ConfigDict(extra="forbid")
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
"""
|
|
||||||
Silique (https://www.silique.fr)
|
|
||||||
Copyright (C) 2024
|
|
||||||
|
|
||||||
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 .object_model import Variable, Family
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ("Variable", "Family")
|
|
||||||
|
|
@ -27,13 +27,12 @@ def get_rougail_config(
|
||||||
structural_commandline:
|
structural_commandline:
|
||||||
description: Configuration rougail-structural_commandline
|
description: Configuration rougail-structural_commandline
|
||||||
commandline: false
|
commandline: false
|
||||||
|
|
||||||
add_extra_options:
|
add_extra_options:
|
||||||
description: Add extra options to tiramisu-cmdline-parser
|
description: Add extra options to tiramisu-cmdline-parser
|
||||||
default: true
|
default: true
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
"name": "cmdline",
|
"name": "exporter",
|
||||||
"process": "structural",
|
"process": "structural",
|
||||||
"options": options,
|
"options": options,
|
||||||
"level": 20,
|
"level": 20,
|
||||||
|
|
|
||||||
|
|
@ -29,3 +29,6 @@ class Variable(BaseModel):
|
||||||
|
|
||||||
class Family(BaseModel):
|
class Family(BaseModel):
|
||||||
commandline: bool = True
|
commandline: bool = True
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ("Variable", "Family")
|
||||||
|
|
|
||||||
|
|
@ -127,9 +127,7 @@ def jinja_to_function(
|
||||||
c_kw = kw
|
c_kw = kw
|
||||||
path, var = key.rsplit(".", 1)
|
path, var = key.rsplit(".", 1)
|
||||||
if isinstance(value, CancelParam):
|
if isinstance(value, CancelParam):
|
||||||
count_o_path = value.origin_path.count(".") - value.current_path.count(
|
count_o_path = value.origin_path.count('.') - value.current_path.count('.')
|
||||||
"."
|
|
||||||
)
|
|
||||||
path = path.rsplit(".", count_o_path)[0]
|
path = path.rsplit(".", count_o_path)[0]
|
||||||
for subkey in path.split("."):
|
for subkey in path.split("."):
|
||||||
c_kw = c_kw.setdefault(subkey, {})
|
c_kw = c_kw.setdefault(subkey, {})
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class TiramisuReflector:
|
||||||
continue
|
continue
|
||||||
self.text["header"].append(f"load_functions('{funcs_path}')")
|
self.text["header"].append(f"load_functions('{funcs_path}')")
|
||||||
if self.objectspace.export_with_import:
|
if self.objectspace.export_with_import:
|
||||||
if self.objectspace.has_namespace:
|
if objectspace.main_namespace:
|
||||||
self.text["header"].extend(
|
self.text["header"].extend(
|
||||||
[
|
[
|
||||||
"try:",
|
"try:",
|
||||||
|
|
@ -372,11 +372,6 @@ class Common:
|
||||||
)
|
)
|
||||||
params = [f"{option_name}"]
|
params = [f"{option_name}"]
|
||||||
if identifier is not None:
|
if identifier is not None:
|
||||||
if not self.objectspace.paths.is_dynamic(variable.path):
|
|
||||||
msg = _("internal error, {0} is not a dynamic variable").format(
|
|
||||||
variable.path
|
|
||||||
)
|
|
||||||
raise DictConsistencyError(msg, 49, self.elt.xmlfiles)
|
|
||||||
param_type = "ParamDynOption"
|
param_type = "ParamDynOption"
|
||||||
identifiers = []
|
identifiers = []
|
||||||
for ident in identifier:
|
for ident in identifier:
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
||||||
"""
|
"""
|
||||||
Silique (https://www.silique.fr)
|
Silique (https://www.silique.fr)
|
||||||
Copyright (C) 2022-2024
|
Copyright (C) 2024
|
||||||
|
|
||||||
distribued with GPL-2 or later license
|
distribued with GPL-2 or later license
|
||||||
|
|
||||||
|
|
@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
from re import findall
|
from re import findall
|
||||||
|
|
||||||
|
|
@ -77,7 +76,8 @@ class UserDatas:
|
||||||
self._not_found_is_dynamic(self.config, path, cache, added)
|
self._not_found_is_dynamic(self.config, path, cache, added)
|
||||||
|
|
||||||
def _not_found_is_dynamic(self, config, path, cache, added):
|
def _not_found_is_dynamic(self, config, path, cache, added):
|
||||||
"""if path is not found, check if parent is a dynamic family"""
|
"""if path is not found, check if parent is a dynamic family
|
||||||
|
"""
|
||||||
current_path = ""
|
current_path = ""
|
||||||
identifiers = []
|
identifiers = []
|
||||||
# get parent
|
# get parent
|
||||||
|
|
@ -102,7 +102,9 @@ class UserDatas:
|
||||||
if not tconfig.isdynamic(only_self=True):
|
if not tconfig.isdynamic(only_self=True):
|
||||||
# it's not a dynamic variable
|
# it's not a dynamic variable
|
||||||
continue
|
continue
|
||||||
identifier = self._get_identifier(tconfig.name(), name)
|
identifier = self._get_identifier(
|
||||||
|
tconfig.name(), name
|
||||||
|
)
|
||||||
if identifier is None:
|
if identifier is None:
|
||||||
# it's a dynamic variable but doesn't match the current name
|
# it's a dynamic variable but doesn't match the current name
|
||||||
continue
|
continue
|
||||||
|
|
@ -114,12 +116,10 @@ class UserDatas:
|
||||||
# it's the good dynamic variable but it's not linked to a variable
|
# it's the good dynamic variable but it's not linked to a variable
|
||||||
# so cannot change the variable
|
# so cannot change the variable
|
||||||
continue
|
continue
|
||||||
option_type = self.config.option(dynamic_variable).information.get(
|
option_type = self.config.option(
|
||||||
"type"
|
dynamic_variable
|
||||||
)
|
).information.get("type")
|
||||||
dyn_options_values = (
|
dyn_options_values = self.config.option(dynamic_variable).get().impl_getdefault()
|
||||||
self.config.option(dynamic_variable).get().impl_getdefault()
|
|
||||||
)
|
|
||||||
if "{{ identifier }}" in dynamic_variable:
|
if "{{ identifier }}" in dynamic_variable:
|
||||||
for s in identifiers:
|
for s in identifiers:
|
||||||
dynamic_variable = dynamic_variable.replace(
|
dynamic_variable = dynamic_variable.replace(
|
||||||
|
|
@ -132,11 +132,18 @@ class UserDatas:
|
||||||
continue
|
continue
|
||||||
config = tconfig
|
config = tconfig
|
||||||
identifiers.append(identifier)
|
identifiers.append(identifier)
|
||||||
typ = CONVERT_OPTION.get(option_type, {}).get("func")
|
typ = CONVERT_OPTION.get(option_type, {}).get(
|
||||||
|
"func"
|
||||||
|
)
|
||||||
if typ:
|
if typ:
|
||||||
identifier = typ(identifier)
|
identifier = typ(identifier)
|
||||||
if identifier not in self.values[dynamic_variable]["values"]:
|
if (
|
||||||
self.values[dynamic_variable]["values"].append(identifier)
|
identifier
|
||||||
|
not in self.values[dynamic_variable]["values"]
|
||||||
|
):
|
||||||
|
self.values[dynamic_variable]["values"].append(
|
||||||
|
identifier
|
||||||
|
)
|
||||||
cache[current_path] = config, identifier
|
cache[current_path] = config, identifier
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
@ -204,11 +211,6 @@ class UserDatas:
|
||||||
for path, data in self.values.items():
|
for path, data in self.values.items():
|
||||||
try:
|
try:
|
||||||
option = self.config.option(path)
|
option = self.config.option(path)
|
||||||
if option.isoptiondescription():
|
|
||||||
self.errors.append(
|
|
||||||
f'the option "{option.path()}" is an option description'
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
value = data["values"]
|
value = data["values"]
|
||||||
if option.isfollower():
|
if option.isfollower():
|
||||||
for index, val in enumerate(value):
|
for index, val in enumerate(value):
|
||||||
|
|
@ -229,7 +231,7 @@ def convert_value(option, value):
|
||||||
if value == "":
|
if value == "":
|
||||||
return None
|
return None
|
||||||
option_type = option.information.get("type")
|
option_type = option.information.get("type")
|
||||||
if option_type == "choice":
|
if option_type == 'choice':
|
||||||
choices = option.value.list()
|
choices = option.value.list()
|
||||||
if value not in choices and isinstance(value, str):
|
if value not in choices and isinstance(value, str):
|
||||||
# FIXME add other tests (boolean, float, ...)
|
# FIXME add other tests (boolean, float, ...)
|
||||||
|
|
|
||||||
|
|
@ -78,10 +78,13 @@ def load_modules(name, module) -> List[str]:
|
||||||
return eosfunc
|
return eosfunc
|
||||||
|
|
||||||
|
|
||||||
# def get_realpath(
|
def get_realpath(
|
||||||
# path: str,
|
path: str,
|
||||||
# ) -> str:
|
path_prefix: str,
|
||||||
# return path
|
) -> str:
|
||||||
|
if path_prefix:
|
||||||
|
return f"{path_prefix}.{path}"
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
def get_jinja_variable_to_param(
|
def get_jinja_variable_to_param(
|
||||||
|
|
@ -90,6 +93,7 @@ def get_jinja_variable_to_param(
|
||||||
objectspace,
|
objectspace,
|
||||||
xmlfiles,
|
xmlfiles,
|
||||||
functions,
|
functions,
|
||||||
|
path_prefix,
|
||||||
version,
|
version,
|
||||||
namespace,
|
namespace,
|
||||||
):
|
):
|
||||||
|
|
@ -121,6 +125,7 @@ def get_jinja_variable_to_param(
|
||||||
for variable_path in variables:
|
for variable_path in variables:
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
variable_path,
|
variable_path,
|
||||||
|
path_prefix,
|
||||||
current_path,
|
current_path,
|
||||||
version,
|
version,
|
||||||
namespace,
|
namespace,
|
||||||
|
|
@ -147,6 +152,7 @@ def get_jinja_variable_to_param(
|
||||||
vpath = vpath.rsplit(".", 1)[0]
|
vpath = vpath.rsplit(".", 1)[0]
|
||||||
variable, identifier = objectspace.paths.get_with_dynamic(
|
variable, identifier = objectspace.paths.get_with_dynamic(
|
||||||
vpath,
|
vpath,
|
||||||
|
path_prefix,
|
||||||
current_path,
|
current_path,
|
||||||
version,
|
version,
|
||||||
namespace,
|
namespace,
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,6 @@ except:
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[], properties=frozenset({"advanced"}))
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[], properties=frozenset({"advanced"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
optiondescription_2 = OptionDescription(name="2", doc="2", children=[], properties=frozenset({"advanced"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_2])
|
||||||
19
tests/dictionaries/00_0version_underscore/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_0version_underscore/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="version", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_6 = StrOption(name="version", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/00_1empty_variable/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_1empty_variable/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="empty", doc="empty", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_6 = StrOption(name="empty", doc="empty", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
23
tests/dictionaries/00_2default_calculated/tiramisu/multi.py
Normal file
23
tests/dictionaries/00_2default_calculated/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var2'] = "{{ _.var1 }}\n"
|
||||||
|
dict_env['default_2.rougail.var2'] = "{{ _.var1 }}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_2default_calculated/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var2"), '_.var1': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_2default_calculated/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var2"), '_.var1': ParamOption(option_7, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var2'] = "{% for val in _.var1 %}\n{{ val }}\n{% endfor %}\n"
|
||||||
|
dict_env['default_2.rougail.var2'] = "{% for val in _.var1 %}\n{{ val }}\n{% endfor %}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", multi=True, default=["no", "yes", "maybe"], default_multi="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_2default_calculated_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var2"), '_.var1': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", multi=True, default=["no", "yes", "maybe"], default_multi="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_2default_calculated_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var2"), '_.var1': ParamOption(option_7, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = DomainnameOption(name="var1", doc="a first variable", multi=True, type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'domainname'})
|
||||||
|
option_4 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = DomainnameOption(name="var1", doc="a first variable", multi=True, type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'domainname'})
|
||||||
|
option_8 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_7)), kwargs={'__internal_multi': ParamValue(True)})), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
21
tests/dictionaries/00_4load_subfolder/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_4load_subfolder/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
19
tests/dictionaries/00_5load_notype/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_5load_notype/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="without_type", doc="a variable", default="non", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="without_type", doc="a variable", default="non", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
29
tests/dictionaries/00_6boolean/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6boolean/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = BoolOption(name="var1", doc="the first variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_4 = BoolOption(name="var2", doc="the second variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_5 = BoolOption(name="var3", doc="the third variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_6 = BoolOption(name="var4", doc="the forth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_7 = BoolOption(name="var5", doc="the fifth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_8 = BoolOption(name="var6", doc="the sixth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_11 = BoolOption(name="var1", doc="the first variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_12 = BoolOption(name="var2", doc="the second variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_13 = BoolOption(name="var3", doc="the third variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_14 = BoolOption(name="var4", doc="the forth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_15 = BoolOption(name="var5", doc="the fifth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_16 = BoolOption(name="var6", doc="the sixth variable", default=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = BoolOption(name="variable", doc="a variable", default=True, properties=frozenset({"standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = BoolOption(name="variable", doc="a variable", default=True, properties=frozenset({"standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
29
tests/dictionaries/00_6choice/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6choice/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = ChoiceOption(name="var1", doc="the first variable", values=("a", "b", "c"), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_4 = ChoiceOption(name="var2", doc="the second variable", values=("a", "b", "c"), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_5 = ChoiceOption(name="var3", doc="the third variable", values=("a", "b", "c", None), properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
option_6 = ChoiceOption(name="var4", doc="the forth variable", values=(None, "b", "c"), properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
option_7 = ChoiceOption(name="var5", doc="the fifth variable", values=("a", "b", "c"), default="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
option_8 = ChoiceOption(name="var6", doc="the sixth variable", values=(1, 2, 3), default=1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_11 = ChoiceOption(name="var1", doc="the first variable", values=("a", "b", "c"), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_12 = ChoiceOption(name="var2", doc="the second variable", values=("a", "b", "c"), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_13 = ChoiceOption(name="var3", doc="the third variable", values=("a", "b", "c", None), properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
option_14 = ChoiceOption(name="var4", doc="the forth variable", values=(None, "b", "c"), properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
option_15 = ChoiceOption(name="var5", doc="the fifth variable", values=("a", "b", "c"), default="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
option_16 = ChoiceOption(name="var6", doc="the sixth variable", values=(1, 2, 3), default=1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
21
tests/dictionaries/00_6choice_calculation/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_6choice_calculation/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['choices_1.rougail.var'] = "{% for n in trange(0, 10) %}\n{{ n }}\n{% endfor %}\n"
|
||||||
|
dict_env['choices_2.rougail.var'] = "{% for n in trange(0, 10) %}\n{{ n }}\n{% endfor %}\n"
|
||||||
|
option_3 = ChoiceOption(name="var", doc="a variable", values=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("choices_1.rougail.var"), '__internal_type': ParamValue("number"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_6choice_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("choices"), '__internal_variable': ParamValue("1.rougail.var")})), default=9, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = ChoiceOption(name="var", doc="a variable", values=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("choices_2.rougail.var"), '__internal_type': ParamValue("number"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_6choice_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("choices"), '__internal_variable': ParamValue("2.rougail.var")})), default=9, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
21
tests/dictionaries/00_6choice_variable/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_6choice_variable/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="a second variable", multi=True, default=["a", "b", "c"], default_multi="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = ChoiceOption(name="var2", doc="a first variable", values=Calculation(func['calc_value'], Params((ParamOption(option_3)))), default="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a second variable", multi=True, default=["a", "b", "c"], default_multi="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = ChoiceOption(name="var2", doc="a first variable", values=Calculation(func['calc_value'], Params((ParamOption(option_7)))), default="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
21
tests/dictionaries/00_6custom/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_6custom/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = CustomOption(name="custom1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'custom'})
|
||||||
|
option_4 = CustomOption(name="custom2", doc="the seconf variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'custom'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = CustomOption(name="custom1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'custom'})
|
||||||
|
option_8 = CustomOption(name="custom2", doc="the seconf variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'custom'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
19
tests/dictionaries/00_6domainname/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_6domainname/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = DomainnameOption(name="variable", doc="a domain name variable", default="my.domain.name", type="domainname", allow_ip=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = DomainnameOption(name="variable", doc="a domain name variable", default="my.domain.name", type="domainname", allow_ip=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/00_6domainname_params/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_6domainname_params/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = DomainnameOption(name="variable", doc="a domain name variable", default="my.domain.name", type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = DomainnameOption(name="variable", doc="a domain name variable", default="my.domain.name", type="domainname", allow_ip=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'domainname'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
29
tests/dictionaries/00_6float/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6float/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = FloatOption(name="var1", doc="the first variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_4 = FloatOption(name="var2", doc="the second variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_5 = FloatOption(name="var3", doc="the third variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_6 = FloatOption(name="var4", doc="the forth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_7 = FloatOption(name="var5", doc="the fifth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_8 = FloatOption(name="var6", doc="the sixth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_11 = FloatOption(name="var1", doc="the first variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_12 = FloatOption(name="var2", doc="the second variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_13 = FloatOption(name="var3", doc="the third variable", default=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_14 = FloatOption(name="var4", doc="the forth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_15 = FloatOption(name="var5", doc="the fifth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_16 = FloatOption(name="var6", doc="the sixth variable", default=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
29
tests/dictionaries/00_6number/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6number/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = IntOption(name="var1", doc="the first variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_4 = IntOption(name="var2", doc="the second variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_5 = IntOption(name="var3", doc="the third variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_6 = IntOption(name="var4", doc="this forth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_7 = IntOption(name="var5", doc="the fifth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_8 = IntOption(name="var6", doc="the sixth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_11 = IntOption(name="var1", doc="the first variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_12 = IntOption(name="var2", doc="the second variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_13 = IntOption(name="var3", doc="the third variable", default=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_14 = IntOption(name="var4", doc="this forth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_15 = IntOption(name="var5", doc="the fifth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_16 = IntOption(name="var6", doc="the sixth variable", default=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
23
tests/dictionaries/00_6port/tiramisu/multi.py
Normal file
23
tests/dictionaries/00_6port/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = PortOption(name="variable1", doc="a port variable", allow_private=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'port'})
|
||||||
|
option_4 = PortOption(name="variable2", doc="a port variable with default value", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'port'})
|
||||||
|
option_5 = PortOption(name="variable3", doc="a port variable with integer default value", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'port'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_8 = PortOption(name="variable1", doc="a port variable", allow_private=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'port'})
|
||||||
|
option_9 = PortOption(name="variable2", doc="a port variable with default value", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'port'})
|
||||||
|
option_10 = PortOption(name="variable3", doc="a port variable with integer default value", default="8080", allow_private=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'port'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, option_9, option_10], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
29
tests/dictionaries/00_6regexp/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6regexp/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
class Regexp_option_3(RegexpOption):
|
||||||
|
__slots__ = tuple()
|
||||||
|
_type = 'value'
|
||||||
|
Regexp_option_3._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
||||||
|
|
||||||
|
class Regexp_option_6(RegexpOption):
|
||||||
|
__slots__ = tuple()
|
||||||
|
_type = 'value'
|
||||||
|
Regexp_option_6._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
|
||||||
|
|
||||||
|
option_3 = Regexp_option_3(name="var", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = Regexp_option_6(name="var", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp', 'test': ('#b1b1b1', '#b2b2b2')})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
29
tests/dictionaries/00_6string/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_6string/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="the second variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_6 = StrOption(name="var4", doc="the forth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_7 = StrOption(name="var5", doc="the fifth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var6", doc="the sixth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_11 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_12 = StrOption(name="var2", doc="the second variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_13 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_14 = StrOption(name="var4", doc="the forth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_15 = StrOption(name="var5", doc="the fifth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_16 = StrOption(name="var6", doc="the sixth variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
19
tests/dictionaries/00_7choice_quote/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_7choice_quote/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = ChoiceOption(name="var", doc="A choice", values=("quote'", "quote\"", "quote\"'"), default="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = ChoiceOption(name="var", doc="A choice", values=("quote'", "quote\"", "quote\"'"), default="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
21
tests/dictionaries/00_7help_quote/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_7help_quote/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'help': "message with '"})
|
||||||
|
option_4 = StrOption(name="var2", doc="the second variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'help': 'message with "'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'help': "message with '"})
|
||||||
|
option_8 = StrOption(name="var2", doc="the second variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'help': 'message with "'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
19
tests/dictionaries/00_7value_doublequote/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_7value_doublequote/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="quote\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default="quote\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/00_7value_doublequote2/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_7value_doublequote2/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="quote'\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default="quote'\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/00_7value_doublequote3/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_7value_doublequote3/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="quote\\\"\\'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default="quote\\\"\\'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/00_7value_quote/tiramisu/multi.py
Normal file
19
tests/dictionaries/00_7value_quote/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.variable'] = "{{test_information }}\n"
|
||||||
|
dict_env['default_2.rougail.variable'] = "{{test_information }}\n"
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_8calculation_information/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.variable"), 'test_information': ParamInformation("test_information", None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_8calculation_information/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.variable"), 'test_information': ParamInformation("test_information", None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
29
tests/dictionaries/00_8test/tiramisu/multi.py
Normal file
29
tests/dictionaries/00_8test/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
|
option_4 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
|
option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
option_6 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
|
option_7 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
|
option_8 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_11 = StrOption(name="var1", doc="the first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
|
option_12 = StrOption(name="var2", doc="the second variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string', 'test': ('test',)})
|
||||||
|
option_13 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
option_14 = StrOption(name="var4", doc="the forth variable", properties=frozenset({"standard"}), informations={'type': 'string', 'test': (None, 'test1', 'test2')})
|
||||||
|
option_15 = BoolOption(name="var5", doc="the fifth variable", default=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean', 'test': (False,)})
|
||||||
|
option_16 = StrOption(name="var6", doc="the sixth variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string', 'test': ('test1', 'test2')})
|
||||||
|
optiondescription_10 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_11, option_12, option_13, option_14, option_15, option_16], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_9 = OptionDescription(name="2", doc="2", children=[optiondescription_10], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_9])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = ChoiceOption(name="variable1", doc="a first variable", values=("val1", "val2"), multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_4 = ChoiceOption(name="variable2", doc="a second variable", values=("val1", "val2"), multi=True, properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = ChoiceOption(name="variable1", doc="a first variable", values=("val1", "val2"), multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
option_8 = ChoiceOption(name="variable2", doc="a second variable", values=("val1", "val2"), multi=True, properties=frozenset({"standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
23
tests/dictionaries/00_9choice_variables/tiramisu/multi.py
Normal file
23
tests/dictionaries/00_9choice_variables/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="source_variable_1", doc="the first source variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="source_variable_2", doc="the second source variable", default="val2", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_5 = ChoiceOption(name="my_variable", doc="a variable", values=(Calculation(func['calc_value'], Params((ParamOption(option_3)))), Calculation(func['calc_value'], Params((ParamOption(option_4))))), default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_8 = StrOption(name="source_variable_1", doc="the first source variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_9 = StrOption(name="source_variable_2", doc="the second source variable", default="val2", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_10 = ChoiceOption(name="my_variable", doc="a variable", values=(Calculation(func['calc_value'], Params((ParamOption(option_8)))), Calculation(func['calc_value'], Params((ParamOption(option_9))))), default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, option_9, option_10], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
21
tests/dictionaries/00_9default_calculation/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_9default_calculation/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.variable'] = "{{ param1 }}_{{ param2 }}_{{ param3 }}_{{ param4 }}\n"
|
||||||
|
dict_env['default_2.rougail.variable'] = "{{ param1 }}_{{ param2 }}_{{ param3 }}_{{ param4 }}\n"
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.variable"), 'param1': ParamValue("string"), 'param2': ParamValue(1), 'param3': ParamValue(True), 'param4': ParamValue(None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.variable"), 'param1': ParamValue("string"), 'param2': ParamValue(1), 'param3': ParamValue(True), 'param4': ParamValue(None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var'] = "{{ information }}"
|
||||||
|
dict_env['default_2.rougail.var'] = "{{ information }}"
|
||||||
|
option_3 = StrOption(name="var", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_information/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var"), 'information': ParamSelfInformation("test_information", None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="var", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_information/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var"), 'information': ParamSelfInformation("test_information", None)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var2'] = "{{ information }}\n"
|
||||||
|
dict_env['default_2.rougail.var2'] = "{{ information }}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_information_other_variable/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var2"), 'information': ParamInformation("test_information", None, option=option_3)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_information_other_variable/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var2"), 'information': ParamInformation("test_information", None, option=option_7)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True)}))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)}))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_7)), kwargs={'__internal_multi': ParamValue(True)}))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_7)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1)), kwargs={'__internal_multi': ParamValue(True)}))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_1)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2))))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2)), kwargs={'__internal_multi': ParamValue(True)}))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)}))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_7)), kwargs={'__internal_multi': ParamValue(True)}))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -7,5 +7,5 @@ ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1))))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1)), kwargs={'__internal_multi': ParamValue(True)}))], properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_7)), kwargs={'__internal_multi': ParamValue(True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var1'] = "{% if var2 is defined %} {{ var2 }} {% elif var3 is defined %} {{ var3 }} {% elif var4 is defined %} {{ var4 }} {% else %} {{ _.var2 }} {% endif %} "
|
||||||
|
dict_env['default_2.rougail.var1'] = "{% if var2 is defined %} {{ var2 }} {% elif var3 is defined %} {{ var3 }} {% elif var4 is defined %} {{ var4 }} {% else %} {{ _.var2 }} {% endif %} "
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_param_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var1"), 'var2': ParamOption(option_4), '_.var2': ParamOption(option_4, notraisepropertyerror=True)})), properties=frozenset({"standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_calculation_param_optional/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var1"), 'var2': ParamOption(option_8), '_.var2': ParamOption(option_8, notraisepropertyerror=True)})), properties=frozenset({"standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamInformation("test_information", None, option=option_3)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamInformation("test_information", None, option=option_7)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": null
|
|
||||||
},
|
|
||||||
"rougail.var2": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": null,
|
|
||||||
"rougail.var2": null
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.var1": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": null
|
|
||||||
},
|
|
||||||
"rougail.var2": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
["rougail.var1", "rougail.var2"]
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from re import compile as re_compile
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
load_functions('../rougail-tests/funcs/test.py')
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_2 = StrOption(name="var1", doc="a first variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
|
||||||
option_3 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamInformation("test_information", None, option=option_2)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2, option_3], properties=frozenset({"basic"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
||||||
21
tests/dictionaries/00_9default_integer/tiramisu/multi.py
Normal file
21
tests/dictionaries/00_9default_integer/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['choices_1.rougail.var'] = "{% for item in trange(0, 10) %}\n{{ item }}\n{%- endfor %}\n"
|
||||||
|
dict_env['choices_2.rougail.var'] = "{% for item in trange(0, 10) %}\n{{ item }}\n{%- endfor %}\n"
|
||||||
|
option_3 = ChoiceOption(name="var", doc="a variable", values=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("choices_1.rougail.var"), '__internal_type': ParamValue("number"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_integer/rougail/00-base.yml']), '__internal_attribute': ParamValue("choices"), '__internal_variable': ParamValue("1.rougail.var")})), default=9, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = ChoiceOption(name="var", doc="a variable", values=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("choices_2.rougail.var"), '__internal_type': ParamValue("number"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/00_9default_integer/rougail/00-base.yml']), '__internal_attribute': ParamValue("choices"), '__internal_variable': ParamValue("2.rougail.var")})), default=9, properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
25
tests/dictionaries/00_9extra/tiramisu/multi.py
Normal file
25
tests/dictionaries/00_9extra/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.extra.variable'] = "no"
|
||||||
|
dict_env['default_2.extra.variable'] = "no"
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="rougail", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
option_5 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.extra.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.extra.variable")})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_4 = OptionDescription(name="extra", doc="extra", group_type=groups.namespace, children=[option_5], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2, optiondescription_4], properties=frozenset({"standard"}))
|
||||||
|
option_8 = StrOption(name="variable", doc="a variable", default="rougail", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8], properties=frozenset({"standard"}))
|
||||||
|
option_10 = StrOption(name="variable", doc="a variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.extra.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.extra.variable")})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_9 = OptionDescription(name="extra", doc="extra", group_type=groups.namespace, children=[option_10], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7, optiondescription_9], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
31
tests/dictionaries/00_9extra_calculation/tiramisu/multi.py
Normal file
31
tests/dictionaries/00_9extra_calculation/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.extra.variable2'] = "{{ rougail.variable }}\n"
|
||||||
|
dict_env['default_1.extra.variable3'] = "{{ variable }}\n"
|
||||||
|
dict_env['default_2.extra.variable2'] = "{{ rougail.variable }}\n"
|
||||||
|
dict_env['default_2.extra.variable3'] = "{{ variable }}\n"
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
option_5 = StrOption(name="variable1", doc="a first variable", default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_6 = StrOption(name="variable2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.extra.variable2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra_calculation/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.extra.variable2"), 'rougail.variable': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_7 = StrOption(name="variable3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.extra.variable3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra_calculation/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.extra.variable3"), 'variable': ParamOption(option_3)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_4 = OptionDescription(name="extra", doc="extra", group_type=groups.namespace, children=[option_5, option_6, option_7], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2, optiondescription_4], properties=frozenset({"standard"}))
|
||||||
|
option_10 = StrOption(name="variable", doc="a variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_9 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_10], properties=frozenset({"standard"}))
|
||||||
|
option_12 = StrOption(name="variable1", doc="a first variable", default=Calculation(func['calc_value'], Params((ParamOption(option_10)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_13 = StrOption(name="variable2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.extra.variable2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra_calculation/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.extra.variable2"), 'rougail.variable': ParamOption(option_10, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_14 = StrOption(name="variable3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.extra.variable3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/00_9extra_calculation/extra/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.extra.variable3"), 'variable': ParamOption(option_10)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_11 = OptionDescription(name="extra", doc="extra", group_type=groups.namespace, children=[option_12, option_13, option_14], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_8 = OptionDescription(name="2", doc="2", children=[optiondescription_9, optiondescription_11], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_8])
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.variable": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "value in extra"
|
|
||||||
},
|
|
||||||
"extra.variable": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "value in extra"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.variable": "value in extra",
|
|
||||||
"extra.variable": "value in extra"
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"rougail.variable": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "value in extra"
|
|
||||||
},
|
|
||||||
"extra.variable": {
|
|
||||||
"owner": "default",
|
|
||||||
"value": "value in extra"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
[]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from re import compile as re_compile
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
load_functions('../rougail-tests/funcs/test.py')
|
|
||||||
try:
|
|
||||||
groups.namespace
|
|
||||||
except:
|
|
||||||
groups.addgroup('namespace')
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_4 = StrOption(name="variable", doc="a variable", default="value in extra", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
|
||||||
option_2 = StrOption(name="variable", doc="a variable", default=Calculation(func['calc_value'], Params((ParamOption(option_4)))), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
|
||||||
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_2], properties=frozenset({"standard"}))
|
|
||||||
optiondescription_3 = OptionDescription(name="extra", doc="extra", group_type=groups.namespace, children=[option_4], properties=frozenset({"standard"}))
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_3])
|
|
||||||
33
tests/dictionaries/01_6boolean_multi/tiramisu/multi.py
Normal file
33
tests/dictionaries/01_6boolean_multi/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = BoolOption(name="var1", doc="the first variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_4 = BoolOption(name="var2", doc="the second variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_5 = BoolOption(name="var3", doc="the third variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_6 = BoolOption(name="var4", doc="the forth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_7 = BoolOption(name="var5", doc="the fifth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_8 = BoolOption(name="var6", doc="the sixth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_9 = BoolOption(name="var7", doc="the seventh variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_10 = BoolOption(name="var8", doc="the eighth variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_13 = BoolOption(name="var1", doc="the first variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_14 = BoolOption(name="var2", doc="the second variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_15 = BoolOption(name="var3", doc="the third variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_16 = BoolOption(name="var4", doc="the forth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_17 = BoolOption(name="var5", doc="the fifth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_18 = BoolOption(name="var6", doc="the sixth variable", multi=True, default=[False], default_multi=False, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_19 = BoolOption(name="var7", doc="the seventh variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
option_20 = BoolOption(name="var8", doc="the eighth variable", multi=True, default=[True], default_multi=True, properties=frozenset({"mandatory", "standard"}), informations={'type': 'boolean'})
|
||||||
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_11])
|
||||||
21
tests/dictionaries/01_6custom_multi/tiramisu/multi.py
Normal file
21
tests/dictionaries/01_6custom_multi/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = CustomOption(name="custom1", doc="a first custom variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'custom'})
|
||||||
|
option_4 = CustomOption(name="custom2", doc="a second custom variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'custom'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = CustomOption(name="custom1", doc="a first custom variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'custom'})
|
||||||
|
option_8 = CustomOption(name="custom2", doc="a second custom variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'custom'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
33
tests/dictionaries/01_6float_multi/tiramisu/multi.py
Normal file
33
tests/dictionaries/01_6float_multi/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = FloatOption(name="var1", doc="the first variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_4 = FloatOption(name="var2", doc="the second variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_5 = FloatOption(name="var3", doc="the third variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_6 = FloatOption(name="var4", doc="the forth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_7 = FloatOption(name="var5", doc="the fifth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_8 = FloatOption(name="var6", doc="the sixth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_9 = FloatOption(name="var7", doc="the seventh variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_10 = FloatOption(name="var8", doc="the eighth variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_13 = FloatOption(name="var1", doc="the first variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_14 = FloatOption(name="var2", doc="the second variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_15 = FloatOption(name="var3", doc="the third variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_16 = FloatOption(name="var4", doc="the forth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_17 = FloatOption(name="var5", doc="the fifth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_18 = FloatOption(name="var6", doc="the sixth variable", multi=True, default=[10.1], default_multi=10.1, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_19 = FloatOption(name="var7", doc="the seventh variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
option_20 = FloatOption(name="var8", doc="the eighth variable", multi=True, default=[0.0], default_multi=0.0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'float'})
|
||||||
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_11])
|
||||||
33
tests/dictionaries/01_6number_multi/tiramisu/multi.py
Normal file
33
tests/dictionaries/01_6number_multi/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = IntOption(name="var1", doc="the first variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_4 = IntOption(name="var2", doc="the second variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_5 = IntOption(name="var3", doc="the third variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_6 = IntOption(name="var4", doc="the forth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_7 = IntOption(name="var5", doc="the fifth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_8 = IntOption(name="var6", doc="the sixth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_9 = IntOption(name="var7", doc="the seventh variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_10 = IntOption(name="var8", doc="the eighth variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_13 = IntOption(name="var1", doc="the first variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_14 = IntOption(name="var2", doc="the second variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_15 = IntOption(name="var3", doc="the third variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_16 = IntOption(name="var4", doc="the forth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_17 = IntOption(name="var5", doc="the fifth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_18 = IntOption(name="var6", doc="the sixth variable", multi=True, default=[10], default_multi=10, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_19 = IntOption(name="var7", doc="the seventh variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
option_20 = IntOption(name="var8", doc="the eighth variable", multi=True, default=[0], default_multi=0, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_11])
|
||||||
19
tests/dictionaries/01_6string_empty/tiramisu/multi.py
Normal file
19
tests/dictionaries/01_6string_empty/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="the second variable", multi=True, default=["value", None], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="var1", doc="the second variable", multi=True, default=["value", None], default_multi="value", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
},
|
},
|
||||||
"rougail.var3": {
|
"rougail.var3": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": []
|
"value": null
|
||||||
},
|
},
|
||||||
"rougail.var4": {
|
"rougail.var4": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"rougail.var1": [],
|
"rougail.var1": [],
|
||||||
"rougail.var2": [],
|
"rougail.var2": [],
|
||||||
"rougail.var3": [],
|
"rougail.var3": null,
|
||||||
"rougail.var4": [
|
"rougail.var4": [
|
||||||
"value"
|
"value"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
},
|
},
|
||||||
"rougail.var3": {
|
"rougail.var3": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
"value": []
|
"value": null
|
||||||
},
|
},
|
||||||
"rougail.var4": {
|
"rougail.var4": {
|
||||||
"owner": "default",
|
"owner": "default",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_2 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_2 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_3 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_3 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_4 = StrOption(name="var3", doc="the third variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_4 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_5 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_5 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_6 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_6 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_7 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_7 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
|
|
||||||
33
tests/dictionaries/01_6string_multi/tiramisu/multi.py
Normal file
33
tests/dictionaries/01_6string_multi/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_6 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_7 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_9 = StrOption(name="var7", doc="the seventh variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_10 = StrOption(name="var8", doc="the eighth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5, option_6, option_7, option_8, option_9, option_10], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_13 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_14 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_15 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
|
option_16 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_17 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_18 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_19 = StrOption(name="var7", doc="the seventh variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_20 = StrOption(name="var8", doc="the eighth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_12 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_13, option_14, option_15, option_16, option_17, option_18, option_19, option_20], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_11 = OptionDescription(name="2", doc="2", children=[optiondescription_12], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_11])
|
||||||
|
|
@ -8,7 +8,7 @@ ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_1 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_1 = StrOption(name="var1", doc="the first variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_2 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_2 = StrOption(name="var2", doc="the second variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_3 = StrOption(name="var3", doc="the third variable", multi=True, properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
option_3 = StrOption(name="var3", doc="the third variable", properties=frozenset({"basic", "mandatory"}), informations={'type': 'string'})
|
||||||
option_4 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_4 = StrOption(name="var4", doc="the forth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_5 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_5 = StrOption(name="var5", doc="the fifth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
option_6 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
option_6 = StrOption(name="var6", doc="the sixth variable", multi=True, default=["value"], default_multi="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", multi=True, default=["quote\""], default_multi="quote\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", multi=True, default=["quote\""], default_multi="quote\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", multi=True, default=["quote'\""], default_multi="quote'\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", multi=True, default=["quote'\""], default_multi="quote'\"", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/01_7value_multi_quote/tiramisu/multi.py
Normal file
19
tests/dictionaries/01_7value_multi_quote/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.variable'] = "{% for info in test_information %}\n{{ info }}\n{% endfor %}\n"
|
||||||
|
dict_env['default_2.rougail.variable'] = "{% for info in test_information %}\n{{ info }}\n{% endfor %}\n"
|
||||||
|
option_3 = StrOption(name="variable", doc="a variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/01_8calculation_information_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.variable"), 'test_information': ParamInformation("test_information_list", [])})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="a variable", multi=True, default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.variable"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(True), '__internal_files': ParamValue(['../rougail-tests/structures/01_8calculation_information_multi/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.variable"), 'test_information': ParamInformation("test_information_list", [])})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable1", doc="a first variable", multi=True, default=["a", "b", "c"], default_multi="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = ChoiceOption(name="variable2", doc="a second variable", values=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="variable1", doc="a first variable", multi=True, default=["a", "b", "c"], default_multi="a", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = ChoiceOption(name="variable2", doc="a second variable", values=Calculation(func['calc_value'], Params((ParamOption(option_7)))), properties=frozenset({"basic", "mandatory"}), informations={'type': 'choice'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
19
tests/dictionaries/04_0type_param/tiramisu/multi.py
Normal file
19
tests/dictionaries/04_0type_param/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = IntOption(name="int", doc="A limited number", default=10, min_number=0, max_number=100, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = IntOption(name="int", doc="A limited number", default=10, min_number=0, max_number=100, properties=frozenset({"mandatory", "standard"}), informations={'type': 'number'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
19
tests/dictionaries/04_1auto_save/tiramisu/multi.py
Normal file
19
tests/dictionaries/04_1auto_save/tiramisu/multi.py
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="variable", doc="an auto save variable", default="no", properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_6 = StrOption(name="variable", doc="an auto save variable", default="no", properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", default=Calculation(func['calc_value'], Params((ParamOption(option_7)))), properties=frozenset({"basic", "force_store_value", "mandatory"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var2'] = "yes"
|
||||||
|
dict_env['hidden_1.rougail.var2'] = "{% if _.var1 == \"yes\" %}\n_.var1 is yes\n{% endif %}\n"
|
||||||
|
dict_env['frozen_1.rougail.var2'] = "{% if _.var1 == \"yes\" %}\n_.var1 is yes\n{% endif %}\n"
|
||||||
|
dict_env['default_2.rougail.var2'] = "yes"
|
||||||
|
dict_env['hidden_2.rougail.var2'] = "{% if _.var1 == \"yes\" %}\n_.var1 is yes\n{% endif %}\n"
|
||||||
|
dict_env['frozen_2.rougail.var2'] = "{% if _.var1 == \"yes\" %}\n_.var1 is yes\n{% endif %}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var2")})), properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("hidden")), kwargs={'__internal_jinja': ParamValue("hidden_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("hidden"), '__internal_variable': ParamValue("1.rougail.var2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.var1': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_1.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("frozen"), '__internal_variable': ParamValue("1.rougail.var2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.var1': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_7 = StrOption(name="var1", doc="a first variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="var2", doc="a second variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var2")})), properties=frozenset({"basic", "force_store_value", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("hidden")), kwargs={'__internal_jinja': ParamValue("hidden_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("hidden"), '__internal_variable': ParamValue("2.rougail.var2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.var1': ParamOption(option_7, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help']), Calculation(func['jinja_to_property'], Params((ParamValue("frozen")), kwargs={'__internal_jinja': ParamValue("frozen_2.rougail.var2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1auto_save_and_calculated_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("frozen"), '__internal_variable': ParamValue("2.rougail.var2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.var1': ParamOption(option_7, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_7, option_8], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="var", doc="autosave variable", default="yes", properties=frozenset({"basic", "force_store_value", "frozen", "hidden"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_6 = StrOption(name="var", doc="autosave variable", default="yes", properties=frozenset({"basic", "force_store_value", "frozen", "hidden"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_6], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var3'] = "{% if _.var1 == 'value' or _.var2 == 'blah' %}\nvalue\n{% endif %}\n"
|
||||||
|
dict_env['default_2.rougail.var3'] = "{% if _.var1 == 'value' or _.var2 == 'blah' %}\nvalue\n{% endif %}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_3)), kwargs={'when': ParamValue("value"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="var3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1default_calculation_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var3"), '_.var2': ParamOption(option_4, notraisepropertyerror=True), '_.var1': ParamOption(option_3, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_8 = StrOption(name="var1", doc="a first variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_9 = StrOption(name="var2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_8)), kwargs={'when': ParamValue("value"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||||
|
option_10 = StrOption(name="var3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1default_calculation_hidden/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var3"), '_.var2': ParamOption(option_9, notraisepropertyerror=True), '_.var1': ParamOption(option_8, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, option_9, option_10], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['default_1.rougail.var3'] = "{% if _.var2 is propertyerror %}\nvalue\n{% endif %}\n"
|
||||||
|
dict_env['default_2.rougail.var3'] = "{% if _.var2 is propertyerror %}\nvalue\n{% endif %}\n"
|
||||||
|
option_3 = StrOption(name="var1", doc="a first variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="var2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_3)), kwargs={'when': ParamValue("value"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="var3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_1.rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1default_calculation_hidden_2/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("1.rougail.var3"), '_.var2': ParamOption(option_4, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_8 = StrOption(name="var1", doc="a first variable", default="value", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_9 = StrOption(name="var2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['variable_to_property'], Params((ParamValue("disabled"), ParamOption(option_8)), kwargs={'when': ParamValue("value"), 'inverse': ParamValue(False)}), help_function=func['variable_to_property'])}), informations={'type': 'string'})
|
||||||
|
option_10 = StrOption(name="var3", doc="a third variable", default=Calculation(func['jinja_to_function'], Params((), kwargs={'__internal_jinja': ParamValue("default_2.rougail.var3"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_1default_calculation_hidden_2/rougail/00-base.yml']), '__internal_attribute': ParamValue("default"), '__internal_variable': ParamValue("2.rougail.var3"), '_.var2': ParamOption(option_9, notraisepropertyerror=True)})), properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, option_9, option_10], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from re import compile as re_compile
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('../rougail-tests/funcs/test.py')
|
||||||
|
try:
|
||||||
|
groups.namespace
|
||||||
|
except:
|
||||||
|
groups.addgroup('namespace')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
dict_env['disabled_1.rougail.variable1'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||||
|
dict_env['disabled_1.rougail.variable2'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||||
|
dict_env['disabled_2.rougail.variable1'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||||
|
dict_env['disabled_2.rougail.variable2'] = "{% if _.condition == \"yes\" %}\ncondition is yes\n{% endif %}\n"
|
||||||
|
option_3 = StrOption(name="condition", doc="a conditional variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="variable1", doc="a first variable", properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_1.rougail.variable1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("1.rougail.variable1"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
option_5 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_1.rougail.variable2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("1.rougail.variable2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_3, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_3, option_4, option_5], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||||
|
option_8 = StrOption(name="condition", doc="a conditional variable", default="no", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_9 = StrOption(name="variable1", doc="a first variable", properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_2.rougail.variable1"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("2.rougail.variable1"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_8, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
option_10 = StrOption(name="variable2", doc="a second variable", properties=frozenset({"basic", "mandatory", Calculation(func['jinja_to_property'], Params((ParamValue("disabled")), kwargs={'__internal_jinja': ParamValue("disabled_2.rougail.variable2"), '__internal_type': ParamValue("string"), '__internal_multi': ParamValue(False), '__internal_files': ParamValue(['../rougail-tests/structures/04_5disabled_calculation/rougail/00-base.yml']), '__internal_attribute': ParamValue("disabled"), '__internal_variable': ParamValue("2.rougail.variable2"), 'when': ParamValue(True), 'inverse': ParamValue(False), '_.condition': ParamOption(option_8, notraisepropertyerror=True)}), help_function=func['jinja_to_property_help'])}), informations={'type': 'string'})
|
||||||
|
optiondescription_7 = OptionDescription(name="rougail", doc="Rougail", group_type=groups.namespace, children=[option_8, option_9, option_10], properties=frozenset({"basic"}))
|
||||||
|
optiondescription_6 = OptionDescription(name="2", doc="2", children=[optiondescription_7], properties=frozenset({"basic"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_6])
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue