Compare commits

..

No commits in common. "b0588768af35f7d9a70f67e3e711494e45fd16ac" and "f9e2f48788820e1f3f51bf0c13c9a82b83d88bc0" have entirely different histories.

253 changed files with 516 additions and 683 deletions

View File

@ -1,42 +1,24 @@
# Rougail
Rougail est un bibliothèque python3 qui permet de charger des dictionnaires (fichiers au format XML), de charger les variables dans Tiramisu et de générer des templates.
## La bibliothèque
- [Utiliser la bibliothèque](dev/README.md)
- [Personnaliser la configration de la bibliothèque](dev/config.md)
## Les dictionnaires
Un dictionnaire est un fichier XML donc la structure est expliqué ci-dessous.
FIXME : explications
FIXME : extra
Un dictionnaire contient en ensemble de variable, utilisable à tout moment, notamment dans des templates.
Il est possible d'avoir plusieurs espace de nom pour classer les variables (appeler aussi "extra") mais il est aussi possible, à l'interieur de ce espace de nom de mettre des familles pour classer les variables.
Les familles et les variables peuvent être défini dans plusieurs dictionnaires. Ces dictionnaires s'aggrège alors. Il est possible de rajouter des familles des variables, des services, des éléments à un service et des contraintes.
Il est également possible de redéfinir des éléments pour changer les comportement d'une variable ou d'un service.
### Les variables
## Les variables
- [Les familles](family/README.md)
- [Les variables](variable/README.md)
### Les services
## Les services
- [La gestion d'un fichier](service/file.md)
- [La gestion d'un fichier de service systemd](service/override.md)
- [La gestion d'un port](service/port.md)
- [La gestion d'une ip](service/ip.md)
### Les contraintes
## Les contraintes
- [Les calcules automatiques](fill/README.md)
- [Les vérifications des valeurs](check/README.md)
- [Les conditions](condition/README.md)
## Les templates
- Type creole

View File

@ -1,187 +0,0 @@
# La bibliothèque rougail
Rougail est une bibliothèque simple a utiliser.
Dans les exemples suivant, nous utilisons la configuration par défaut de Rougail. Vous pouvez [personnaliser les répertoires utilisés](config.md).
## Convertisons un dictionnaire en objet tiramisu
Commençons par créer un dictionnaire simple.
Voici un premier dictionnaire /srv/rougail/dictionaries/00-base.xml :
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<variables>
<variable name="my_variable">
<value>my_value</value>
</variable>
</variables>
</rougail>
```
Construisons les objets tiramisu :
```
from rougail import RougailConvert
rougail = RougailConvert()
rougail.save('example1.py')
```
Un nouveau fichier 'example1.py' va être créé dans le répertoire local
## Convertisons un dictionnaire et un dictionnaire extra en objet tiramisu
En plus du dictionnaire précédent, créons un dictionnaire extra /srv/rougail/extra_dictionaries/00-base.xml
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<variables>
<variable name="my_variable_extra">
<value>my_value_extra</value>
</variable>
</variables>
</rougail>
```
Construisons les objets tiramisu :
```
from rougail import RougailConvert, RougailConfig
RougailConfig['extra_dictionaries']['example'] = ['/srv/rougail/extra_dictionaries/']
rougail = RougailConvert()
rougail.save('example2.py')
```
## Templatisons un template
Nous créons un dictionnaire complémentaire pour ajouter notre template /srv/rougail/dictionaries/00-template.xml :
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services>
<service name="example">
<file name="/etc/example.conf"/>
</service>
</services>
</rougail>
```
Et un template /srv/rougail/templates/example.conf :
```
The value: %%my_variable
The extra value: %%example.my_variable_extra
```
Générons le fichier tiramisu :
```
from rougail import RougailConvert, RougailConfig
RougailConfig['extra_dictionaries']['example'] = ['/srv/rougail/extra_dictionaries/']
rougail = RougailConvert()
rougail.save('example3.py')
```
Créer les répertoires utils pour la templatisation : mkdir /srv/rougail/destinations /srv/rougail/tmp
Générons le template :
```
import asyncio
from tiramisu import Config
from rougail import RougailTemplate
from example3 import option_0
async def template():
config = await Config(option_0)
engine = RougailTemplate(config)
await engine.instance_files()
loop = asyncio.get_event_loop()
loop.run_until_complete(template())
loop.close()
```
Le fichier /srv/rougail/destinations/etc/example.conf est maintenant créé avec le contenu attendu suivant :
```
The value: my_value
The extra value: my_value_extra
```
## Appliquons un patch au template
Il peut être intéressant de réaliser un patch à un template pour corriger un problème spécifique à notre environnement, sans attendre que le mainteneur du template n'est fait la correction.
Testons en créant le patch /srv/rougail/patches/example.conf.patch :
```
--- /srv/rougail/templates/example.conf 2021-02-13 19:41:38.677491087 +0100
+++ tmp/example.conf 2021-02-13 20:12:55.525089820 +0100
@@ -1,3 +1,5 @@
The value: %%my_variable
The extra value: %%example.my_variable_extra
+
+Add by a patch
```
Le patch est bien appliquer sur notre fichier /srv/rougail/destinations/etc/example.conf :
```
The value: my_value
The extra value: my_value_extra
Add by a patch
```
Deux choses importantes à savoir sur les patchs :
- le nom du patch est obligatoire le nom du template source + ".patch"
- la deuxième ligne toujours commencer par "+++ tmp/" + le nom du template source
## Créons une fonction personnalisé
Nous créons un dictionnaire complémentaire pour ajouter un calcul à la variable my_variable_extra dans /srv/rougail/dictionaries/00-fill.xml :
```
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<constraints>
<fill name="return_no">
<target>my_variable</target>
</fill>
</constraints>
</rougail>
```
Puis créons la fonction "return_no" dans /srv/rougail/functions.py :
```
def return_no():
return 'no'
```
Après avoir reconverti les dictionnaires et regénérer le template nous avons donc le contenu du fichier /srv/rougail/destinations/etc/example.conf :
```
The value: no
The extra value: my_value_extra
Add by a patch
```
La valeur de la variable my_variable est bien calculé à partir de la fonction "return_no".

View File

@ -1,67 +0,0 @@
# Personnalisons la configuration de Rougail
La configuration de rougail se trouve dans l'objet RougailConfig :
```
from rougail import RougailConfig
```
C'est un simple dictionnaire python avec différentes clefs.
Pour modifier il suffit de faire :
```
RougailConfig[key] = value
```
## Les répertoires des dictionnaires
Il existe deux types de répertoires de dictionnaires :
- les dictionnaires principaux avec la clef "dictionaries_dir". La valeur par défaut est ['/srv/rougail/dictionaries']. Cette variable doit contenir la liste des répertoires contenants des dictionnaires.
Les dictionnaires sont chargés dans l'ordre des répertoires. Chaque répertoire est chargé les uns après les autres. A l'intérieur de ces répertoires les fichiers XML seront classés par ordre alphabétique.
Il n'y a pas de classement par ordre alphabétique de l'ensemble des fichiers XML de tous les répertoires.
Les familles et variable de ces dictionnaires sont classés, par défaut, dans l'espace de nom "rougail". Il est possible de changer le nom de cet espace de nom avec la clef "variable_namespace".
- les dictionnaires extra avec la clef "extra_dictionaries". La valeur est un dictionnaire avec l'ensemble des espaces de nom de extra. La clef étant l'espace de nom et la valeur étant une liste de répertoire.
Par exemple pour ajouter l'extra "example" il faut faire :
```
RougailConfig['extra_dictionaries']['example'] = ['/dir1', '/dir2']
```
Les dictionnaires sont chargés dans le même ordre que les dictionnaires principaux.
## La DTD
Rougail a besoin du fichier de DTD pour lire les fichiers dictionnaire.
Par défaut le fichier de la DTD est dans le sous répertoire "data" du répertoire de code. Le nom du fichier est rougail.dtd.
Pour pouvez changer le répertoire de destination de la DTD et le nom du fichier avec la clef "dtdfilename".
## Le fichier de fonction
Le fichier qui contient les fonctions personnalisés est géré dans la clef "functions_file" et a comme valeur par défaut "/srv/rougail/functions.py".
## Le répertoire des templates
Le répertoire des templates est géré dans la clef "templates_dir" et a comme valeur par défaut : "/srv/rougail/templates".
## Le répertoire des patchs
Le répertoire des patches est géré dans la clef "patches_dir" et a comme valeur par défaut : "/srv/rougail/patches".
## Le répertoire temporaire
Le répertoire temporaire est utile lors de la génération de template. Il contient une copie des templates avec, éventuellement, les patches appliqués sur les templates.
Le répertoire de temporaire est géré dans la clef "tmp_dir" et a comme valeur par défaut : "/srv/rougail/tmp".
## Le répertoire de destination des fichiers générés
Le répertoire de destination des fichiers générés est géré dans la clef "destinations_dir" et a comme valeur par défaut : "/srv/rougail/destinations".

View File

@ -1,8 +1,4 @@
# La gestion d'une IP
## La balise ip
La gestion des IP se fait dans un conteneur de [service](service.md).
# IP
FIXME

View File

@ -2,8 +2,6 @@
## La balise override
La gestion des overrides se fait dans un conteneur de [service](service.md).
La balise override permet de redéfinir facilement un service systemd.
Il suffit d'avoir un template dont le nom est par défaut le nom du service avec l'extension "service" et de déclarer la balise :

View File

@ -1,9 +1,7 @@
# La gestion d'un port
# Port
## La balise port
La gestion des ports se fait dans un conteneur de [service](service.md).
La balise port permet d'associer un port à service :
```

View File

@ -24,9 +24,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from .convert import RougailConvert
from .template import RougailTemplate
from .config import RougailConfig
from .rougail import Rougail
from .annotator import modes
__ALL__ = ('RougailConvert', 'RougailTemplate', 'RougailConfig', 'modes')
__ALL__ = ('RougailObjSpace', 'modes')

View File

@ -66,6 +66,8 @@ class CheckAnnotator(TargetAnnotator, ParamAnnotator):
variable_type = None
if obj.name == 'valid_enum':
for target in obj.target:
if variable_type and target.name.type != variable_type:
raise Exception('pfff')
variable_type = target.name.type
return variable_type

View File

@ -29,7 +29,7 @@ from typing import List, Any
from ..i18n import _
from ..error import DictConsistencyError
from ..config import RougailConfig
from ..config import Config
from .target import TargetAnnotator
from .param import ParamAnnotator
@ -82,7 +82,7 @@ class ConditionAnnotator(TargetAnnotator, ParamAnnotator, Walk):
) -> None:
if not variable.auto_freeze:
return
if variable.namespace != RougailConfig['variable_namespace']:
if variable.namespace != Config['variable_namespace']:
msg = _(f'auto_freeze is not allowed in extra "{variable.namespace}"')
raise DictConsistencyError(msg, 49, variable.xmlfiles)
new_condition = self.objectspace.condition(variable.xmlfiles)

View File

@ -78,6 +78,8 @@ class FamilyAnnotator(Walk):
return True
else:
return True
else:
return False
return False
def remove_empty_families(self) -> None:
@ -97,6 +99,8 @@ class FamilyAnnotator(Walk):
for family in self.get_families():
if not hasattr(family, 'description'):
family.description = family.name
if not hasattr(family, 'path'):
family.path = family.name
family.doc = family.description
del family.description
family.name = normalize_family(family.name)
@ -205,7 +209,7 @@ class FamilyAnnotator(Walk):
for variable in family.variable.values():
if isinstance(variable, self.objectspace.family):
msg = _(f'dynamic family "{family.name}" cannot contains another family')
raise DictConsistencyError(msg, 22, family.xmlfiles)
raise DictConsistencyError(msg, 2, family.xmlfiles)
def convert_help(self):
"""Convert variable help

View File

@ -69,8 +69,7 @@ class ParamAnnotator:
)
param.text = self.objectspace.paths.get_variable(path)
if variable_type and param.text.type != variable_type:
msg = _(f'"{obj.name}" has type "{variable_type}" but param has type "{param.text.type}"')
raise DictConsistencyError(msg, 26, param.xmlfiles)
raise Exception('pfff', variable_type, param.text.type)
if suffix:
param.suffix = suffix
family_path = self.objectspace.paths.get_variable_family_path(path)
@ -84,7 +83,7 @@ class ParamAnnotator:
elif variable_type:
if 'type' in vars(param) and variable_type != param.type:
msg = _(f'parameter has incompatible type "{param.type}" '
f'with type "{variable_type}"')
f'with type "{variable_type}")')
raise DictConsistencyError(msg, 7, param.xmlfiles)
try:
param.text = CONVERT_OPTION[variable_type].get('func', str)(param.text)

View File

@ -184,7 +184,6 @@ class ServiceAnnotator:
self.objectspace.paths.add_family('services',
path,
family,
None,
)
return family

View File

@ -60,7 +60,7 @@ class TargetAnnotator:
elif self.only_variable:
msg = _(f'target to "{target.name}" with param type "{target.type}" '
f'is not allowed')
raise DictConsistencyError(msg, 8, obj.xmlfiles)
raise DictConsistencyError(msg, 2, obj.xmlfiles)
if target.type == 'family':
target.name = self.objectspace.paths.get_family(target.name,
obj.namespace,

View File

@ -28,17 +28,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from os.path import join, abspath, dirname
ROUGAILROOT = '/srv/rougail'
ROUGAILROOT = '/var/rougail'
DTDDIR = join(dirname(abspath(__file__)), 'data')
RougailConfig = {'dictionaries_dir': [join(ROUGAILROOT, 'dictionaries')],
'extra_dictionaries': {},
'patches_dir': join(ROUGAILROOT, 'patches'),
Config = {'rougailroot': ROUGAILROOT,
'patch_dir': join(ROUGAILROOT, 'patches'),
'manifests_dir': join(ROUGAILROOT, 'manifests'),
'templates_dir': join(ROUGAILROOT, 'templates'),
'destinations_dir': join(ROUGAILROOT, 'destinations'),
'tmp_dir': join(ROUGAILROOT, 'tmp'),
'dtdfilename': join(DTDDIR, 'rougail.dtd'),
'dtddir': DTDDIR,
'variable_namespace': 'rougail',
'functions_file': join(ROUGAILROOT, 'functions.py'),
}

View File

@ -1,106 +0,0 @@
"""Takes a bunch of Rougail XML dispatched in differents folders
as an input and outputs a Tiramisu's file.
Created by:
EOLE (http://eole.orion.education.fr)
Copyright (C) 2005-2018
Forked by:
Cadoles (http://www.cadoles.com)
Copyright (C) 2019-2021
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sample usage::
>>> from rougail import Rougail
>>> rougail = Rougail()
>>> rougail.load_dictionaries(['/usr/share/rougail/dicos'])
>>> rougail.load_extra_dictionaries('extra1', ['/usr/share/rougail/extra1'])
>>> rougail.space_visitor('/usr/share/rougail/funcs.py')
>>> tiramisu = rougail.save()
The Rougail
- loads the XML into an internal RougailObjSpace representation
- visits/annotates the objects
- dumps the object space as Tiramisu string
The visit/annotation stage is a complex step that corresponds to the Rougail
procedures.
"""
from typing import List
from .i18n import _
from .config import RougailConfig
from .objspace import RougailObjSpace
from .xmlreflector import XMLReflector
from .tiramisureflector import TiramisuReflector
from .annotator import SpaceAnnotator
from .error import DictConsistencyError
class RougailConvert:
"""Rougail object
"""
def __init__(self) -> None:
xmlreflector = XMLReflector()
rougailobjspace = RougailObjSpace(xmlreflector)
self._load_dictionaries(xmlreflector,
rougailobjspace,
RougailConfig['variable_namespace'],
RougailConfig['dictionaries_dir'],
)
for namespace, extra_dir in RougailConfig['extra_dictionaries'].items():
if namespace in ['services', RougailConfig['variable_namespace']]:
msg = _(f'Namespace name "{namespace}" is not allowed')
raise DictConsistencyError(msg, 21, None)
self._load_dictionaries(xmlreflector,
rougailobjspace,
namespace,
extra_dir,
)
functions_file = RougailConfig['functions_file']
SpaceAnnotator(rougailobjspace,
functions_file,
)
self.output = TiramisuReflector(rougailobjspace,
functions_file,
).get_text() + '\n'
def _load_dictionaries(self,
xmlreflector: XMLReflector,
rougailobjspace: RougailObjSpace,
namespace: str,
xmlfolders: List[str],
) -> List[str]:
for xmlfile, document in xmlreflector.load_xml_from_folders(xmlfolders):
rougailobjspace.xml_parse_document(xmlfile,
document,
namespace,
)
def save(self,
filename: str,
) -> str:
"""Return tiramisu object declaration as a string
"""
if filename:
with open(filename, 'w') as tiramisu:
tiramisu.write(self.output)
return self.output

View File

@ -32,7 +32,7 @@ from .xmlreflector import XMLReflector
from .utils import normalize_family
from .error import SpaceObjShallNotBeUpdated, DictConsistencyError
from .path import Path
from .config import RougailConfig
from .config import Config
# RougailObjSpace's elements that shall be forced to the Redefinable type
FORCE_REDEFINABLES = ('family', 'follower', 'service', 'disknod', 'variables')
@ -109,7 +109,6 @@ class RougailObjSpace:
self.list_conditions = {}
self.valid_enums = {}
self.booleans_attributs = []
self.has_dyn_option = False
self.make_object_space_classes(xmlreflector)
@ -165,14 +164,20 @@ class RougailObjSpace:
def xml_parse_document(self,
xmlfile,
document,
space,
namespace,
):
"""Parses a Rougail XML file and populates the RougailObjSpace
"""
if namespace in ['services', Config['variable_namespace']]:
msg = _(f'Namespace name "{namespace}" is not allowed')
raise DictConsistencyError(msg, 21, xmlfile)
if not namespace:
namespace = Config['variable_namespace']
redefine_variables = []
self._xml_parse(xmlfile,
document,
self.space,
space,
namespace,
redefine_variables,
)
@ -219,7 +224,6 @@ class RougailObjSpace:
self.set_path(namespace,
document,
variableobj,
space,
)
self.add_to_tree_structure(variableobj,
space,
@ -301,7 +305,7 @@ class RougailObjSpace:
redefine = convert_boolean(subspace.get('redefine', default_redefine))
if redefine is True:
if isinstance(existed_var, self.variable): # pylint: disable=E1101
if namespace == RougailConfig['variable_namespace']:
if namespace == Config['variable_namespace']:
redefine_variables.append(name)
else:
redefine_variables.append(space.path + '.' + name)
@ -326,8 +330,7 @@ class RougailObjSpace:
tag = FORCE_TAG.get(child.tag, child.tag)
if tag not in vars(space):
setattr(space, tag, {})
obj = getattr(self, child.tag)(xmlfile, name)
return obj
return getattr(self, child.tag)(xmlfile, name)
def get_existed_obj(self,
name: str,
@ -340,7 +343,7 @@ class RougailObjSpace:
if child.tag in ['variable', 'family']:
name = normalize_family(name)
if child.tag == 'variable': # pylint: disable=E1101
if namespace != RougailConfig['variable_namespace']:
if namespace != Config['variable_namespace']:
name = space.path + '.' + name
if not self.paths.path_is_defined(name):
return None
@ -456,7 +459,6 @@ class RougailObjSpace:
namespace,
document,
variableobj,
space,
):
"""Fill self.paths attributes
"""
@ -465,24 +467,20 @@ class RougailObjSpace:
family_name = normalize_family(document.attrib['name'])
else:
family_name = namespace
self.paths.add_variable(namespace,
normalize_family(variableobj.name),
space.path,
namespace + '.' + family_name,
document.attrib.get('dynamic') is not None,
variableobj,
)
elif isinstance(variableobj, self.family): # pylint: disable=E1101
family_name = normalize_family(variableobj.name)
if namespace != RougailConfig['variable_namespace']:
if namespace != Config['variable_namespace']:
family_name = namespace + '.' + family_name
self.paths.add_family(namespace,
family_name,
variableobj,
space.path,
)
elif isinstance(variableobj, self.variables):
variableobj.path = variableobj.name
@staticmethod
def add_to_tree_structure(variableobj,

View File

@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from .i18n import _
from .error import DictConsistencyError
from .config import RougailConfig
from .config import Config
from .utils import normalize_family
@ -47,12 +47,11 @@ class Path:
namespace: str,
name: str,
variableobj: str,
subpath: str,
) -> str: # pylint: disable=C0111
"""Add a new family
"""
if namespace == RougailConfig['variable_namespace']:
full_name = '.'.join([subpath, name])
if namespace == Config['variable_namespace']:
full_name = '.'.join([namespace, name])
self.full_paths_families[name] = full_name
else:
if '.' not in name: # pragma: no cover
@ -93,7 +92,7 @@ class Path:
if name not in self.families:
raise DictConsistencyError(_(f'unknown option {name}'), 42, [])
dico = self.families[name]
if current_namespace not in [RougailConfig['variable_namespace'], 'services'] and \
if current_namespace not in [Config['variable_namespace'], 'services'] and \
current_namespace != dico['namespace']:
msg = _(f'A family located in the "{dico["namespace"]}" namespace '
f'shall not be used in the "{current_namespace}" namespace')
@ -117,7 +116,7 @@ class Path:
self.variables[new_path]['leader'] = leadership_path
self.variables[new_path]['variableobj'].path = new_path
self.variables[new_path]['family'] = leadership_path
if namespace == RougailConfig['variable_namespace']:
if namespace == Config['variable_namespace']:
self.full_paths_variables[name] = new_path
def is_leader(self, path): # pylint: disable=C0111
@ -141,7 +140,7 @@ class Path:
"""
if '.' not in name:
full_path = '.'.join([family, name])
if namespace == RougailConfig['variable_namespace']:
if namespace == Config['variable_namespace']:
self.full_paths_variables[name] = full_path
else:
full_path = name
@ -180,7 +179,7 @@ class Path:
with_suffix=True,
)
namespace = dico['variableobj'].namespace
if namespace not in [RougailConfig['variable_namespace'], 'services'] and \
if namespace not in [Config['variable_namespace'], 'services'] and \
current_namespace != namespace:
msg = _(f'A variable located in the "{namespace}" namespace shall not be used '
f'in the "{current_namespace}" namespace')

94
src/rougail/rougail.py Normal file
View File

@ -0,0 +1,94 @@
"""Takes a bunch of Rougail XML dispatched in differents folders
as an input and outputs a Tiramisu's file.
Created by:
EOLE (http://eole.orion.education.fr)
Copyright (C) 2005-2018
Forked by:
Cadoles (http://www.cadoles.com)
Copyright (C) 2019-2021
distribued with GPL-2 or later license
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sample usage::
>>> from rougail import Rougail
>>> rougail = Rougail('/usr/share/rougail/rougail.dtd')
>>> rougail.create_or_populate_from_xml(['/usr/share/rougail/dicos'])
>>> rougail.create_or_populate_from_xml(['/usr/share/rougail/extra1'], 'extra1')
>>> rougail.space_visitor('/usr/share/rougail/funcs.py')
>>> tiramisu = rougail.save()
The Rougail
- loads the XML into an internal RougailObjSpace representation
- visits/annotates the objects
- dumps the object space as Tiramisu string
The visit/annotation stage is a complex step that corresponds to the Rougail
procedures.
"""
from typing import List
from .objspace import RougailObjSpace
from .xmlreflector import XMLReflector
from .tiramisureflector import TiramisuReflector
from .annotator import SpaceAnnotator
class Rougail:
"""Rougail object
"""
def __init__(self,
dtdfilename: str,
) -> None:
self.xmlreflector = XMLReflector()
self.xmlreflector.parse_dtd(dtdfilename)
self.rougailobjspace = RougailObjSpace(self.xmlreflector)
self.funcs_path = None
def create_or_populate_from_xml(self,
xmlfolders: List[str],
namespace: str=None,
) -> List[str]:
"""Parses a bunch of XML files and populates the RougailObjSpace
"""
for xmlfile in self.xmlreflector.load_xml_from_folders(xmlfolders):
document = self.xmlreflector.parse_xmlfile(xmlfile)
self.rougailobjspace.redefine_variables = []
self.rougailobjspace.xml_parse_document(xmlfile,
document,
self.rougailobjspace.space,
namespace,
)
def space_visitor(self,
eosfunc_file: str,
) -> None:
"""All XML are loader, now annotate content
"""
self.funcs_path = eosfunc_file
SpaceAnnotator(self.rougailobjspace, eosfunc_file)
def save(self) -> str:
"""Return tiramisu object declaration as a string
"""
tiramisu_objects = TiramisuReflector(self.rougailobjspace,
self.funcs_path,
)
return tiramisu_objects.get_text() + '\n'

View File

@ -30,7 +30,7 @@ import logging
from typing import Dict, Any
from subprocess import call
from os import listdir, makedirs, getcwd, chdir
from os.path import dirname, join, isfile, abspath, normpath, isdir
from os.path import dirname, join, isfile, abspath, normpath, relpath
from Cheetah.Template import Template as ChtTemplate
from Cheetah.NameMapper import NotFound as CheetahNotFound
@ -42,7 +42,7 @@ except ModuleNotFoundError: # pragma: no cover
from tiramisu import Config
from tiramisu.error import PropertiesOptionError
from .config import RougailConfig
from .config import Config
from .error import FileNotFound, TemplateError
from .i18n import _
from .utils import normalize_family, load_modules
@ -104,7 +104,7 @@ class CheetahTemplate(ChtTemplate): # pylint: disable=W0223
return None
class RougailLeaderIndex:
class CreoleLeaderIndex:
"""This object is create when access to a specified Index of the variable
"""
def __init__(self,
@ -152,7 +152,7 @@ class RougailLeaderIndex:
return value + self._value
class RougailLeader:
class CreoleLeader:
"""Implement access to leader and follower variable
For examples: %%leader, %%leader[0].follower1
"""
@ -166,7 +166,7 @@ class RougailLeader:
"""Get a leader.follower at requested index.
"""
followers = {key: values[index] for key, values in self._follower.items()}
return RougailLeaderIndex(self._value[index],
return CreoleLeaderIndex(self._value[index],
followers,
index,
)
@ -201,7 +201,7 @@ class RougailLeader:
self._follower[name].append(value)
class RougailExtra:
class CreoleExtra:
"""Object that implement access to extra variable
For example %%extra1.family.variable
"""
@ -218,21 +218,23 @@ class RougailExtra:
return iter(self.suboption.values())
class RougailTemplate:
class CreoleTemplateEngine:
"""Engine to process Creole cheetah template
"""
def __init__(self, # pylint: disable=R0913
config: Config,
eosfunc_file: str,
distrib_dir: str,
tmp_dir: str,
dest_dir: str,
) -> None:
self.config = config
self.destinations_dir = abspath(RougailConfig['destinations_dir'])
self.tmp_dir = abspath(RougailConfig['tmp_dir'])
self.templates_dir = abspath(RougailConfig['templates_dir'])
self.patches_dir = abspath(RougailConfig['patches_dir'])
self.dest_dir = dest_dir
self.tmp_dir = tmp_dir
self.distrib_dir = distrib_dir
eos = {}
functions_file = RougailConfig['functions_file']
if isfile(functions_file):
eosfunc = load_modules(functions_file)
if eosfunc_file is not None:
eosfunc = load_modules(eosfunc_file)
for func in dir(eosfunc):
if not func.startswith('_'):
eos[func] = getattr(eosfunc, func)
@ -241,33 +243,36 @@ class RougailTemplate:
def patch_template(self,
filename: str,
tmp_dir: str,
patch_dir: str,
) -> None:
"""Apply patch to a template
"""
patch_cmd = ['patch', '-d', self.tmp_dir, '-N', '-p1', '-f']
patch_cmd = ['patch', '-d', tmp_dir, '-N', '-p1']
patch_no_debug = ['-s', '-r', '-', '--backup-if-mismatch']
patch_file = join(self.patches_dir, f'{filename}.patch')
patch_file = join(patch_dir, f'{filename}.patch')
if isfile(patch_file):
log.info(_("Patching template '{filename}' with '{patch_file}'"))
ret = call(patch_cmd + patch_no_debug + ['-i', patch_file])
rel_patch_file = relpath(patch_file, tmp_dir)
ret = call(patch_cmd + patch_no_debug + ['-i', rel_patch_file])
if ret: # pragma: no cover
patch_cmd_err = ' '.join(patch_cmd + ['-i', patch_file])
msg = _(f"Error applying patch: '{patch_file}'\n"
patch_cmd_err = ' '.join(patch_cmd + ['-i', rel_patch_file])
msg = _(f"Error applying patch: '{rel_patch_file}'\n"
f"To reproduce and fix this error {patch_cmd_err}")
log.error(_(msg))
copy(join(self.templates_dir, filename), self.tmp_dir)
copy(join(self.distrib_dir, filename), tmp_dir)
def prepare_template(self,
filename: str,
tmp_dir: str,
patch_dir: str,
) -> None:
"""Prepare template source file
"""
log.info(_("Copy template: '{filename}' -> '{self.tmp_dir}'"))
if not isdir(self.tmp_dir):
raise TemplateError(_(f'cannot find tmp_dir {self.tmp_dir}'))
copy(filename, self.tmp_dir)
self.patch_template(filename)
log.info(_("Copy template: '{filename}' -> '{tmp_dir}'"))
copy(filename, tmp_dir)
self.patch_template(filename, tmp_dir, patch_dir)
def process(self,
source: str,
@ -304,6 +309,8 @@ class RougailTemplate:
def instance_file(self,
filevar: Dict,
tmp_dir: str,
dest_dir: str,
) -> None:
"""Run templatisation on one file
"""
@ -317,16 +324,14 @@ class RougailTemplate:
filenames = [filenames]
if variable:
variable = [variable]
if not isdir(self.destinations_dir):
raise TemplateError(_(f'cannot find destinations_dir {self.destinations_dir}'))
for idx, filename in enumerate(filenames):
destfilename = join(self.destinations_dir, filename[1:])
destfilename = join(dest_dir, filename[1:])
makedirs(dirname(destfilename), exist_ok=True)
if variable:
var = variable[idx]
else:
var = None
source = join(self.tmp_dir, filevar['source'])
source = join(tmp_dir, filevar['source'])
if filevar['templating'] == 'creole':
self.process(source,
filename,
@ -340,15 +345,18 @@ class RougailTemplate:
"""Run templatisation on all files
"""
ori_dir = getcwd()
chdir(self.templates_dir)
tmp_dir = relpath(self.tmp_dir, self.distrib_dir)
dest_dir = relpath(self.dest_dir, self.distrib_dir)
patch_dir = relpath(Config['patch_dir'], self.distrib_dir)
chdir(self.distrib_dir)
for option in await self.config.option.list(type='all'):
namespace = await option.option.name()
is_variable_namespace = namespace == RougailConfig['variable_namespace']
self.rougail_variables_dict[namespace] = await self.load_variables(option,
is_variable_namespace,
)
if namespace == Config['variable_namespace']:
await self.load_variables_namespace(option)
else:
self.rougail_variables_dict[namespace] = await self.load_variables_extra(option)
for template in listdir('.'):
self.prepare_template(template)
self.prepare_template(template, tmp_dir, patch_dir)
for service_obj in await self.config.option('services').list('all'):
for fills in await service_obj.list('all'):
if await fills.option.name() in ['files', 'overrides']:
@ -358,40 +366,78 @@ class RougailTemplate:
if not isfile(filename): # pragma: no cover
raise FileNotFound(_(f"File {filename} does not exist."))
if fill['activate']:
self.instance_file(fill)
self.instance_file(fill,
tmp_dir,
dest_dir,
)
else:
log.debug(_("Instantiation of file '{filename}' disabled"))
chdir(ori_dir)
async def load_variables(self,
async def load_variables_namespace (self,
optiondescription,
is_variable_namespace,
) -> RougailExtra:
"""Load all variables and set it in RougailExtra objects
):
"""load variables from the "variable namespace
"""
variables = {}
for option in await optiondescription.list('all'):
if await option.option.isoptiondescription():
if await option.option.isleadership():
for idx, suboption in enumerate(await option.list('all')):
if idx == 0:
leader = RougailLeader(await suboption.value.get())
leader_name = await suboption.option.name()
if is_variable_namespace:
leader = CreoleLeader(await suboption.value.get())
self.rougail_variables_dict[await suboption.option.name()] = leader
else:
await leader.add_follower(self.config,
await suboption.option.name(),
await suboption.option.path(),
)
else:
await self.load_variables_namespace(option)
else:
self.rougail_variables_dict[await option.option.name()] = await option.value.get()
async def load_variables_extra(self,
optiondescription,
) -> CreoleExtra:
"""Load all variables and set it in CreoleExtra objects
"""
families = {}
for family in await optiondescription.list('all'):
variables = {}
for variable in await family.list('all'):
if await variable.option.isoptiondescription():
if await variable.option.isleadership():
for idx, suboption in enumerate(await variable.list('all')):
if idx == 0:
leader = CreoleLeader(await suboption.value.get())
leader_name = await suboption.option.name()
else:
await leader.add_follower(self.config,
await suboption.option.name(),
await suboption.option.path(),
)
variables[leader_name] = leader
else:
subfamilies = await self.load_variables(option,
is_variable_namespace,
)
variables[await option.option.name()] = subfamilies
subfamilies = await self.load_variables_extra(variable)
variables[await variable.option.name()] = subfamilies
else:
if is_variable_namespace:
self.rougail_variables_dict[await option.option.name()] = await option.value.get()
variables[await option.option.name()] = await option.value.get()
return RougailExtra(variables)
variables[await variable.option.name()] = await variable.value.get()
families[await family.option.name()] = CreoleExtra(variables)
return CreoleExtra(families)
async def generate(config: Config,
eosfunc_file: str,
distrib_dir: str,
tmp_dir: str,
dest_dir: str,
) -> None:
"""Generate all files
"""
engine = CreoleTemplateEngine(config,
eosfunc_file,
distrib_dir,
tmp_dir,
dest_dir,
)
await engine.instance_files()

View File

@ -26,9 +26,8 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from json import dumps
from os.path import isfile
from .config import RougailConfig
from .config import Config
from .annotator import CONVERT_OPTION
from .objspace import RootRougailObject
@ -55,9 +54,7 @@ class TiramisuReflector:
funcs_path,
):
self.index = 0
self.text = []
if isfile(funcs_path):
self.text.extend(["from importlib.machinery import SourceFileLoader",
self.text = ["from importlib.machinery import SourceFileLoader",
"from importlib.util import spec_from_loader, module_from_spec",
f"loader = SourceFileLoader('func', '{funcs_path}')",
"spec = spec_from_loader(loader.name, loader)",
@ -65,16 +62,15 @@ class TiramisuReflector:
"loader.exec_module(func)",
"for key, value in dict(locals()).items():",
" if key != ['SourceFileLoader', 'func']:",
" setattr(func, key, value)"])
self.text.extend(["try:",
" setattr(func, key, value)",
"try:",
" from tiramisu3 import *",
"except:",
" from tiramisu import *",
])
"from rougail.tiramisu import ConvertDynOptionDescription",
]
self.objectspace = objectspace
self.make_tiramisu_objects()
if self.objectspace.has_dyn_option == True:
self.text.append("from rougail.tiramisu import ConvertDynOptionDescription")
def make_tiramisu_objects(self) -> None:
"""make tiramisu objects
@ -89,17 +85,18 @@ class TiramisuReflector:
self.populate_family(basefamily,
elt,
)
self.baseelt = baseelt
# parse object
baseelt.reflector_object.get() # pylint: disable=E1101
def reorder_family(self):
"""variable_namespace family has to be loaded before any other family
because `extra` family could use `variable_namespace` variables.
"""
if hasattr(self.objectspace.space, 'variables'):
if RougailConfig['variable_namespace'] in self.objectspace.space.variables:
yield self.objectspace.space.variables[RougailConfig['variable_namespace']]
if Config['variable_namespace'] in self.objectspace.space.variables:
yield self.objectspace.space.variables[Config['variable_namespace']]
for elt, value in self.objectspace.space.variables.items():
if elt != RougailConfig['variable_namespace']:
if elt != Config['variable_namespace']:
yield value
if hasattr(self.objectspace.space, 'services'):
yield self.objectspace.space.services
@ -151,7 +148,6 @@ class TiramisuReflector:
def get_text(self):
"""Get text
"""
self.baseelt.reflector_object.get() # pylint: disable=E1101
return '\n'.join(self.text)
@ -352,7 +348,6 @@ class Family(Common):
):
super().__init__(elt, text, objectspace)
if hasattr(self.elt, 'suffixes'):
self.objectspace.has_dyn_option = True
self.object_type = 'ConvertDynOptionDescription'
elif isinstance(self.elt, self.objectspace.leadership):
self.object_type = 'Leadership'

View File

@ -32,7 +32,6 @@ from lxml.etree import DTD, parse, XMLSyntaxError # pylint: disable=E0611
from .i18n import _
from .error import DictConsistencyError
from .config import RougailConfig
class XMLReflector:
@ -41,21 +40,37 @@ class XMLReflector:
writing the xml result on the disk
"""
def __init__(self):
self.dtd = None
def parse_dtd(self, dtdfilename):
"""Loads the Creole DTD
:raises IOError: if the DTD is not found
:param dtdfilename: the full filename of the Creole DTD
"""
dtdfilename = RougailConfig['dtdfilename']
if not isfile(dtdfilename):
raise IOError(_("no such DTD file: {}").format(dtdfilename))
with open(dtdfilename, 'r') as dtdfd:
self.dtd = DTD(dtdfd)
def load_xml_from_folders(self,
xmlfolders: List[str],
):
def parse_xmlfile(self, xmlfile):
"""Parses and validates some Creole XML against the Creole DTD
:returns: the root element tree object
"""
try:
document = parse(xmlfile)
except XMLSyntaxError as err:
raise DictConsistencyError(_(f'not a XML file: {err}'), 52, [xmlfile]) from err
if not self.dtd.validate(document):
dtd_error = self.dtd.error_log.filter_from_errors()[0]
msg = _(f'not a valid XML file: {dtd_error}')
raise DictConsistencyError(msg, 43, [xmlfile])
return document.getroot()
@staticmethod
def load_xml_from_folders(xmlfolders: List[str]):
"""Loads all the XML files located in the xmlfolders' list
:param xmlfolders: list of full folder's name
@ -65,12 +80,4 @@ class XMLReflector:
filename.endswith('.xml')]
filenames.sort()
for xmlfile in filenames:
try:
document = parse(xmlfile)
except XMLSyntaxError as err:
raise DictConsistencyError(_(f'not a XML file: {err}'), 52, [xmlfile]) from err
if not self.dtd.validate(document):
dtd_error = self.dtd.error_log.filter_from_errors()[0]
msg = _(f'not a valid XML file: {dtd_error}')
raise DictConsistencyError(msg, 43, [xmlfile])
yield xmlfile, document.getroot()
yield xmlfile

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_2 = OptionDescription(name="tata", doc="tata", children=[])
option_1 = OptionDescription(name="services", doc="services", children=[option_2], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "basic", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"auto_freeze", "expert", "force_store_value", "mandatory", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_4, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"basic", "force_store_value", "mandatory"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"basic"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "force_store_value", "mandatory"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"expert"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="without_type", doc="without_type", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", "frozen", "hidden", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = DomainnameOption(name="domain", doc="Description", default="my.domain.name", type='domainname', allow_ip=False, properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -1,19 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<rougail>
<services>
<service name="test">
<file name="/etc/file"/>
</service>
</services>
<variables>
<family name="general">
<variable name="mode_conteneur_actif" type="string" description="Description">
<value>non</value>
</variable>
</family>
</variables>
</rougail>
<!-- vim: ts=4 sw=4 expandtab
-->

View File

@ -1 +0,0 @@
{"rougail.general.mode_conteneur_actif": "non", "services.test.files.file.group": "root", "services.test.files.file.mode": "0644", "services.test.files.file.name": "/etc/file", "services.test.files.file.owner": "root", "services.test.files.file.source": "file", "services.test.files.file.templating": "creole", "services.test.files.file.activate": true}

View File

@ -1,2 +0,0 @@
non
non

View File

@ -1,28 +0,0 @@
from importlib.machinery import SourceFileLoader
from importlib.util import spec_from_loader, module_from_spec
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
spec = spec_from_loader(loader.name, loader)
func = module_from_spec(spec)
loader.exec_module(func)
for key, value in dict(locals()).items():
if key != ['SourceFileLoader', 'func']:
setattr(func, key, value)
try:
from tiramisu3 import *
except:
from tiramisu import *
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
option_8 = StrOption(name="group", doc="group", default="root")
option_9 = StrOption(name="mode", doc="mode", default="0644")
option_10 = StrOption(name="name", doc="name", default="/etc/file")
option_11 = StrOption(name="owner", doc="owner", default="root")
option_12 = StrOption(name="source", doc="source", default="file")
option_13 = StrOption(name="templating", doc="templating", default="creole")
option_14 = BoolOption(name="activate", doc="activate", default=True)
option_7 = OptionDescription(name="file", doc="file", children=[option_8, option_9, option_10, option_11, option_12, option_13, option_14])
option_6 = OptionDescription(name="files", doc="files", children=[option_7])
option_5 = OptionDescription(name="test", doc="test", children=[option_6])
option_4 = OptionDescription(name="services", doc="services", children=[option_5], properties=frozenset({"hidden"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_4])

View File

@ -1,2 +0,0 @@
%%mode_conteneur_actif
%%rougail.general.mode_conteneur_actif

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = FloatOption(name="float", doc="Description", default=0.527, properties=frozenset({"mandatory", "normal"}))
option_4 = FloatOption(name="float_multi", doc="Description", multi=True, default=[0.527], default_multi=0.527, properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", properties=frozenset({"normal"}))
option_3.impl_set_information('help', "message with '")
option_4 = StrOption(name="mode_conteneur_actif1", doc="Redefine description", properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['non'], default_multi="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote\\\"\\'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote"'], default_multi="quote\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=['quote\'"'], default_multi="quote'\"", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", multi=True, default=["quote'"], default_multi="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="Redefine description", default="quote'", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="general", doc="description", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="Other description", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_5, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"basic", "force_store_value"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_2 = OptionDescription(name="general", doc="Général", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = IntOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue(3)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params(())), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamOption(option_4)))), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote'")))), properties=frozenset({"normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"")))), properties=frozenset({"normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("quote\"'")))), properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="module_instancie", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"auto_freeze", "basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")})), Calculation(func.calc_value, Params(ParamValue('auto_frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui"), 'reverse_condition': ParamValue(True)}))}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_3.impl_set_information('test', ('test',))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_3.impl_set_information('test', ('test1', 'test2'))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_3.impl_set_information('test', (None, 'test1', 'test2'))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_3.impl_set_information('test', ('test1',))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="mode_conteneur_actif", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", Calculation(func.calc_value, Params(ParamValue('hidden'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")}))}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_4 = StrOption(name="autosavevar", doc="autosave variable", default=Calculation(func.calc_val, Params((ParamValue("oui")))), properties=frozenset({"basic", "force_store_value", "frozen", "hidden"}))
option_2 = OptionDescription(name="general", doc="général", children=[option_3, option_4], properties=frozenset({"basic"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_4 = IntOption(name="int", doc="No change", min_number=0, max_number=100, properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption())), warnings_only=False)], properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_4 = IntOption(name="int2", doc="No change", default=100, properties=frozenset({"mandatory", "normal"}))
option_5 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_lower, Params((ParamSelfOption()), kwargs={'mini': ParamValue(0), 'maxi': ParamOption(option_4)}), warnings_only=False)], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="b", properties=frozenset({"mandatory", "normal"}))
option_5 = IntOption(name="int2", doc="No change", properties=frozenset({"normal"}))
option_4 = IntOption(name="int", doc="No change", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_5))), warnings_only=False)], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", validators=[Calculation(func.valid_differ, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=False)], properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3, option_4], properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", properties=frozenset({"basic", "mandatory"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", cidr=True, properties=frozenset({"basic", "mandatory"}))
option_5 = IPOption(name="adresse_ip", doc="IP", validators=[Calculation(func.valid_in_network, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=True)], private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"mandatory", "normal"}))
option_4 = IPOption(name="adresse_ip_eth0", doc="Adresse IP de la carte", private_only=True, warnings_only=True, properties=frozenset({"basic", "mandatory"}))
option_5 = NetmaskOption(name="adresse_netmask_eth0", doc="Masque de sous réseau de la carte", validators=[Calculation(func.valid_ipnetmask, Params((ParamSelfOption(), ParamOption(option_4))), warnings_only=True)], properties=frozenset({"basic", "mandatory"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default=Calculation(func.calc_val, Params((ParamInformation("test_information", None)))), properties=frozenset({"normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
option_5 = ChoiceOption(name="enumvar", doc="enumvar", values=(1, 2, 3), default=1, properties=frozenset({"expert", "mandatory"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_6 = StrOption(name="leader", doc="leader", multi=True)

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"force_default_on_freeze", "frozen"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_6 = StrOption(name="leader", doc="leader", multi=True)

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True)
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True)
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
option_6 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True)
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True)
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
option_6 = StrOption(name="leader", doc="leader", multi=True, default=Calculation(func.calc_list, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"force_default_on_freeze", "frozen"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("non")}))}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"expert", "mandatory"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"expert"}))
option_6 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({Calculation(func.calc_value, Params(ParamValue('frozen'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("non")})), Calculation(func.calc_value, Params(ParamValue('force_default_on_freeze'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("non")}))}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True, properties=frozenset({"mandatory"}))
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_5 = StrOption(name="leader", doc="leader", multi=True)
option_6 = StrOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((), kwargs={'valeur': ParamValue("valfill")})), properties=frozenset({"mandatory", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="oui", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal"}))
option_5 = NetmaskOption(name="nut_monitor_netmask", doc="Masque de l'IP du réseau de l'esclave", multi=True)
option_6 = NetworkOption(name="nut_monitor_host", doc="Adresse IP du réseau de l'esclave", multi=True, properties=frozenset({"mandatory", "normal"}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
option_6 = StrOption(name="leader", doc="leader", multi=True)

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="condition", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="mode_conteneur_actif", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")}))}))
option_5 = StrOption(name="mode_conteneur_actif2", doc="No change", default="non", properties=frozenset({"force_default_on_freeze", "frozen", "hidden", "mandatory", "normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("oui")}))}))

View File

@ -11,6 +11,7 @@ try:
from tiramisu3 import *
except:
from tiramisu import *
from rougail.tiramisu import ConvertDynOptionDescription
option_3 = StrOption(name="condition", doc="condition", default="no", properties=frozenset({"mandatory", "normal"}))
option_4 = StrOption(name="variable1", doc="variable1", properties=frozenset({"normal", Calculation(func.calc_value, Params(ParamValue('disabled'), kwargs={'condition': ParamOption(option_3, todict=True), 'expected': ParamValue("no")}))}))
option_5 = StrOption(name="variable2", doc="variable2", default=Calculation(func.calc_val, Params((ParamOption(option_4, notraisepropertyerror=True)))), properties=frozenset({"normal"}))

Some files were not shown because too many files have changed in this diff Show More