feat: be able to customize a new variable type #3
272 changed files with 551 additions and 443 deletions
|
@ -139,3 +139,54 @@ Let's execute `script.py`:
|
|||
{'rougail.my_variable': 'my_value', 'rougail.my_variable_jinja': 'no', 'example.my_variable_extra': 'my_value_extra'}
|
||||
|
||||
The value of the `my_variable_extra` variable is calculated, and it's value comes from the :func:`return_no` function.
|
||||
|
||||
|
||||
Create your own type
|
||||
----------------------
|
||||
|
||||
A variable has a type. This type enables the variable to define the values that are accepted by this variable.
|
||||
|
||||
There is a series of default types, but obviously not all cases are taken.
|
||||
|
||||
It's possible to create your own type.
|
||||
|
||||
Here an example to a lipogram option (in a string, we cannot use "e" character):
|
||||
|
||||
.. code-block:: python
|
||||
:caption: the `lipogram.py` file content
|
||||
|
||||
from tiramisu import StrOption
|
||||
class LipogramOption(StrOption):
|
||||
__slots__ = tuple()
|
||||
_type = 'lipogram'
|
||||
|
||||
def validate(self,
|
||||
value):
|
||||
super().validate(value)
|
||||
# verify that there is any 'e' in the sentense
|
||||
if 'e' in value:
|
||||
raise ValueError('Perec wrote a book without any "e", you could not do it in a simple sentence?')
|
||||
|
||||
To add the new lipogram type in Rougail:
|
||||
|
||||
.. code-block:: python
|
||||
>>> from rougail import Rougail, RougailConfig
|
||||
>>> RougailConfig['dictionaries_dir'] = ['dict']
|
||||
>>> RougailConfig['custom_types']['lipogram'] = LipogramOption
|
||||
|
||||
Now, we can use lipogram type.
|
||||
Here is a :file:`dict/00-base.yml` dictionary:
|
||||
|
||||
.. code-block:: yaml
|
||||
---
|
||||
version: '1.0'
|
||||
var:
|
||||
type: lipogram
|
||||
|
||||
.. code-block:: python
|
||||
>>> rougail = Rougail()
|
||||
>>> config = rougail.get_config()
|
||||
>>> config.option('rougail.var').value.set('blah')
|
||||
>>> config.option('rougail.var').value.set('I just want to add a quality string that has no bad characters')
|
||||
[...]
|
||||
tiramisu.error.ValueOptionError: "I just want to add a quality string that has no bad characters" is an invalid lipogram for "var", Perec wrote a book without any "e", you could not do it in a simple sentence?
|
||||
|
|
|
@ -28,10 +28,12 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
from tiramisu import Config
|
||||
from copy import copy
|
||||
|
||||
from .convert import RougailConvert
|
||||
from .config import RougailConfig
|
||||
from .update import RougailUpgrade
|
||||
from .object_model import CONVERT_OPTION
|
||||
|
||||
|
||||
def tiramisu_display_name(kls) -> str:
|
||||
|
@ -46,7 +48,7 @@ class Rougail:
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
rougailconfig = None,
|
||||
rougailconfig=None,
|
||||
) -> None:
|
||||
if rougailconfig is None:
|
||||
rougailconfig = RougailConfig
|
||||
|
@ -66,7 +68,8 @@ class Rougail:
|
|||
if not self.config:
|
||||
tiram_obj = self.converted.save(self.rougailconfig["tiramisu_cache"])
|
||||
optiondescription = {}
|
||||
exec(tiram_obj, None, optiondescription) # pylint: disable=W0122
|
||||
custom_types = {custom.__name__: custom for custom in self.rougailconfig["custom_types"].values()}
|
||||
exec(tiram_obj, custom_types, optiondescription) # pylint: disable=W0122
|
||||
self.config = Config(
|
||||
optiondescription["option_0"],
|
||||
display_name=tiramisu_display_name,
|
||||
|
@ -75,4 +78,4 @@ class Rougail:
|
|||
return self.config
|
||||
|
||||
|
||||
__ALL__ = ("Rougail", "RougailConvert", "RougailConfig", "RougailUpgrade")
|
||||
__ALL__ = ("Rougail", "RougailConfig", "RougailUpgrade")
|
||||
|
|
|
@ -27,27 +27,12 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
from .variable import CONVERT_OPTION
|
||||
import importlib.resources
|
||||
from os.path import isfile
|
||||
from ..utils import load_modules
|
||||
|
||||
|
||||
ANNOTATORS = None
|
||||
#
|
||||
#
|
||||
# if not 'files' in dir(importlib.resources):
|
||||
# # old python version
|
||||
# class fake_files:
|
||||
# def __init__(self, package):
|
||||
# self.mod = []
|
||||
# dir_package = dirname(importlib.resources._get_package(package).__file__)
|
||||
# for mod in importlib.resources.contents(package):
|
||||
# self.mod.append(join(dir_package, mod))
|
||||
#
|
||||
# def iterdir(self):
|
||||
# return self.mod
|
||||
# importlib.resources.files = fake_files
|
||||
|
||||
|
||||
def get_level(module):
|
||||
|
@ -101,4 +86,4 @@ class SpaceAnnotator: # pylint: disable=R0903
|
|||
annotator(objectspace)
|
||||
|
||||
|
||||
__all__ = ("SpaceAnnotator", "CONVERT_OPTION")
|
||||
__all__ = ("SpaceAnnotator",)
|
||||
|
|
|
@ -33,58 +33,6 @@ from rougail.error import DictConsistencyError
|
|||
from rougail.object_model import Calculation
|
||||
|
||||
|
||||
def convert_boolean(value: str) -> bool:
|
||||
"""Boolean coercion. The Rougail XML may contain srings like `True` or `False`"""
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
value = value.lower()
|
||||
if value == "true":
|
||||
return True
|
||||
elif value == "false":
|
||||
return False
|
||||
raise Exception(f"unknown boolean value {value}")
|
||||
|
||||
|
||||
CONVERT_OPTION = {
|
||||
"string": dict(opttype="StrOption"),
|
||||
"number": dict(opttype="IntOption", func=int),
|
||||
"float": dict(opttype="FloatOption", func=float),
|
||||
"boolean": dict(opttype="BoolOption", func=convert_boolean),
|
||||
"secret": dict(opttype="PasswordOption"),
|
||||
"mail": dict(opttype="EmailOption"),
|
||||
"unix_filename": dict(opttype="FilenameOption"),
|
||||
"date": dict(opttype="DateOption"),
|
||||
"unix_user": dict(opttype="UsernameOption"),
|
||||
"ip": dict(opttype="IPOption", initkwargs={"allow_reserved": True}),
|
||||
"cidr": dict(opttype="IPOption", initkwargs={"cidr": True}),
|
||||
"netmask": dict(opttype="NetmaskOption"),
|
||||
"network": dict(opttype="NetworkOption"),
|
||||
"network_cidr": dict(opttype="NetworkOption", initkwargs={"cidr": True}),
|
||||
"broadcast": dict(opttype="BroadcastOption"),
|
||||
"netbios": dict(
|
||||
opttype="DomainnameOption",
|
||||
initkwargs={"type": "netbios", "warnings_only": True},
|
||||
),
|
||||
"domainname": dict(
|
||||
opttype="DomainnameOption", initkwargs={"type": "domainname", "allow_ip": False}
|
||||
),
|
||||
"hostname": dict(
|
||||
opttype="DomainnameOption", initkwargs={"type": "hostname", "allow_ip": False}
|
||||
),
|
||||
"web_address": dict(
|
||||
opttype="URLOption", initkwargs={"allow_ip": False, "allow_without_dot": True}
|
||||
),
|
||||
"port": dict(opttype="PortOption", initkwargs={"allow_private": True}),
|
||||
"mac": dict(opttype="MACOption"),
|
||||
"unix_permissions": dict(
|
||||
opttype="PermissionsOption", initkwargs={"warnings_only": True}, func=int
|
||||
),
|
||||
"choice": dict(opttype="ChoiceOption"),
|
||||
#
|
||||
"symlink": dict(opttype="SymLinkOption"),
|
||||
}
|
||||
|
||||
|
||||
class Walk:
|
||||
"""Walk to objectspace to find variable or family"""
|
||||
|
||||
|
|
|
@ -77,4 +77,5 @@ RougailConfig = {
|
|||
"force_convert_dyn_option_description": False,
|
||||
"suffix": "",
|
||||
"tiramisu_cache": None,
|
||||
"custom_types": {},
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""Takes a bunch of Rougail XML dispatched in differents folders
|
||||
"""Takes a bunch of Rougail YAML dispatched in differents folders
|
||||
as an input and outputs a Tiramisu's file.
|
||||
|
||||
Created by:
|
||||
|
@ -27,25 +27,20 @@ GNU General Public License for more details.
|
|||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Sample usage::
|
||||
|
||||
>>> from rougail import RougailConvert
|
||||
>>> rougail = RougailConvert()
|
||||
>>> tiramisu = rougail.save('tiramisu.py')
|
||||
|
||||
The Rougail
|
||||
|
||||
- loads the XML into an internal RougailObjSpace representation
|
||||
- visits/annotates the objects
|
||||
- dumps the object space as Tiramisu string
|
||||
|
||||
The visit/annotation stage is a complex step that corresponds to the Rougail
|
||||
procedures.
|
||||
"""
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union, get_type_hints, Any, Literal, List, Dict, Iterator, Tuple
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
get_type_hints,
|
||||
Any,
|
||||
Literal,
|
||||
List,
|
||||
Dict,
|
||||
Iterator,
|
||||
Tuple,
|
||||
)
|
||||
from itertools import chain
|
||||
|
||||
from yaml import safe_load
|
||||
|
@ -56,13 +51,15 @@ from .annotator import SpaceAnnotator
|
|||
from .tiramisureflector import TiramisuReflector
|
||||
from .utils import get_realpath
|
||||
from .object_model import (
|
||||
CONVERT_OPTION,
|
||||
Family,
|
||||
Dynamic,
|
||||
Variable,
|
||||
_Variable,
|
||||
Choice,
|
||||
SymLink,
|
||||
CALCULATION_TYPES,
|
||||
Calculation,
|
||||
VariableCalculation,
|
||||
PARAM_TYPES,
|
||||
AnyParam,
|
||||
)
|
||||
|
@ -100,7 +97,7 @@ class Property:
|
|||
|
||||
class Paths:
|
||||
def __init__(self) -> None:
|
||||
self._data: Dict[str, Union[Variable, Family]] = {}
|
||||
self._data: Dict[str, Union[_Variable, Family]] = {}
|
||||
self._dynamics: List[str] = []
|
||||
self.path_prefix = None
|
||||
|
||||
|
@ -149,7 +146,7 @@ class Paths:
|
|||
def __getitem__(
|
||||
self,
|
||||
path: str,
|
||||
) -> Union[Family, Variable]:
|
||||
) -> Union[Family, _Variable]:
|
||||
if not path in self._data:
|
||||
raise AttributeError(f"cannot find variable or family {path}")
|
||||
return self._data[path]
|
||||
|
@ -217,7 +214,6 @@ class ParserVariable:
|
|||
#
|
||||
self.family = Family
|
||||
self.dynamic = Dynamic
|
||||
self.variable = Variable
|
||||
self.choice = Choice
|
||||
#
|
||||
self.exclude_imports = []
|
||||
|
@ -229,13 +225,23 @@ class ParserVariable:
|
|||
self.is_init = False
|
||||
super().__init__()
|
||||
|
||||
def get_variable(self):
|
||||
convert_options = list(CONVERT_OPTION)
|
||||
convert_options.extend(self.rougailconfig["custom_types"])
|
||||
|
||||
class Variable(_Variable):
|
||||
type: Literal[*convert_options] = convert_options[0]
|
||||
|
||||
return Variable
|
||||
|
||||
def init(self):
|
||||
if self.is_init:
|
||||
return
|
||||
self.variable = self.get_variable()
|
||||
hint = get_type_hints(self.dynamic)
|
||||
self.family_types = hint["type"].__args__ # pylint: disable=W0201
|
||||
self.family_attrs = frozenset( # pylint: disable=W0201
|
||||
set(hint) | {"redefine"} - {"name", "path", "xmlfiles"}
|
||||
set(hint) - {"name", "path", "xmlfiles"} | {"redefine"}
|
||||
)
|
||||
self.family_calculations = self.search_calculation( # pylint: disable=W0201
|
||||
hint
|
||||
|
@ -246,7 +252,7 @@ class ParserVariable:
|
|||
#
|
||||
hint = get_type_hints(self.choice)
|
||||
self.choice_attrs = frozenset( # pylint: disable=W0201
|
||||
set(hint) | {"redefine", "exists"} - {"name", "path", "xmlfiles"}
|
||||
set(hint) - {"name", "path", "xmlfiles"} | {"redefine", "exists"}
|
||||
)
|
||||
self.choice_calculations = self.search_calculation( # pylint: disable=W0201
|
||||
hint
|
||||
|
@ -290,7 +296,7 @@ class ParserVariable:
|
|||
if isinstance(value, dict) and not self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
"variable",
|
||||
self.choice_calculations,
|
||||
False,
|
||||
):
|
||||
break
|
||||
|
@ -356,8 +362,7 @@ class ParserVariable:
|
|||
family_is_leadership: bool = False,
|
||||
family_is_dynamic: bool = False,
|
||||
) -> None:
|
||||
""" Parse a family
|
||||
"""
|
||||
"""Parse a family"""
|
||||
if obj is None:
|
||||
return
|
||||
family_obj = {}
|
||||
|
@ -371,10 +376,11 @@ class ParserVariable:
|
|||
else:
|
||||
subfamily_obj[key] = value
|
||||
if path in self.paths:
|
||||
# it's just for modify subfamily or subvariable, do not redefine
|
||||
if family_obj:
|
||||
if not obj.pop("redefine", False):
|
||||
raise Exception(
|
||||
"The family {path} already exists and she is not redefined"
|
||||
f"The family {path} already exists and she is not redefined in {filemane}"
|
||||
)
|
||||
self.paths.add(
|
||||
path,
|
||||
|
@ -429,8 +435,7 @@ class ParserVariable:
|
|||
self,
|
||||
obj: Dict[str, Any],
|
||||
) -> Iterator[str]:
|
||||
""" List attributes
|
||||
"""
|
||||
"""List attributes"""
|
||||
force_to_variable = []
|
||||
for key, value in obj.items():
|
||||
if key in force_to_variable:
|
||||
|
@ -446,7 +451,7 @@ class ParserVariable:
|
|||
if isinstance(value, dict) and not self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
"family",
|
||||
self.family_calculations,
|
||||
False,
|
||||
):
|
||||
# it's a dict, so a new variables!
|
||||
|
@ -462,8 +467,7 @@ class ParserVariable:
|
|||
filenames: Union[str, List[str]],
|
||||
family_is_dynamic: bool,
|
||||
) -> None:
|
||||
""" Add a new family
|
||||
"""
|
||||
"""Add a new family"""
|
||||
family["path"] = path
|
||||
if not isinstance(filenames, list):
|
||||
filenames = [filenames]
|
||||
|
@ -483,7 +487,7 @@ class ParserVariable:
|
|||
if not self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
"family",
|
||||
self.family_calculations,
|
||||
False,
|
||||
):
|
||||
continue
|
||||
|
@ -528,8 +532,7 @@ class ParserVariable:
|
|||
family_is_leadership: bool = False,
|
||||
family_is_dynamic: bool = False,
|
||||
) -> None:
|
||||
""" Parse variable
|
||||
"""
|
||||
"""Parse variable"""
|
||||
if obj is None:
|
||||
obj = {}
|
||||
extra_attrs = set(obj) - self.choice_attrs
|
||||
|
@ -545,7 +548,9 @@ class ParserVariable:
|
|||
return
|
||||
if not obj.pop("redefine", False):
|
||||
raise Exception(f'Variable "{path}" already exists')
|
||||
self.paths.add(path, self.paths[path].model_copy(update=obj), False, force=True)
|
||||
self.paths.add(
|
||||
path, self.paths[path].model_copy(update=obj), False, force=True
|
||||
)
|
||||
self.paths[path].xmlfiles.append(filename)
|
||||
else:
|
||||
if "exists" in obj and obj.pop("exists"):
|
||||
|
@ -576,7 +581,7 @@ class ParserVariable:
|
|||
if self.is_calculation(
|
||||
key,
|
||||
value,
|
||||
"variable",
|
||||
self.choice_calculations,
|
||||
False,
|
||||
):
|
||||
try:
|
||||
|
@ -597,7 +602,7 @@ class ParserVariable:
|
|||
if not self.is_calculation(
|
||||
key,
|
||||
val,
|
||||
"variable",
|
||||
self.choice_calculations,
|
||||
True,
|
||||
):
|
||||
continue
|
||||
|
@ -617,8 +622,7 @@ class ParserVariable:
|
|||
) from err
|
||||
|
||||
def parse_params(self, path, obj):
|
||||
""" Parse variable params
|
||||
"""
|
||||
"""Parse variable params"""
|
||||
if "params" not in obj:
|
||||
return
|
||||
if not isinstance(obj["params"], dict):
|
||||
|
@ -628,7 +632,9 @@ class ParserVariable:
|
|||
try:
|
||||
params.append(AnyParam(key=key, value=val, type="any"))
|
||||
except ValidationError as err:
|
||||
raise Exception(f'"{key}" has an invalid "params" for {path}: {err}') from err
|
||||
raise Exception(
|
||||
f'"{key}" has an invalid "params" for {path}: {err}'
|
||||
) from err
|
||||
obj["params"] = params
|
||||
|
||||
def add_variable(
|
||||
|
@ -681,7 +687,7 @@ class ParserVariable:
|
|||
###############################################################################################
|
||||
def set_name(
|
||||
self,
|
||||
obj: Union[Variable, Family],
|
||||
obj: Union[_Variable, Family],
|
||||
option_prefix: str,
|
||||
):
|
||||
"""Set Tiramisu object name"""
|
||||
|
@ -697,14 +703,10 @@ class ParserVariable:
|
|||
self,
|
||||
attribute: str,
|
||||
value: dict,
|
||||
typ: Literal["variable", "family"],
|
||||
calculations: list,
|
||||
inside_list: bool,
|
||||
):
|
||||
"""Check if it's a calculation"""
|
||||
if typ == "variable":
|
||||
calculations = self.choice_calculations
|
||||
else:
|
||||
calculations = self.family_calculations
|
||||
if inside_list:
|
||||
calculations = calculations[0]
|
||||
else:
|
||||
|
@ -786,7 +788,9 @@ class RougailConvert(ParserVariable):
|
|||
inside_list = []
|
||||
outside_list = []
|
||||
for key, value in hint.items():
|
||||
if "Union" in value.__class__.__name__ and Calculation in value.__args__:
|
||||
if "Union" in value.__class__.__name__ and (
|
||||
Calculation in value.__args__ or VariableCalculation in value.__args__
|
||||
):
|
||||
outside_list.append(key)
|
||||
if (
|
||||
"Union" in value.__class__.__name__
|
||||
|
@ -914,7 +918,9 @@ class RougailConvert(ParserVariable):
|
|||
f"pffff version ... {version} not in {self.supported_version}"
|
||||
)
|
||||
|
||||
def annotate(self):
|
||||
def annotate(
|
||||
self,
|
||||
):
|
||||
"""Apply annotation"""
|
||||
if not self.paths.has_value():
|
||||
self.parse_directories()
|
||||
|
@ -940,7 +946,7 @@ class RougailConvert(ParserVariable):
|
|||
|
||||
def save(
|
||||
self,
|
||||
filename: None,
|
||||
filename: str,
|
||||
):
|
||||
"""Return tiramisu object declaration as a string"""
|
||||
self.annotate()
|
||||
|
|
|
@ -21,16 +21,77 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
"""
|
||||
|
||||
from typing import Optional, Union, get_type_hints, Any, Literal, List, Dict, Iterator
|
||||
from pydantic import BaseModel, StrictBool, StrictInt, StrictFloat, StrictStr
|
||||
from pydantic import (
|
||||
BaseModel,
|
||||
StrictBool,
|
||||
StrictInt,
|
||||
StrictFloat,
|
||||
StrictStr,
|
||||
ConfigDict,
|
||||
)
|
||||
from .utils import get_jinja_variable_to_param, get_realpath
|
||||
|
||||
|
||||
BASETYPE = Union[StrictBool, StrictInt, StrictFloat, StrictStr, None]
|
||||
|
||||
|
||||
def convert_boolean(value: str) -> bool:
|
||||
"""Boolean coercion. The Rougail XML may contain srings like `True` or `False`"""
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
value = value.lower()
|
||||
if value == "true":
|
||||
return True
|
||||
elif value == "false":
|
||||
return False
|
||||
raise Exception(f"unknown boolean value {value}")
|
||||
|
||||
|
||||
CONVERT_OPTION = {
|
||||
"string": dict(opttype="StrOption"),
|
||||
"number": dict(opttype="IntOption", func=int),
|
||||
"float": dict(opttype="FloatOption", func=float),
|
||||
"boolean": dict(opttype="BoolOption", func=convert_boolean),
|
||||
"secret": dict(opttype="PasswordOption"),
|
||||
"mail": dict(opttype="EmailOption"),
|
||||
"unix_filename": dict(opttype="FilenameOption"),
|
||||
"date": dict(opttype="DateOption"),
|
||||
"unix_user": dict(opttype="UsernameOption"),
|
||||
"ip": dict(opttype="IPOption", initkwargs={"allow_reserved": True}),
|
||||
"cidr": dict(opttype="IPOption", initkwargs={"cidr": True}),
|
||||
"netmask": dict(opttype="NetmaskOption"),
|
||||
"network": dict(opttype="NetworkOption"),
|
||||
"network_cidr": dict(opttype="NetworkOption", initkwargs={"cidr": True}),
|
||||
"broadcast": dict(opttype="BroadcastOption"),
|
||||
"netbios": dict(
|
||||
opttype="DomainnameOption",
|
||||
initkwargs={"type": "netbios", "warnings_only": True},
|
||||
),
|
||||
"domainname": dict(
|
||||
opttype="DomainnameOption", initkwargs={"type": "domainname", "allow_ip": False}
|
||||
),
|
||||
"hostname": dict(
|
||||
opttype="DomainnameOption", initkwargs={"type": "hostname", "allow_ip": False}
|
||||
),
|
||||
"web_address": dict(
|
||||
opttype="URLOption", initkwargs={"allow_ip": False, "allow_without_dot": True}
|
||||
),
|
||||
"port": dict(opttype="PortOption", initkwargs={"allow_private": True}),
|
||||
"mac": dict(opttype="MACOption"),
|
||||
"unix_permissions": dict(
|
||||
opttype="PermissionsOption", initkwargs={"warnings_only": True}, func=int
|
||||
),
|
||||
"choice": dict(opttype="ChoiceOption"),
|
||||
#
|
||||
"symlink": dict(opttype="SymLinkOption"),
|
||||
}
|
||||
|
||||
|
||||
class Param(BaseModel):
|
||||
key: str
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
|
||||
class AnyParam(Param):
|
||||
type: str
|
||||
|
@ -70,6 +131,9 @@ PARAM_TYPES = {
|
|||
class Calculation(BaseModel):
|
||||
path_prefix: Optional[str]
|
||||
path: str
|
||||
inside_list: bool
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
def get_realpath(
|
||||
self,
|
||||
|
@ -114,7 +178,6 @@ class JinjaCalculation(Calculation):
|
|||
jinja: StrictStr
|
||||
params: Optional[List[Param]] = None
|
||||
return_type: BASETYPE = None
|
||||
inside_list: bool
|
||||
|
||||
def _jinja_to_function(
|
||||
self,
|
||||
|
@ -154,7 +217,7 @@ class JinjaCalculation(Calculation):
|
|||
objectspace.functions,
|
||||
self.path_prefix,
|
||||
):
|
||||
if isinstance(sub_variable, objectspace.variable):
|
||||
if sub_variable.path in objectspace.variables:
|
||||
default["params"][true_path] = {
|
||||
"type": "variable",
|
||||
"variable": sub_variable,
|
||||
|
@ -223,7 +286,6 @@ class VariableCalculation(Calculation):
|
|||
]
|
||||
variable: StrictStr
|
||||
propertyerror: bool = True
|
||||
inside_list: bool
|
||||
|
||||
def to_function(
|
||||
self,
|
||||
|
@ -251,10 +313,6 @@ class VariableCalculation(Calculation):
|
|||
if variable.type != "boolean":
|
||||
raise Exception("only boolean!")
|
||||
params[None].insert(0, self.attribute_name)
|
||||
elif (
|
||||
self.attribute_name != "default" and variable.path not in objectspace.multis
|
||||
):
|
||||
raise Exception("pffff")
|
||||
if not self.inside_list and self.path in objectspace.multis:
|
||||
if (
|
||||
not objectspace.paths.is_dynamic(variable_path)
|
||||
|
@ -277,7 +335,6 @@ class InformationCalculation(Calculation):
|
|||
attribute_name: Literal["default"]
|
||||
information: StrictStr
|
||||
variable: Optional[StrictStr]
|
||||
inside_list: bool
|
||||
|
||||
def to_function(
|
||||
self,
|
||||
|
@ -346,43 +403,15 @@ class Family(BaseModel):
|
|||
xmlfiles: List[str] = []
|
||||
path: str
|
||||
|
||||
class ConfigDict:
|
||||
arbitrary_types_allowed = True
|
||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||
|
||||
|
||||
class Dynamic(Family):
|
||||
variable: str
|
||||
|
||||
|
||||
class Variable(BaseModel):
|
||||
class _Variable(BaseModel):
|
||||
name: str
|
||||
type: Literal[
|
||||
"number",
|
||||
"float",
|
||||
"string",
|
||||
"password",
|
||||
"secret",
|
||||
"mail",
|
||||
"boolean",
|
||||
"unix_filename",
|
||||
"date",
|
||||
"unix_user",
|
||||
"ip",
|
||||
"local_ip",
|
||||
"netmask",
|
||||
"network",
|
||||
"broadcast",
|
||||
"netbios",
|
||||
"domainname",
|
||||
"hostname",
|
||||
"web_address",
|
||||
"port",
|
||||
"mac",
|
||||
"cidr",
|
||||
"network_cidr",
|
||||
"choice",
|
||||
"unix_permissions",
|
||||
] = "string"
|
||||
description: Optional[str] = None
|
||||
default: Union[List[BASETYPE_CALC], BASETYPE_CALC] = None
|
||||
params: Optional[List[Param]] = None
|
||||
|
@ -399,17 +428,19 @@ class Variable(BaseModel):
|
|||
xmlfiles: List[str] = []
|
||||
path: str
|
||||
|
||||
class ConfigDict:
|
||||
arbitrary_types_allowed = True
|
||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||
|
||||
|
||||
class Choice(Variable):
|
||||
class Choice(_Variable):
|
||||
type: Literal["choice"] = "choice"
|
||||
choices: Union[List[BASETYPE_CALC], Calculation]
|
||||
|
||||
|
||||
class SymLink(BaseModel):
|
||||
name: str
|
||||
type: str = "symlink"
|
||||
opt: Variable
|
||||
type: Literal["symlink"] = "symlink"
|
||||
opt: _Variable
|
||||
xmlfiles: List[str] = []
|
||||
path: str
|
||||
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
|
|
@ -33,10 +33,9 @@ from json import dumps
|
|||
from os.path import isfile, basename
|
||||
|
||||
from .i18n import _
|
||||
from .annotator import CONVERT_OPTION
|
||||
from .error import DictConsistencyError
|
||||
from .utils import normalize_family
|
||||
from .object_model import Calculation
|
||||
from .object_model import Calculation, CONVERT_OPTION
|
||||
|
||||
|
||||
class BaseElt: # pylint: disable=R0903
|
||||
|
@ -122,7 +121,7 @@ class TiramisuReflector:
|
|||
[
|
||||
"from jinja2 import StrictUndefined, DictLoader",
|
||||
"from jinja2.sandbox import SandboxedEnvironment",
|
||||
"from rougail.annotator.variable import CONVERT_OPTION",
|
||||
"from rougail import CONVERT_OPTION",
|
||||
"from tiramisu.error import ValueWarning",
|
||||
"def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):",
|
||||
" global ENV, CONVERT_OPTION",
|
||||
|
@ -469,6 +468,9 @@ class Variable(Common):
|
|||
tiramisu,
|
||||
):
|
||||
super().__init__(elt, tiramisu)
|
||||
if elt.type in self.tiramisu.objectspace.rougailconfig['custom_types']:
|
||||
self.object_type = self.tiramisu.objectspace.rougailconfig['custom_types'][elt.type].__name__
|
||||
else:
|
||||
self.object_type = CONVERT_OPTION[elt.type]["opttype"]
|
||||
|
||||
def _populate_attrib(
|
||||
|
@ -528,7 +530,7 @@ class Variable(Common):
|
|||
else:
|
||||
validators.append(val)
|
||||
keys["validators"] = "[" + ", ".join(validators) + "]"
|
||||
for key, value in CONVERT_OPTION[self.elt.type].get("initkwargs", {}).items():
|
||||
for key, value in CONVERT_OPTION.get(self.elt.type, {}).get("initkwargs", {}).items():
|
||||
if isinstance(value, str):
|
||||
value = f"'{value}'"
|
||||
keys[key] = value
|
||||
|
|
|
@ -42,7 +42,7 @@ from .error import UpgradeError
|
|||
|
||||
from .utils import normalize_family
|
||||
from .config import RougailConfig
|
||||
from .annotator.variable import CONVERT_OPTION
|
||||
from .object_model import CONVERT_OPTION
|
||||
|
||||
|
||||
VERSIONS = ["0.10", "1.0"]
|
||||
|
|
7
tests/custom.py
Normal file
7
tests/custom.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
from os import environ
|
||||
environ['TIRAMISU_LOCALE'] = 'en'
|
||||
from tiramisu import StrOption
|
||||
|
||||
|
||||
class CustomOption(StrOption):
|
||||
pass
|
0
tests/dictionaries/01base_custom/__init__.py
Normal file
0
tests/dictionaries/01base_custom/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
version: '1.0'
|
||||
custom:
|
||||
type: custom
|
6
tests/dictionaries/01base_custom/makedict/after.json
Normal file
6
tests/dictionaries/01base_custom/makedict/after.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.custom": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
}
|
||||
}
|
3
tests/dictionaries/01base_custom/makedict/base.json
Normal file
3
tests/dictionaries/01base_custom/makedict/base.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"rougail.custom": null
|
||||
}
|
6
tests/dictionaries/01base_custom/makedict/before.json
Normal file
6
tests/dictionaries/01base_custom/makedict/before.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"rougail.custom": {
|
||||
"owner": "default",
|
||||
"value": null
|
||||
}
|
||||
}
|
24
tests/dictionaries/01base_custom/tiramisu/base.py
Normal file
24
tests/dictionaries/01base_custom/tiramisu/base.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_2 = CustomOption(name="custom", doc="custom", properties=frozenset({"basic", "mandatory"}))
|
||||
optiondescription_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
28
tests/dictionaries/01base_custom/tiramisu/multi.py
Normal file
28
tests/dictionaries/01base_custom/tiramisu/multi.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
from tiramisu import *
|
||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||
from importlib.machinery import SourceFileLoader as _SourceFileLoader
|
||||
from importlib.util import spec_from_loader as _spec_from_loader, module_from_spec as _module_from_spec
|
||||
global func
|
||||
func = {'calc_value': calc_value}
|
||||
|
||||
def _load_functions(path):
|
||||
global _SourceFileLoader, _spec_from_loader, _module_from_spec, func
|
||||
loader = _SourceFileLoader('func', path)
|
||||
spec = _spec_from_loader(loader.name, loader)
|
||||
func_ = _module_from_spec(spec)
|
||||
loader.exec_module(func_)
|
||||
for function in dir(func_):
|
||||
if function.startswith('_'):
|
||||
continue
|
||||
func[function] = getattr(func_, function)
|
||||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
option_3 = CustomOption(name="custom", doc="custom", properties=frozenset({"basic", "mandatory"}))
|
||||
optiondescription_2 = OptionDescription(name="rougail", doc="rougail", children=[option_3], properties=frozenset({"basic"}))
|
||||
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"basic"}))
|
||||
option_6 = CustomOption(name="custom", doc="custom", properties=frozenset({"basic", "mandatory"}))
|
||||
optiondescription_5 = OptionDescription(name="rougail", doc="rougail", children=[option_6], properties=frozenset({"basic"}))
|
||||
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"basic"}))
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
|
@ -21,7 +21,7 @@ def _load_functions(path):
|
|||
_load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||
from jinja2 import StrictUndefined, DictLoader
|
||||
from jinja2.sandbox import SandboxedEnvironment
|
||||
from rougail.annotator.variable import CONVERT_OPTION
|
||||
from rougail import CONVERT_OPTION
|
||||
from tiramisu.error import ValueWarning
|
||||
def jinja_to_function(__internal_jinja, __internal_type, __internal_multi, **kwargs):
|
||||
global ENV, CONVERT_OPTION
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue