Compare commits

..

No commits in common. "96665965f03e6deb915d00481ae0ee50fe646afb" and "e8fcfd3876ffcf13dd28dbbd486e363604ec1d97" have entirely different histories.

664 changed files with 474 additions and 1813 deletions

View file

@ -394,24 +394,6 @@ Copy a variable in another:
type: variable type: variable
variable: _.my_variable variable: _.my_variable
Copy the default value from a variable, means copy type, params and multi attribute too if not define in second variable.
.. code-block:: yaml
---
version: 1.1
my_variable:
multi: true
type: domainname
params:
allow_ip: true
my_calculated_variable:
default:
type: variable
variable: _.var1
Here my_calculated_variable is a domainname variable with parameter allow_ip=True and multi to true.
Copy one variable to another if the source has no `property` problem: Copy one variable to another if the source has no `property` problem:
.. code-block:: yaml .. code-block:: yaml

View file

@ -28,7 +28,7 @@ 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 tiramisu import Config from tiramisu import Config
from warnings import warn from copy import copy
from .convert import RougailConvert from .convert import RougailConvert
from .config import RougailConfig from .config import RougailConfig
@ -69,7 +69,7 @@ class Rougail:
"""Add a prefix""" """Add a prefix"""
self.converted.parse_directories(path_prefix) self.converted.parse_directories(path_prefix)
def run(self): def get_config(self):
"""Get Tiramisu Config""" """Get Tiramisu Config"""
if not self.config: if not self.config:
tiram_obj = self.converted.save(self.rougailconfig["tiramisu_cache"]) tiram_obj = self.converted.save(self.rougailconfig["tiramisu_cache"])
@ -83,9 +83,5 @@ class Rougail:
self.config.property.read_write() self.config.property.read_write()
return self.config return self.config
def get_config(self):
warn("get_config is deprecated, use run instead", DeprecationWarning, stacklevel=2)
return self.run()
__ALL__ = ("Rougail", "RougailConfig", "RougailUpgrade") __ALL__ = ("Rougail", "RougailConfig", "RougailUpgrade")

View file

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from typing import Optional from typing import Optional
from rougail.i18n import _ from rougail.i18n import _
from rougail.error import DictConsistencyError from rougail.error import DictConsistencyError
from rougail.utils import get_realpath
from rougail.annotator.variable import Walk from rougail.annotator.variable import Walk
from rougail.object_model import VariableCalculation from rougail.object_model import VariableCalculation
@ -243,6 +244,9 @@ class Annotator(Walk):
leader: "self.objectspace.variable", leader: "self.objectspace.variable",
follower: "self.objectspace.variable", follower: "self.objectspace.variable",
) -> None: ) -> None:
if follower.auto_save is True:
msg = _(f'leader/followers "{follower.name}" could not be auto_save')
raise DictConsistencyError(msg, 29, follower.xmlfiles)
if leader == follower: if leader == follower:
# it's a leader # it's a leader
if not leader.mode: if not leader.mode:

View file

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from rougail.i18n import _ from rougail.i18n import _
from rougail.error import DictConsistencyError from rougail.error import DictConsistencyError
from rougail.object_model import Calculation, VariableCalculation from rougail.object_model import Calculation
from tiramisu.error import display_list from tiramisu.error import display_list
@ -77,22 +77,16 @@ class Annotator(Walk): # pylint: disable=R0903
self.basic_types = {str: "string", int: "number", bool: "boolean", float: "float"} self.basic_types = {str: "string", int: "number", bool: "boolean", float: "float"}
self.convert_variable() self.convert_variable()
self.convert_test() self.convert_test()
self.convert_examples()
self.convert_help() self.convert_help()
self.verify_choices() self.verify_choices()
def convert_variable(self): def convert_variable(self):
"""convert variable""" """convert variable"""
for variable in self.get_variables(): for variable in self.get_variables():
if variable.version != "1.0":
if variable.type == "symlink": if variable.type == "symlink":
continue continue
if variable.version != "1.0":
self._convert_variable_inference(variable) self._convert_variable_inference(variable)
for variable in self.get_variables():
if variable.type == "symlink":
continue
if variable.version != "1.0":
self._default_variable_copy_informations(variable)
if variable.multi is None: if variable.multi is None:
variable.multi = False variable.multi = False
if variable.type is None: if variable.type is None:
@ -111,8 +105,6 @@ class Annotator(Walk): # pylint: disable=R0903
# choice type inference from the `choices` attribute # choice type inference from the `choices` attribute
if variable.choices is not None: if variable.choices is not None:
variable.type = "choice" variable.type = "choice"
elif variable.regexp is not None:
variable.type = "regexp"
elif variable.default not in [None, []]: elif variable.default not in [None, []]:
if isinstance(variable.default, list): if isinstance(variable.default, list):
tested_value = variable.default[0] tested_value = variable.default[0]
@ -120,35 +112,12 @@ class Annotator(Walk): # pylint: disable=R0903
tested_value = variable.default tested_value = variable.default
variable.type = self.basic_types.get(type(tested_value), None) variable.type = self.basic_types.get(type(tested_value), None)
# variable has no multi attribute # variable has no multi attribute
if variable.multi is None and not (variable.type is None and isinstance(variable.default, VariableCalculation)): if variable.multi is None:
if variable.path in self.objectspace.leaders: if variable.path in self.objectspace.leaders:
variable.multi = True variable.multi = True
else: else:
variable.multi = isinstance(variable.default, list) variable.multi = isinstance(variable.default, list)
def _default_variable_copy_informations(
self,
variable,
) -> None:
# if a variable has a variable as default value, that means the type/params or multi should has same value
if variable.type is not None or not isinstance(variable.default, VariableCalculation):
return
# copy type and params
calculated_variable_path = variable.default.variable
calculated_variable, suffix = self.objectspace.paths.get_with_dynamic(
calculated_variable_path, variable.default.path_prefix, variable.path, variable.version, variable.namespace, variable.xmlfiles
)
variable.type = calculated_variable.type
if variable.params is None and calculated_variable.params is not None:
variable.params = calculated_variable.params
# copy multi attribut
if variable.multi is None:
calculated_path = calculated_variable.path
if calculated_path in self.objectspace.leaders and variable.path in self.objectspace.followers and calculated_path.rsplit('.')[0] == variable.path.rsplit('.')[0]:
variable.multi = False
else:
variable.multi = calculated_variable.multi
def _convert_variable( def _convert_variable(
self, self,
variable: dict, variable: dict,
@ -174,11 +143,8 @@ class Annotator(Walk): # pylint: disable=R0903
variable.hidden = family.hidden variable.hidden = family.hidden
variable.hidden = None variable.hidden = None
if variable.choices is not None and variable.type != 'choice': if variable.choices is not None and variable.type != 'choice':
msg = _(f'the variable "{variable.path}" has choices attribut but has not the "choice" type') msg = _(f'the variable "{variable.path}" has choice attribut but has not the "choice" type')
raise DictConsistencyError(msg, 11, variable.xmlfiles) raise DictConsistencyError(msg, 11, variable.xmlfiles)
if variable.regexp is not None and variable.type != 'regexp':
msg = _(f'the variable "{variable.path}" has regexp attribut but has not the "regexp" type')
raise DictConsistencyError(msg, 37, variable.xmlfiles)
def convert_test(self): def convert_test(self):
"""Convert variable tests value""" """Convert variable tests value"""
@ -186,22 +152,12 @@ class Annotator(Walk): # pylint: disable=R0903
if variable.type == "symlink": if variable.type == "symlink":
continue continue
if variable.test is None: if variable.test is None:
# with we want remove test, we set "" has test value
continue continue
self.objectspace.informations.add( self.objectspace.informations.add(
variable.path, "test", tuple(variable.test) variable.path, "test", tuple(variable.test)
) )
def convert_examples(self):
"""Convert variable tests value"""
for variable in self.get_variables():
if variable.type == "symlink":
continue
if variable.examples is None:
continue
self.objectspace.informations.add(
variable.path, "examples", tuple(variable.examples)
)
def convert_help(self): def convert_help(self):
"""Convert variable help""" """Convert variable help"""
for variable in self.get_variables(): for variable in self.get_variables():

View file

@ -131,41 +131,11 @@ class _RougailConfig:
def get_leadership(self, def get_leadership(self,
option option
) -> dict: ) -> dict:
leader = None leader, *followers = option.value.get().values()
followers = []
for opt, value in option.value.get().items():
if opt.issymlinkoption():
continue
if leader is None:
leader = value
else:
followers.append(value)
return dict(zip(leader, followers)) return dict(zip(leader, followers))
def parse(self, config) -> str:
for option in config:
if option.isoptiondescription():
yield from self.parse(option)
elif not option.issymlinkoption():
yield f'{option.path()}: {option.value.get()}'
def __repr__(self):
self.config.property.read_write()
try:
values = "\n".join(self.parse(self.config))
except Exception as err:
values = str(err)
self.config.property.read_only()
return values
class FakeRougailConvert(RougailConvert): class FakeRougailConvert(RougailConvert):
def __init__(self,
add_extra_options: bool,
) -> None:
self.add_extra_options = add_extra_options
super().__init__({})
def load_config(self, def load_config(self,
rougailconfig: 'RougailConfig', rougailconfig: 'RougailConfig',
) -> None: ) -> None:
@ -179,12 +149,10 @@ class FakeRougailConvert(RougailConvert):
self.export_with_import = True self.export_with_import = True
self.internal_functions = [] self.internal_functions = []
self.plugins = ['structural_commandline'] self.plugins = ['structural_commandline']
self.add_extra_options = self.add_extra_options
def get_rougail_config(*, def get_rougail_config(*,
backward_compatibility: bool=True, backward_compatibility=True,
add_extra_options: bool=True,
) -> _RougailConfig: ) -> _RougailConfig:
if backward_compatibility: if backward_compatibility:
main_namespace_default = 'rougail' main_namespace_default = 'rougail'
@ -210,22 +178,25 @@ main_dictionaries:
main_namespace: main_namespace:
description: Main namespace name description: Main namespace name
default: MAIN_MAMESPACE_DEFAULT default: MAIN_MAMESPACE_DEFAULT
alternative_name: s alternative_name: n
mandatory: false mandatory: false
extra_dictionaries: extra_dictionaries:
description: Extra namespaces description: Extra namespaces
type: leadership type: leadership
disabled: disabled:
variable: main_namespace type: jinja
when: null jinja: |
{% if not main_namespace %}
main_namespace not available
{% endif %}
names: names:
description: 'Extra namespace name' description: 'Extra namespace name'
alternative_name: xn # alternative_name: e
multi: true multi: true
mandatory: false mandatory: false
directories: directories:
description: Directories where extra dictionary files are placed description: Directories where extra dictionary files are placed
alternative_name: xd # alternative_name: d
type: unix_filename type: unix_filename
params: params:
allow_relative: true allow_relative: true
@ -235,7 +206,7 @@ extra_dictionaries:
multi: true multi: true
functions_files: functions_files:
description: File with functions description: File with functions
alternative_name: c alternative_name: f
type: unix_filename type: unix_filename
params: params:
allow_relative: true allow_relative: true
@ -308,9 +279,9 @@ suffix:
mandatory: false mandatory: false
commandline: false commandline: false
""".replace('MAIN_MAMESPACE_DEFAULT', main_namespace_default) """.replace('MAIN_MAMESPACE_DEFAULT', main_namespace_default)
processes = {'structural': [], processes = {'output': [],
'output': [],
'user data': [], 'user data': [],
# 'structural': [],
} }
for module in get_sub_modules().values(): for module in get_sub_modules().values():
data = module.get_rougail_config() data = module.get_rougail_config()
@ -331,15 +302,13 @@ suffix:
) )
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 == 'user data':
rougail_process += " commandline: false" rougail_process +=""" multi: true
elif process == 'user data':
rougail_process += """ multi: true
mandatory: false mandatory: false
""" """
hidden_outputs = [process['name'] for process in processes['output'] if not process.get('allow_user_data', True)] hidden_outputs = [process['name'] for process in processes['output'] if not process.get('allow_user_data', True)]
if hidden_outputs: if hidden_outputs:
rougail_process += """ hidden: rougail_process +=""" hidden:
type: jinja type: jinja
jinja: | jinja: |
""" """
@ -355,12 +324,10 @@ suffix:
{NAME}: {NAME}:
description: Select for {NAME} description: Select for {NAME}
hidden: true hidden: true
mandatory: false
multi: true
""".format(NAME=normalize_family(process), """.format(NAME=normalize_family(process),
) )
rougail_options += rougail_process rougail_options += rougail_process
convert = FakeRougailConvert(add_extra_options) convert = FakeRougailConvert({})
convert._init() convert._init()
convert.namespace = None convert.namespace = None
convert.parse_root_file( convert.parse_root_file(

View file

@ -317,7 +317,6 @@ class Informations:
class ParserVariable: class ParserVariable:
def __init__(self, rougailconfig): def __init__(self, rougailconfig):
self.load_config(rougailconfig) self.load_config(rougailconfig)
self.rougailconfig = rougailconfig
self.paths = Paths(self.main_namespace) self.paths = Paths(self.main_namespace)
self.families = [] self.families = []
self.variables = [] self.variables = []
@ -333,6 +332,9 @@ class ParserVariable:
self.convert_options = list(CONVERT_OPTION) self.convert_options = list(CONVERT_OPTION)
self.convert_options.extend(self.custom_types) self.convert_options.extend(self.custom_types)
# #
self.family = Family
self.dynamic = Dynamic
#
self.exclude_imports = [] self.exclude_imports = []
self.informations = Informations() self.informations = Informations()
self.properties = Property() self.properties = Property()
@ -361,14 +363,12 @@ class ParserVariable:
self.base_option_name = rougailconfig["base_option_name"] self.base_option_name = rougailconfig["base_option_name"]
self.export_with_import = rougailconfig["export_with_import"] self.export_with_import = rougailconfig["export_with_import"]
self.internal_functions = rougailconfig["internal_functions"] self.internal_functions = rougailconfig["internal_functions"]
self.add_extra_options = rougailconfig["structural_commandline.add_extra_options"]
self.plugins = [] self.plugins = []
def _init(self): def _init(self):
if self.is_init: if self.is_init:
return return
variable = Variable variable = Variable
family = Family
if self.plugins: if self.plugins:
root = Path(__file__).parent root = Path(__file__).parent
for plugin in self.plugins: for plugin in self.plugins:
@ -376,15 +376,13 @@ class ParserVariable:
if not module_path.is_file(): if not module_path.is_file():
continue continue
module = load_modules(f'rougail.{plugin}.object_model', str(module_path)) module = load_modules(f'rougail.{plugin}.object_model', str(module_path))
if 'Variable' in module.__all__: if 'Variable' not in module.__all__:
variable = type(variable.__name__ + '_' + plugin, (variable, module.Variable), {}) continue
if 'Family' in module.__all__: variable = type(variable.__name__ + '_' + plugin, (Variable, module.Variable), {})
family = type(family.__name__ + '_' + plugin, (family, module.Family), {})
self.variable = variable self.variable = variable
self.family = family
self.dynamic = type(Dynamic.__name__, (Dynamic, family), {})
hint = get_type_hints(self.dynamic) hint = get_type_hints(self.dynamic)
# FIXME: only for format 1.0 # FIXME: only for format 1.0
hint["variable"] = str
self.family_types = hint["type"].__args__ # pylint: disable=W0201 self.family_types = hint["type"].__args__ # pylint: disable=W0201
self.family_attrs = frozenset( # pylint: disable=W0201 self.family_attrs = frozenset( # pylint: disable=W0201
set(hint) - {"name", "path", "xmlfiles"} | {"redefine"} set(hint) - {"name", "path", "xmlfiles"} | {"redefine"}
@ -590,18 +588,7 @@ class ParserVariable:
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}")
obj_type = self.get_family_or_variable_type(family_obj) if self.get_family_or_variable_type(family_obj) == "dynamic":
if obj_type is None:
# auto set type
if '_dynamic' in family_obj:
dynamic = family_obj['_dynamic']
elif 'dynamic' in family_obj:
dynamic = family_obj['dynamic']
else:
dynamic = None
if isinstance(dynamic, (list, dict)):
family_obj['type'] = obj_type = 'dynamic'
if obj_type == "dynamic":
family_is_dynamic = True family_is_dynamic = True
parent_dynamic = path parent_dynamic = path
if '{{ suffix }}' not in name: if '{{ suffix }}' not in name:
@ -1010,16 +997,11 @@ class ParserVariable:
calculations = calculations[0] calculations = calculations[0]
else: else:
calculations = calculations[1] calculations = calculations[1]
if not isinstance(value, dict) or attribute not in calculations: return (
return False attribute in calculations
if 'type' in value: and isinstance(value, dict)
return value['type'] in CALCULATION_TYPES and value.get("type") in CALCULATION_TYPES
# auto set type )
typ = set(CALCULATION_TYPES) & set(value)
if len(typ) == 1:
value['type'] = list(typ)[0]
return True
return False
def set_calculation( def set_calculation(
self, self,
@ -1052,11 +1034,6 @@ class ParserVariable:
raise Exception("params must be a dict") raise Exception("params must be a dict")
params = [] params = []
for key, val in calculation_object["params"].items(): for key, val in calculation_object["params"].items():
if isinstance(val, dict) and "type" not in val:
# auto set type
param_typ = set(CALCULATION_TYPES) & set(val)
if len(param_typ) == 1:
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:
param_typ = "any" param_typ = "any"
val = { val = {
@ -1235,8 +1212,6 @@ class RougailConvert(ParserVariable):
objects, objects,
filename, filename,
) )
if objects is None:
return
self.parse_root_file(filename, self.parse_root_file(filename,
path, path,
version, version,
@ -1291,8 +1266,6 @@ class RougailConvert(ParserVariable):
filename: str, filename: str,
) -> None: ) -> None:
"""version is mandatory in YAML file""" """version is mandatory in YAML file"""
if obj is None:
obj = {}
for name in ["_version", "version"]: for name in ["_version", "version"]:
if name not in obj: if name not in obj:
continue continue

View file

@ -79,15 +79,3 @@ class UpgradeError(Exception):
class NotFoundError(Exception): class NotFoundError(Exception):
"not found error" "not found error"
pass pass
## ---- specific exceptions ----
class VariableCalculationDependencyError(Exception):
"""When an attribute is set, and
the target of this attribute doesn't exists.
"""
def __init__(self, msg, errno, xmlfiles):
if xmlfiles:
msg = _(f"{msg} in {display_xmlfiles(xmlfiles)}")
super().__init__(msg)
self.errno = errno

View file

@ -31,7 +31,7 @@ from pydantic import (
) )
from tiramisu import undefined from tiramisu import undefined
from .utils import get_jinja_variable_to_param, get_realpath from .utils import get_jinja_variable_to_param, get_realpath
from .error import DictConsistencyError, VariableCalculationDependencyError from .error import DictConsistencyError
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None] BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
PROPERTY_ATTRIBUTE = ["frozen", "hidden", "disabled", "mandatory"] PROPERTY_ATTRIBUTE = ["frozen", "hidden", "disabled", "mandatory"]
@ -46,7 +46,7 @@ def convert_boolean(value: str) -> bool:
return True return True
elif value == "false": elif value == "false":
return False return False
elif value in ["", None]: elif value in ['', None]:
return None return None
raise Exception(f'unknown boolean value "{value}"') raise Exception(f'unknown boolean value "{value}"')
@ -61,48 +61,36 @@ CONVERT_OPTION = {
"unix_filename": dict(opttype="FilenameOption", example="/tmp/myfile.txt"), "unix_filename": dict(opttype="FilenameOption", example="/tmp/myfile.txt"),
"date": dict(opttype="DateOption", example="2000-01-01"), "date": dict(opttype="DateOption", example="2000-01-01"),
"unix_user": dict(opttype="UsernameOption", example="username"), "unix_user": dict(opttype="UsernameOption", example="username"),
"ip": dict( "ip": dict(opttype="IPOption", initkwargs={"allow_reserved": True}, example="1.1.1.1"),
opttype="IPOption", initkwargs={"allow_reserved": True}, example="1.1.1.1"
),
"cidr": dict(opttype="IPOption", initkwargs={"cidr": True}, example="1.1.1.0/24"), "cidr": dict(opttype="IPOption", initkwargs={"cidr": True}, example="1.1.1.0/24"),
"netmask": dict(opttype="NetmaskOption", example="255.255.255.0"), "netmask": dict(opttype="NetmaskOption", example="255.255.255.0"),
"network": dict(opttype="NetworkOption", example="1.1.1.0"), "network": dict(opttype="NetworkOption", example="1.1.1.0"),
"network_cidr": dict( "network_cidr": dict(opttype="NetworkOption", initkwargs={"cidr": True}, example="1.1.1.0/24"),
opttype="NetworkOption", initkwargs={"cidr": True}, example="1.1.1.0/24"
),
"broadcast": dict(opttype="BroadcastOption", example="1.1.1.255"), "broadcast": dict(opttype="BroadcastOption", example="1.1.1.255"),
"netbios": dict( "netbios": dict(
opttype="DomainnameOption", opttype="DomainnameOption",
initkwargs={"type": "netbios", "warnings_only": True}, initkwargs={"type": "netbios", "warnings_only": True},
example="example", example="example"
), ),
"domainname": dict( "domainname": dict(
opttype="DomainnameOption", opttype="DomainnameOption", initkwargs={"type": "domainname", "allow_ip": False},
initkwargs={"type": "domainname", "allow_ip": False}, example="example.net"
example="example.net",
), ),
"hostname": dict( "hostname": dict(
opttype="DomainnameOption", opttype="DomainnameOption", initkwargs={"type": "hostname", "allow_ip": False},
initkwargs={"type": "hostname", "allow_ip": False}, example="example"
example="example",
), ),
"web_address": dict( "web_address": dict(
opttype="URLOption", opttype="URLOption", initkwargs={"allow_ip": False, "allow_without_dot": True},
initkwargs={"allow_ip": False, "allow_without_dot": True}, example="https://example.net"
example="https://example.net",
),
"port": dict(
opttype="PortOption", initkwargs={"allow_private": True}, example="111"
), ),
"port": dict(opttype="PortOption", initkwargs={"allow_private": True}, example="111"),
"mac": dict(opttype="MACOption", example="00:00:00:00:00"), "mac": dict(opttype="MACOption", example="00:00:00:00:00"),
"unix_permissions": dict( "unix_permissions": dict(
opttype="PermissionsOption", opttype="PermissionsOption", initkwargs={"warnings_only": True}, func=int,
initkwargs={"warnings_only": True}, example="644"
func=int,
example="644",
), ),
"choice": dict(opttype="ChoiceOption", example="a_choice"), "choice": dict(opttype="ChoiceOption", example="a_choice"),
"regexp": dict(opttype="RegexpOption"),
# #
"symlink": dict(opttype="SymLinkOption"), "symlink": dict(opttype="SymLinkOption"),
} }
@ -112,8 +100,7 @@ class Param(BaseModel):
key: str key: str
model_config = ConfigDict(extra="forbid") model_config = ConfigDict(extra="forbid")
def __init__( def __init__(self,
self,
path, path,
attribute, attribute,
family_is_dynamic, family_is_dynamic,
@ -133,7 +120,6 @@ class VariableParam(Param):
type: str type: str
variable: str variable: str
propertyerror: bool = True propertyerror: bool = True
whole: bool = False
optional: bool = False optional: bool = False
@ -141,13 +127,12 @@ class SuffixParam(Param):
type: str type: str
suffix: Optional[int] = None suffix: Optional[int] = None
def __init__( def __init__(self,
self,
**kwargs, **kwargs,
) -> None: ) -> None:
if not kwargs["family_is_dynamic"]: if not kwargs['family_is_dynamic']:
msg = f'suffix parameter for "{kwargs["attribute"]}" in "{kwargs["path"]}" cannot be set none dynamic family' msg = f'suffix parameter for "{kwargs["attribute"]}" in "{kwargs["path"]}" cannot be set none dynamic family'
raise DictConsistencyError(msg, 10, kwargs["xmlfiles"]) raise DictConsistencyError(msg, 10, kwargs['xmlfiles'])
super().__init__(**kwargs) super().__init__(**kwargs)
@ -160,17 +145,17 @@ class InformationParam(Param):
class IndexParam(Param): class IndexParam(Param):
type: str type: str
def __init__( def __init__(self,
self,
**kwargs, **kwargs,
) -> None: ) -> None:
if not kwargs["is_follower"]: if not kwargs["is_follower"]:
msg = f'the variable "{kwargs["path"]}" is not a follower, so cannot have index type for param in "{kwargs["attribute"]}"' msg = f'the variable "{kwargs["path"]}" is not a follower, so cannot have index type for param in "{kwargs["attribute"]}"'
raise DictConsistencyError(msg, 25, kwargs["xmlfiles"]) raise DictConsistencyError(msg, 25, kwargs['xmlfiles'])
super().__init__(**kwargs) super().__init__(**kwargs)
PARAM_TYPES = { PARAM_TYPES = {
"any": AnyParam, "any": AnyParam,
"variable": VariableParam, "variable": VariableParam,
@ -185,8 +170,8 @@ class Calculation(BaseModel):
path: str path: str
inside_list: bool inside_list: bool
version: str version: str
ori_path: Optional[str] = None ori_path: Optional[str]=None
default_values: Any = None default_values: Any=None
namespace: Optional[str] namespace: Optional[str]
xmlfiles: List[str] xmlfiles: List[str]
@ -210,12 +195,7 @@ class Calculation(BaseModel):
else: else:
path = self.ori_path path = self.ori_path
variable, suffix = objectspace.paths.get_with_dynamic( variable, suffix = objectspace.paths.get_with_dynamic(
param["variable"], param["variable"], self.path_prefix, path, self.version, self.namespace, self.xmlfiles
self.path_prefix,
path,
self.version,
self.namespace,
self.xmlfiles,
) )
if not variable: if not variable:
if not param.get("optional"): if not param.get("optional"):
@ -234,12 +214,7 @@ class Calculation(BaseModel):
else: else:
path = self.ori_path path = self.ori_path
variable, suffix = objectspace.paths.get_with_dynamic( variable, suffix = objectspace.paths.get_with_dynamic(
param["variable"], param["variable"], self.path_prefix, path, self.version, self.namespace, self.xmlfiles
self.path_prefix,
path,
self.version,
self.namespace,
self.xmlfiles,
) )
if not variable: if not variable:
msg = f'cannot find variable "{param["variable"]}" defined in "{self.attribute_name}" for "{self.path}"' msg = f'cannot find variable "{param["variable"]}" defined in "{self.attribute_name}" for "{self.path}"'
@ -256,14 +231,7 @@ class Calculation(BaseModel):
class JinjaCalculation(Calculation): class JinjaCalculation(Calculation):
attribute_name: Literal[ attribute_name: Literal[
"frozen", "frozen", "hidden", "mandatory", "disabled", "default", "validators", "choices", "dynamic"
"hidden",
"mandatory",
"disabled",
"default",
"validators",
"choices",
"dynamic",
] ]
jinja: StrictStr jinja: StrictStr
params: Optional[List[Param]] = None params: Optional[List[Param]] = None
@ -296,7 +264,7 @@ class JinjaCalculation(Calculation):
}, },
} }
if self.default_values: if self.default_values:
default["params"]["__default_value"] = self.default_values default["params"]['__default_value'] = self.default_values
if add_help: if add_help:
default["help"] = function + "_help" default["help"] = function + "_help"
if self.params: if self.params:
@ -372,7 +340,7 @@ class JinjaCalculation(Calculation):
False, False,
objectspace, objectspace,
add_help=True, add_help=True,
params={None: [self.attribute_name], "when": True, "inverse": False}, params={None: [self.attribute_name], 'when': True, 'inverse': False},
) )
elif self.attribute_name == "choices": elif self.attribute_name == "choices":
return_type = self.return_type return_type = self.return_type
@ -394,42 +362,31 @@ class JinjaCalculation(Calculation):
raise Exception("hu?") raise Exception("hu?")
class _VariableCalculation(Calculation): class VariableCalculation(Calculation):
attribute_name: Literal[
"default", "choices", "dynamic"
]
variable: StrictStr variable: StrictStr
propertyerror: bool = True propertyerror: bool = True
allow_none: bool = False allow_none: bool = False
def get_variable(self, def get_params(self,
objectspace, objectspace,
) -> "Variable": needs_multi: Optional[bool] = None,
):
if self.ori_path is None: if self.ori_path is None:
path = self.path path = self.path
else: else:
path = self.ori_path path = self.ori_path
variable, suffix = objectspace.paths.get_with_dynamic( variable, suffix = objectspace.paths.get_with_dynamic(
self.variable, self.variable, self.path_prefix, path, self.version, self.namespace, self.xmlfiles
self.path_prefix,
path,
self.version,
self.namespace,
self.xmlfiles,
) )
if variable and not isinstance(variable, objectspace.variable):
# FIXME remove the pfff
raise Exception("pfff it's a family")
return variable, suffix
def get_params(
self,
objectspace,
variable: "Variable",
suffix: Optional[str],
*,
needs_multi: Optional[bool] = None,
):
if not variable: if not variable:
msg = f'Variable not found "{self.variable}" for attribut "{self.attribute_name}" for variable "{self.path}"' msg = f'Variable not found "{self.variable}" for attribut "{self.attribute_name}" for variable "{self.path}"'
raise DictConsistencyError(msg, 88, self.xmlfiles) raise DictConsistencyError(msg, 88, self.xmlfiles)
if not isinstance(variable, objectspace.variable):
# FIXME remove the pfff
raise Exception("pfff it's a family")
param = { param = {
"type": "variable", "type": "variable",
"variable": variable, "variable": variable,
@ -439,7 +396,7 @@ class _VariableCalculation(Calculation):
param["suffix"] = suffix param["suffix"] = suffix
params = {None: [param]} params = {None: [param]}
if self.default_values: if self.default_values:
params["__default_value"] = self.default_values params['__default_value'] = self.default_values
if self.allow_none: if self.allow_none:
params["allow_none"] = True params["allow_none"] = True
if needs_multi is None: if needs_multi is None:
@ -449,15 +406,11 @@ class _VariableCalculation(Calculation):
needs_multi = self.path in objectspace.multis needs_multi = self.path in objectspace.multis
calc_variable_is_multi = variable.path in objectspace.multis calc_variable_is_multi = variable.path in objectspace.multis
if not calc_variable_is_multi: if not calc_variable_is_multi:
if variable.path in objectspace.paths._dynamics and ( if variable.path in objectspace.paths._dynamics and (suffix is None or suffix[-1] is None):
suffix is None or suffix[-1] is None
):
self_dyn_path = objectspace.paths._dynamics.get(self.path) self_dyn_path = objectspace.paths._dynamics.get(self.path)
if self_dyn_path is not None: if self_dyn_path is not None:
var_dyn_path = objectspace.paths._dynamics[variable.path] var_dyn_path = objectspace.paths._dynamics[variable.path]
if self_dyn_path != var_dyn_path and not self_dyn_path.startswith( if self_dyn_path != var_dyn_path and not self_dyn_path.startswith(f'{var_dyn_path}.'):
f"{var_dyn_path}."
):
calc_variable_is_multi = True calc_variable_is_multi = True
else: else:
calc_variable_is_multi = True calc_variable_is_multi = True
@ -477,33 +430,18 @@ class _VariableCalculation(Calculation):
raise DictConsistencyError(msg, 21, self.xmlfiles) raise DictConsistencyError(msg, 21, self.xmlfiles)
return params return params
class VariableCalculation(_VariableCalculation):
attribute_name: Literal["default", "choices", "dynamic"]
optional: bool = False
def to_function( def to_function(
self, self,
objectspace, objectspace,
) -> dict: ) -> dict:
if self.attribute_name != "default" and self.optional is True: params = self.get_params(objectspace)
msg = f'"{self.attribute_name}" variable shall not have an "optional" attribute for variable "{self.variable}"'
raise DictConsistencyError(msg, 33, self.xmlfiles)
variable, suffix = self.get_variable(objectspace)
if not variable and self.optional:
msg = f'the dependent variable was not found "{self.optional}" for attribute "{self.attribute_name}" in variable "{self.path}"'
raise VariableCalculationDependencyError(msg, 90, self.xmlfiles)
params = self.get_params(objectspace,
variable,
suffix,
)
return { return {
"function": "calc_value", "function": "calc_value",
"params": params, "params": params,
} }
class VariablePropertyCalculation(_VariableCalculation): class VariablePropertyCalculation(VariableCalculation):
attribute_name: Literal[*PROPERTY_ATTRIBUTE] attribute_name: Literal[*PROPERTY_ATTRIBUTE]
when: Any = undefined when: Any = undefined
when_not: Any = undefined when_not: Any = undefined
@ -512,14 +450,10 @@ class VariablePropertyCalculation(_VariableCalculation):
self, self,
objectspace, objectspace,
) -> dict: ) -> dict:
variable, suffix = self.get_variable(objectspace) params = self.get_params(objectspace, False)
params = self.get_params(objectspace,
variable,
suffix,
needs_multi=False,)
variable = params[None][0]["variable"] variable = params[None][0]["variable"]
if self.when is not undefined: if self.when is not undefined:
if self.version == "1.0": if self.version == '1.0':
msg = f'when is not allowed in format version 1.0 for attribute "{self.attribute_name}" for variable "{self.path}"' msg = f'when is not allowed in format version 1.0 for attribute "{self.attribute_name}" for variable "{self.path}"'
raise DictConsistencyError(msg, 103, variable.xmlfiles) raise DictConsistencyError(msg, 103, variable.xmlfiles)
if self.when_not is not undefined: if self.when_not is not undefined:
@ -528,7 +462,7 @@ class VariablePropertyCalculation(_VariableCalculation):
when = self.when when = self.when
inverse = False inverse = False
elif self.when_not is not undefined: elif self.when_not is not undefined:
if self.version == "1.0": if self.version == '1.0':
msg = f'when_not is not allowed in format version 1.0 for attribute "{self.attribute_name}" for variable "{self.path}"' msg = f'when_not is not allowed in format version 1.0 for attribute "{self.attribute_name}" for variable "{self.path}"'
raise DictConsistencyError(msg, 104, variable.xmlfiles) raise DictConsistencyError(msg, 104, variable.xmlfiles)
when = self.when_not when = self.when_not
@ -539,10 +473,9 @@ class VariablePropertyCalculation(_VariableCalculation):
when = True when = True
inverse = False inverse = False
params[None].insert(0, self.attribute_name) params[None].insert(0, self.attribute_name)
params["when"] = when params['when'] = when
params["inverse"] = inverse params['inverse'] = inverse
return { return {"function": "variable_to_property",
"function": "variable_to_property",
"params": params, "params": params,
"help": "variable_to_property", "help": "variable_to_property",
} }
@ -557,13 +490,10 @@ class InformationCalculation(Calculation):
self, self,
objectspace, objectspace,
) -> dict: ) -> dict:
params = { params = {None: [{
None: [
{
"type": "information", "type": "information",
"information": self.information, "information": self.information,
} }]
]
} }
if self.variable: if self.variable:
if self.ori_path is None: if self.ori_path is None:
@ -571,79 +501,33 @@ class InformationCalculation(Calculation):
else: else:
path = self.ori_path path = self.ori_path
variable, suffix = objectspace.paths.get_with_dynamic( variable, suffix = objectspace.paths.get_with_dynamic(
self.variable, self.variable, self.path_prefix, path, self.version, self.namespace, self.xmlfiles
self.path_prefix,
path,
self.version,
self.namespace,
self.xmlfiles,
) )
if variable is None or suffix is not None: if variable is None or suffix is not None:
raise Exception("pfff") raise Exception("pfff")
params[None][0]["variable"] = variable params[None][0]["variable"] = variable
if self.default_values: if self.default_values:
params["__default_value"] = self.default_values params['__default_value'] = self.default_values
return { return {
"function": "calc_value", "function": "calc_value",
"params": params, "params": params,
} }
class _SuffixCalculation(Calculation): class SuffixCalculation(Calculation):
attribute_name: Literal["default", "choice", "dynamic"]
suffix: Optional[int] = None suffix: Optional[int] = None
def get_suffix(self) -> dict: def to_function(
self,
objectspace,
) -> dict:
suffix = {"type": "suffix"} suffix = {"type": "suffix"}
if self.suffix is not None: if self.suffix is not None:
suffix["suffix"] = self.suffix suffix['suffix'] = self.suffix
return suffix
class SuffixCalculation(_SuffixCalculation):
attribute_name: Literal["default", "choice", "dynamic"]
def to_function(
self,
objectspace,
) -> dict:
return { return {
"function": "calc_value", "function": "calc_value",
"params": {None: [self.get_suffix()]}, "params": {None: [suffix]},
}
class SuffixPropertyCalculation(_SuffixCalculation):
attribute_name: Literal[*PROPERTY_ATTRIBUTE]
when: Any = undefined
when_not: Any = undefined
def to_function(
self,
objectspace,
) -> dict:
if self.version == "1.0":
msg = f'when is not allowed in format version 1.0 for attribute "{self.attribute_name}"'
raise DictConsistencyError(msg, 105, variable.xmlfiles)
if self.when is not undefined:
if self.when_not is not undefined:
msg = f'the suffix has an invalid attribute "{self.attribute_name}", when and when_not cannot set together'
raise DictConsistencyError(msg, 35, variable.xmlfiles)
when = self.when
inverse = False
elif self.when_not is not undefined:
when = self.when_not
inverse = True
else:
msg = f'the suffix has an invalid attribute "{self.attribute_name}", when and when_not cannot set together'
raise DictConsistencyError
params = {None: [self.attribute_name, self.get_suffix()],
"when": when,
"inverse": inverse,
}
return {
"function": "variable_to_property",
"params": params,
"help": "variable_to_property",
} }
@ -674,7 +558,7 @@ CALCULATION_PROPERTY_TYPES = {
"jinja": JinjaCalculation, "jinja": JinjaCalculation,
"variable": VariablePropertyCalculation, "variable": VariablePropertyCalculation,
"information": InformationCalculation, "information": InformationCalculation,
"suffix": SuffixPropertyCalculation, "suffix": SuffixCalculation,
"index": IndexCalculation, "index": IndexCalculation,
} }
BASETYPE_CALC = Union[StrictBool, StrictInt, StrictFloat, StrictStr, Calculation, None] BASETYPE_CALC = Union[StrictBool, StrictInt, StrictFloat, StrictStr, Calculation, None]
@ -698,7 +582,7 @@ class Family(BaseModel):
class Dynamic(Family): class Dynamic(Family):
# None only for format 1.0 # None only for format 1.0
variable: str = None variable: str=None
dynamic: Union[List[Union[StrictStr, Calculation]], Calculation] dynamic: Union[List[Union[StrictStr, Calculation]], Calculation]
@ -709,7 +593,6 @@ class Variable(BaseModel):
description: Optional[str] = None description: Optional[str] = None
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
regexp: Optional[str] = None
params: Optional[List[Param]] = None params: Optional[List[Param]] = None
validators: Optional[List[Calculation]] = None validators: Optional[List[Calculation]] = None
multi: Optional[bool] = None multi: Optional[bool] = None
@ -721,7 +604,6 @@ class Variable(BaseModel):
auto_save: bool = False auto_save: bool = False
mode: Optional[str] = None mode: Optional[str] = None
test: Optional[list] = None test: Optional[list] = None
examples: Optional[list] = None
path: str path: str
namespace: Optional[str] namespace: Optional[str]
version: str version: str
@ -730,6 +612,11 @@ class Variable(BaseModel):
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True) model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
#class Choice(Variable):
# type: Literal["choice"] = "choice"
# choices: Union[List[BASETYPE_CALC], Calculation]
class SymLink(BaseModel): class SymLink(BaseModel):
type: Literal["symlink"] = "symlink" type: Literal["symlink"] = "symlink"
name: str name: str

View file

@ -20,70 +20,34 @@ 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 rougail.annotator.variable import Walk from rougail.annotator.variable import Walk
from rougail.utils import _
from rougail.error import DictConsistencyError
class Annotator(Walk): class Annotator(Walk):
"""Annotate value""" """Annotate value"""
level = 80 level = 5
def __init__(self, objectspace, *args) -> None: def __init__(self, objectspace, *args) -> None:
if not objectspace.paths: if not objectspace.paths:
return return
self.alternative_names = {}
self.objectspace = objectspace self.objectspace = objectspace
not_for_commandlines = [] self.manage_alternative_name()
for family in self.get_families(): self.not_for_commandline()
if family.commandline:
continue def manage_alternative_name(self) -> None:
self.not_for_commandline(family)
not_for_commandlines.append(family.path + '.')
for variable in self.get_variables(): for variable in self.get_variables():
if variable.type == 'symlink': if variable.type == 'symlink':
continue continue
variable_path = variable.path
for family_path in not_for_commandlines:
if variable_path.startswith(family_path):
break
else:
if not variable.commandline:
self.not_for_commandline(variable)
else:
self.manage_alternative_name(variable)
self.manage_negative_description(variable)
def not_for_commandline(self, variable) -> None:
self.objectspace.properties.add(variable.path, 'not_for_commandline', True)
def manage_alternative_name(self, variable) -> None:
if not variable.alternative_name: if not variable.alternative_name:
return continue
alternative_name = variable.alternative_name alternative_name = variable.alternative_name
variable_path = variable.path variable_path = variable.path
all_letters = ''
for letter in alternative_name:
all_letters += letter
if all_letters == 'h':
msg = _(f'alternative_name "{alternative_name}" conflict with "--help"')
raise DictConsistencyError(msg, 202, variable.xmlfiles)
if all_letters in self.alternative_names:
msg = _(f'conflict alternative_name "{alternative_name}": "{variable_path}" and "{self.alternative_names[all_letters]}"')
raise DictConsistencyError(msg, 202, variable.xmlfiles)
self.alternative_names[alternative_name] = variable_path
if '.' not in variable_path: if '.' not in variable_path:
path = alternative_name path = alternative_name
else: else:
path = variable_path.rsplit('.', 1)[0] + '.' + alternative_name path = variable_path.rsplit('.', 1)[0] + '.' + alternative_name
self.objectspace.add_variable(alternative_name, {'type': 'symlink', 'path': path, 'opt': variable}, variable.xmlfiles, False, False, variable.version) self.objectspace.add_variable(alternative_name, {'type': 'symlink', 'path': path, 'opt': variable}, variable.xmlfiles, False, False, variable.version)
def manage_negative_description(self, variable) -> None: def not_for_commandline(self) -> None:
if not variable.negative_description: for variable in self.get_variables():
if variable.type == 'boolean' and not self.objectspace.add_extra_options: if not hasattr(variable, 'commandline') or variable.commandline:
raise DictConsistencyError(_(f'negative_description is mandatory for boolean variable, but "{variable.path}" hasn\'t'), 200, variable.xmlfiles) continue
return self.objectspace.properties.add(variable.path, 'not_for_commandline', True)
if variable.type != 'boolean':
raise DictConsistencyError(_(f'negative_description is only available for boolean variable, but "{variable.path}" is "{variable.type}"'), 201, variable.xmlfiles)
self.objectspace.informations.add(
variable.path, "negative_description", variable.negative_description
)

View file

@ -1,42 +0,0 @@
"""
Config file for Rougail-structural_commandline
Silique (https://www.silique.fr)
Copyright (C) 2024
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
"""
def get_rougail_config(*,
backward_compatibility=True,
) -> dict:
options = """
structural_commandline:
description: Configuration rougail-structural_commandline
commandline: false
add_extra_options:
description: Add extra options to tiramisu-cmdline-parser
default: true
"""
return {'name': 'exporter',
'process': 'structural',
'options': options,
'level': 20,
}
__all__ = ('get_rougail_config')

View file

@ -26,11 +26,6 @@ from pydantic import BaseModel
class Variable(BaseModel): class Variable(BaseModel):
alternative_name: Optional[str]=None alternative_name: Optional[str]=None
commandline: bool=True commandline: bool=True
negative_description: Optional[str]=None
class Family(BaseModel): __all__ = ('Variable',)
commandline: bool=True
__all__ = ('Variable', 'Family')

View file

@ -41,9 +41,10 @@ from .utils import normalize_family
global func global func
func = {}
dict_env = {} dict_env = {}
ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined) ENV = SandboxedEnvironment(loader=DictLoader(dict_env), undefined=StrictUndefined)
func = ENV.filters ENV.filters = func
ENV.compile_templates('jinja_caches', zip=None) ENV.compile_templates('jinja_caches', zip=None)

View file

@ -33,7 +33,7 @@ from json import dumps
from os.path import isfile, basename from os.path import isfile, basename
from .i18n import _ from .i18n import _
from .error import DictConsistencyError, VariableCalculationDependencyError from .error import DictConsistencyError
from .utils import normalize_family from .utils import normalize_family
from .object_model import Calculation, CONVERT_OPTION from .object_model import Calculation, CONVERT_OPTION
@ -74,14 +74,11 @@ class TiramisuReflector:
[ [
"from tiramisu import *", "from tiramisu import *",
"from tiramisu.setting import ALLOWED_LEADER_PROPERTIES", "from tiramisu.setting import ALLOWED_LEADER_PROPERTIES",
"from re import compile as re_compile",
] ]
) )
if self.objectspace.export_with_import: if self.objectspace.export_with_import:
self.text["header"].extend( self.text["header"].extend(
[ ["from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription"]
"from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription"
]
) )
if funcs_paths: if funcs_paths:
for funcs_path in sorted(funcs_paths, key=sorted_func_name): for funcs_path in sorted(funcs_paths, key=sorted_func_name):
@ -108,7 +105,7 @@ class TiramisuReflector:
baseelt = BaseElt() baseelt = BaseElt()
self.objectspace.reflector_names[ self.objectspace.reflector_names[
baseelt.path baseelt.path
] = f"option_0{self.objectspace.suffix}" ] = f'option_0{self.objectspace.suffix}'
basefamily = Family( basefamily = Family(
baseelt, baseelt,
self, self,
@ -124,33 +121,33 @@ class TiramisuReflector:
elt, elt,
self, self,
) )
# else: # else:
# path_prefixes = self.objectspace.paths.get_path_prefixes() # path_prefixes = self.objectspace.paths.get_path_prefixes()
# for path_prefix in path_prefixes: # for path_prefix in path_prefixes:
# space = self.objectspace.space.variables[path_prefix] # space = self.objectspace.space.variables[path_prefix]
# self.set_name(space) # self.set_name(space)
# baseprefix = Family( # baseprefix = Family(
# space, # space,
# self, # self,
# ) # )
# basefamily.add(baseprefix) # basefamily.add(baseprefix)
# for elt in self.reorder_family(space): # for elt in self.reorder_family(space):
# self.populate_family( # self.populate_family(
# baseprefix, # baseprefix,
# elt, # elt,
# ) # )
# if not hasattr(baseprefix.elt, "information"): # if not hasattr(baseprefix.elt, "information"):
# baseprefix.elt.information = self.objectspace.information( # baseprefix.elt.information = self.objectspace.information(
# baseprefix.elt.xmlfiles # baseprefix.elt.xmlfiles
# ) # )
# for key, value in self.objectspace.paths.get_providers_path( # for key, value in self.objectspace.paths.get_providers_path(
# path_prefix # path_prefix
# ).items(): # ).items():
# setattr(baseprefix.elt.information, key, value) # setattr(baseprefix.elt.information, key, value)
# for key, value in self.objectspace.paths.get_suppliers_path( # for key, value in self.objectspace.paths.get_suppliers_path(
# path_prefix # path_prefix
# ).items(): # ).items():
# setattr(baseprefix.elt.information, key, value) # setattr(baseprefix.elt.information, key, value)
baseelt.name = normalize_family(self.objectspace.base_option_name) baseelt.name = normalize_family(self.objectspace.base_option_name)
baseelt.description = self.objectspace.base_option_name baseelt.description = self.objectspace.base_option_name
self.reflector_objects[baseelt.path].get( self.reflector_objects[baseelt.path].get(
@ -204,9 +201,7 @@ class Common:
self.populate_attrib() self.populate_attrib()
if self.informations: if self.informations:
for information in self.informations: for information in self.informations:
self.tiramisu.text["option"].append( self.tiramisu.text['option'].append(f'{information}.set_option({self.option_name})')
f"{information}.set_option({self.option_name})"
)
return self.option_name return self.option_name
def populate_attrib(self): def populate_attrib(self):
@ -280,7 +275,7 @@ class Common:
informations = self.objectspace.informations.get(self.elt.path) informations = self.objectspace.informations.get(self.elt.path)
if not informations: if not informations:
return return
keys["informations"] = informations keys['informations'] = informations
def populate_param( def populate_param(
self, self,
@ -304,20 +299,14 @@ class Common:
if param["variable"].path == self.elt.path: if param["variable"].path == self.elt.path:
return f'ParamSelfInformation("{param["information"]}", {default})' return f'ParamSelfInformation("{param["information"]}", {default})'
information_variable_path = param["variable"].path information_variable_path = param["variable"].path
information_variable = self.tiramisu.reflector_objects[ information_variable = self.tiramisu.reflector_objects[information_variable_path]
information_variable_path
]
if information_variable_path not in self.calls: if information_variable_path not in self.calls:
option_name = information_variable.get(self.calls, self.elt.path) option_name = information_variable.get(self.calls, self.elt.path)
return f'ParamInformation("{param["information"]}", {default}, option={option_name})' return f'ParamInformation("{param["information"]}", {default}, option={option_name})'
else: else:
information = ( information = f'ParamInformation("{param["information"]}", {default})'
f'ParamInformation("{param["information"]}", {default})'
)
information_name = self.tiramisu.get_information_name() information_name = self.tiramisu.get_information_name()
self.tiramisu.text["option"].append( self.tiramisu.text["option"].append(f'{information_name} = {information}')
f"{information_name} = {information}"
)
information_variable.informations.append(information_name) information_variable.informations.append(information_name)
return information_name return information_name
return f'ParamInformation("{param["information"]}", {default})' return f'ParamInformation("{param["information"]}", {default})'
@ -333,7 +322,6 @@ class Common:
param.get("propertyerror", True), param.get("propertyerror", True),
param.get("suffix"), param.get("suffix"),
param.get("dynamic"), param.get("dynamic"),
param.get('whole', False),
) )
if param["type"] == "any": if param["type"] == "any":
if isinstance(param["value"], str): if isinstance(param["value"], str):
@ -345,19 +333,15 @@ class Common:
def build_option_param( def build_option_param(
self, self,
variable, param,
propertyerror, propertyerror,
suffix: Optional[str], suffix: Optional[str],
dynamic, dynamic,
whole: bool,
) -> str: ) -> str:
"""build variable parameters""" """build variable parameters"""
if variable.path == self.elt.path: if param.path == self.elt.path:
return f"ParamSelfOption(whole={whole})" return "ParamSelfOption(whole=False)"
if whole: option_name = self.tiramisu.reflector_objects[param.path].get(
msg = f'variable param "{variable.path}" has whole attribute but it\'s not allowed for external variable'
raise DictConsistencyError(msg, 34, self.elt.xmlfiles)
option_name = self.tiramisu.reflector_objects[variable.path].get(
self.calls, self.elt.path self.calls, self.elt.path
) )
params = [f"{option_name}"] params = [f"{option_name}"]
@ -401,10 +385,9 @@ class Common:
ret = ret + ")" ret = ret + ")"
return ret return ret
def populate_calculation( def populate_calculation(self,
self,
datas: Union[Calculation, str, list], datas: Union[Calculation, str, list],
return_a_tuple: bool = False, return_a_tuple: bool=False,
) -> str: ) -> str:
if isinstance(datas, str): if isinstance(datas, str):
return self.convert_str(datas) return self.convert_str(datas)
@ -415,18 +398,15 @@ class Common:
params = [] params = []
for idx, data in enumerate(datas): for idx, data in enumerate(datas):
if isinstance(data, Calculation): if isinstance(data, Calculation):
try:
params.append(self.calculation_value(data)) params.append(self.calculation_value(data))
except VariableCalculationDependencyError:
pass
elif isinstance(data, str): elif isinstance(data, str):
params.append(self.convert_str(data)) params.append(self.convert_str(data))
else: else:
params.append(str(data)) params.append(str(data))
if return_a_tuple: if return_a_tuple:
ret = "(" ret = '('
else: else:
ret = "[" ret = '['
ret += ", ".join(params) ret += ", ".join(params)
if return_a_tuple: if return_a_tuple:
if len(params) <= 1: if len(params) <= 1:
@ -461,35 +441,18 @@ class Variable(Common):
) )
return return
if self.elt.type == "choice": if self.elt.type == "choice":
keys["values"] = self.populate_calculation( keys["values"] = self.populate_calculation(self.elt.choices, return_a_tuple=True)
self.elt.choices, return_a_tuple=True
)
if self.elt.type == 'regexp':
self.object_type = 'Regexp_' + self.option_name
self.tiramisu.text['header'].append(f'''class {self.object_type}(RegexpOption):
__slots__ = tuple()
_type = 'value'
{self.object_type}._regexp = re_compile(r"{self.elt.regexp}")
''')
if self.elt.path in self.objectspace.multis: if self.elt.path in self.objectspace.multis:
keys["multi"] = self.objectspace.multis[self.elt.path] keys["multi"] = self.objectspace.multis[self.elt.path]
if not hasattr(self.elt, "default"):
print('FIXME CA EXISTE!!!')
if hasattr(self.elt, "default") and self.elt.default is not None: if hasattr(self.elt, "default") and self.elt.default is not None:
try:
keys["default"] = self.populate_calculation(self.elt.default) keys["default"] = self.populate_calculation(self.elt.default)
except VariableCalculationDependencyError:
pass
if self.elt.path in self.objectspace.default_multi: if self.elt.path in self.objectspace.default_multi:
try: keys["default_multi"] = self.populate_calculation(self.objectspace.default_multi[self.elt.path])
keys["default_multi"] = self.populate_calculation(
self.objectspace.default_multi[self.elt.path]
)
except VariableCalculationDependencyError:
pass
if self.elt.validators: if self.elt.validators:
keys["validators"] = self.populate_calculation(self.elt.validators) keys["validators"] = self.populate_calculation(self.elt.validators)
for key, value in ( for key, value in CONVERT_OPTION.get(self.elt.type, {}).get("initkwargs", {}).items():
CONVERT_OPTION.get(self.elt.type, {}).get("initkwargs", {}).items()
):
if isinstance(value, str): if isinstance(value, str):
value = self.convert_str(value) value = self.convert_str(value)
keys[key] = value keys[key] = value

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -5,6 +5,7 @@ var2:
description: a second variable description: a second variable
multi: true multi: true
default: default:
type: jinja
jinja: | jinja: |
{{ _.var1 }} {{ _.var1 }}
description: the value of var1 description: the value of var1

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -8,6 +8,7 @@ var2:
description: a second variable description: a second variable
multi: true multi: true
default: default:
type: jinja
jinja: | jinja: |
{% for val in _.var1 %} {% for val in _.var1 %}
{{ val }} {{ val }}

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,13 +0,0 @@
---
version: 1.1
var1:
description: a first variable
multi: true
type: domainname
params:
allow_ip: true
var2:
description: a second variable
default:
type: variable
variable: _.var1

View file

@ -1,10 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": []
},
"rougail.var2": {
"owner": "default",
"value": []
}
}

View file

@ -1,4 +0,0 @@
{
"rougail.var1": [],
"rougail.var2": []
}

View file

@ -1,10 +0,0 @@
{
"rougail.var1": {
"owner": "default",
"value": []
},
"rougail.var2": {
"owner": "default",
"value": []
}
}

View file

@ -1 +0,0 @@
["rougail.var1", "rougail.var2"]

View file

@ -1,11 +0,0 @@
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
option_2 = DomainnameOption(name="var1", doc="a first variable", multi=True, type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory", "notempty"}), informations={'type': 'domainname'})
option_3 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_2)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'domainname'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3], properties=frozenset({"basic"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,16 +0,0 @@
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
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", "notempty"}), informations={'type': 'domainname'})
option_4 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'domainname'})
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", 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", "notempty"}), informations={'type': 'domainname'})
option_8 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_7)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'domainname'})
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", 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])

View file

@ -1,10 +0,0 @@
from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
option_1 = DomainnameOption(name="var1", doc="a first variable", multi=True, type="domainname", allow_ip=True, properties=frozenset({"basic", "mandatory", "notempty"}), informations={'type': 'domainname'})
option_2 = DomainnameOption(name="var2", doc="a second variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_1)))), type="domainname", allow_ip=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'domainname'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -4,6 +4,7 @@ var:
description: a variable description: a variable
default: 9 default: 9
choices: choices:
type: jinja
jinja: | jinja: |
{% for n in trange(0, 10) %} {% for n in trange(0, 10) %}
{{ n }} {{ n }}

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -8,4 +8,5 @@ var2:
description: a first variable description: a first variable
default: a default: a
choices: choices:
type: variable
variable: _.var1 variable: _.var1

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +0,0 @@
---
version: '1.1'
var:
description: a first variable
regexp: "^#(?:[0-9a-f]{3}){1,2}$"
default: "#a1a1a1"

View file

@ -1,6 +0,0 @@
{
"rougail.var": {
"owner": "default",
"value": "#a1a1a1"
}
}

View file

@ -1,3 +0,0 @@
{
"rougail.var": "#a1a1a1"
}

View file

@ -1,6 +0,0 @@
{
"rougail.var": {
"owner": "default",
"value": "#a1a1a1"
}
}

View file

@ -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('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
class Regexp_option_2(RegexpOption):
__slots__ = tuple()
_type = 'value'
Regexp_option_2._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
option_2 = Regexp_option_2(name="var", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp'})
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2], properties=frozenset({"standard"}))
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])

View file

@ -1,25 +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('tests/dictionaries/../eosfunc/test.py')
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'})
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", 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'})
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", 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])

View file

@ -1,15 +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('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic")
ALLOWED_LEADER_PROPERTIES.add("standard")
ALLOWED_LEADER_PROPERTIES.add("advanced")
class Regexp_option_1(RegexpOption):
__slots__ = tuple()
_type = 'value'
Regexp_option_1._regexp = re_compile(r"^#(?:[0-9a-f]{3}){1,2}$")
option_1 = Regexp_option_1(name="var", doc="a first variable", default="#a1a1a1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'regexp'})
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

View file

@ -1,6 +1,5 @@
from tiramisu import * from tiramisu import *
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
from re import compile as re_compile
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
load_functions('tests/dictionaries/../eosfunc/test.py') load_functions('tests/dictionaries/../eosfunc/test.py')
ALLOWED_LEADER_PROPERTIES.add("basic") ALLOWED_LEADER_PROPERTIES.add("basic")

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