Skip to content
Snippets Groups Projects
Commit 2b7035c4 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

ENH(scanner): variables are replaced in parameters of transformer functions

parent cb6403ad
Branches
Tags
2 merge requests!217TST: Make NamedTemporaryFiles Windows-compatible,!204Allow variable replacement in parameters of transformer functions
...@@ -575,10 +575,17 @@ class Converter(object, metaclass=ABCMeta): ...@@ -575,10 +575,17 @@ class Converter(object, metaclass=ABCMeta):
" one element with they key being the name" " one element with they key being the name"
" of the function!") " of the function!")
tr_func_key = list(tr_func_el.keys())[0] tr_func_key = list(tr_func_el.keys())[0]
tr_func_params = tr_func_el[tr_func_key]
# Create a copy of the function parameters:
tr_func_params = dict(tr_func_el[tr_func_key])
if tr_func_key not in transformer_functions: if tr_func_key not in transformer_functions:
raise RuntimeError("Unknown transformer function: {}".format(tr_func_key)) raise RuntimeError("Unknown transformer function: {}".format(tr_func_key))
# Do variable replacment on function parameters:
for key in tr_func_params:
tr_func_params[key] = replace_variables(tr_func_params[key])
# Retrieve the function from the dictionary: # Retrieve the function from the dictionary:
tr_func = transformer_functions[tr_func_key] tr_func = transformer_functions[tr_func_key]
# Call the function: # Call the function:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment