Equivalent of eHive's Param module.
More...
|
| def | __init__ (self, unsubstituted_params, debug=False) |
| | Constructor. More...
|
| |
| def | set_param (self, param_name, value) |
| | Setter. More...
|
| |
| def | get_param (self, param_name) |
| | Getter. More...
|
| |
| def | has_param (self, param_name) |
| | Returns a boolean. More...
|
| |
| def | validate_parameter_name (self, param_name) |
| | Tells whether "param_name" is a non-empty string. More...
|
| |
| def | debug_print (self, args, kwargs) |
| | Print debug information if the debug flag is turned on (cf constructor) More...
|
| |
| def | internal_get_param (self, param_name) |
| | Equivalent of get_param() that assumes "param_name" is a valid parameter name and hence, doesn't have to raise ParamNameException. More...
|
| |
| def | param_substitute (self, structure) |
| | Take any structure and replace the pairs of hashes with the values of the parameters / expression they represent Compatible types: numbers, strings, lists, dictionaries (otherwise, ParamSubstitutionException is raised) More...
|
| |
| def | subst_all_hashpairs (self, structure, callback) |
| | Parse "structure" and replace all the pairs of hashes by the result of calling callback() on the pair content #expr()expr# are treated differently by calling subst_one_hashpair() The result is a string (like structure) More...
|
| |
| def | subst_one_hashpair (self, inside_hashes, is_expr) |
| | Run the parameter substitution for a single pair of hashes. More...
|
| |
Equivalent of eHive's Param module.
Definition at line 44 of file Params.py.
◆ __init__()
| def eHive.Params.ParamContainer.__init__ |
( |
|
self, |
|
|
|
unsubstituted_params, |
|
|
|
debug = False |
|
) |
| |
Constructor.
"unsubstituted_params" is a dictionary
Definition at line 48 of file Params.py.
◆ debug_print()
| def eHive.Params.ParamContainer.debug_print |
( |
|
self, |
|
|
|
args, |
|
|
|
kwargs |
|
) |
| |
Print debug information if the debug flag is turned on (cf constructor)
Definition at line 94 of file Params.py.
◆ get_param()
| def eHive.Params.ParamContainer.get_param |
( |
|
self, |
|
|
|
param_name |
|
) |
| |
Getter.
Performs the parameter substitution
Definition at line 67 of file Params.py.
◆ has_param()
| def eHive.Params.ParamContainer.has_param |
( |
|
self, |
|
|
|
param_name |
|
) |
| |
Returns a boolean.
It checks both substituted and unsubstituted parameters
Definition at line 79 of file Params.py.
◆ internal_get_param()
| def eHive.Params.ParamContainer.internal_get_param |
( |
|
self, |
|
|
|
param_name |
|
) |
| |
◆ param_substitute()
| def eHive.Params.ParamContainer.param_substitute |
( |
|
self, |
|
|
|
structure |
|
) |
| |
Take any structure and replace the pairs of hashes with the values of the parameters / expression they represent Compatible types: numbers, strings, lists, dictionaries (otherwise, ParamSubstitutionException is raised)
Definition at line 114 of file Params.py.
◆ set_param()
| def eHive.Params.ParamContainer.set_param |
( |
|
self, |
|
|
|
param_name, |
|
|
|
value |
|
) |
| |
Setter.
Returns the new value
Definition at line 59 of file Params.py.
◆ subst_all_hashpairs()
| def eHive.Params.ParamContainer.subst_all_hashpairs |
( |
|
self, |
|
|
|
structure, |
|
|
|
callback |
|
) |
| |
Parse "structure" and replace all the pairs of hashes by the result of calling callback() on the pair content #expr()expr# are treated differently by calling subst_one_hashpair() The result is a string (like structure)
Definition at line 156 of file Params.py.
◆ subst_one_hashpair()
| def eHive.Params.ParamContainer.subst_one_hashpair |
( |
|
self, |
|
|
|
inside_hashes, |
|
|
|
is_expr |
|
) |
| |
Run the parameter substitution for a single pair of hashes.
Here, we only need to handle #expr()expr#, #func:params# and #param_name# as each condition has been parsed in the other methods
Definition at line 188 of file Params.py.
◆ validate_parameter_name()
| def eHive.Params.ParamContainer.validate_parameter_name |
( |
|
self, |
|
|
|
param_name |
|
) |
| |
Tells whether "param_name" is a non-empty string.
Definition at line 89 of file Params.py.
◆ debug
| eHive.Params.ParamContainer.debug |
◆ param_hash
| eHive.Params.ParamContainer.param_hash |
◆ substitution_in_progress
| eHive.Params.ParamContainer.substitution_in_progress |
◆ unsubstituted_param_hash
| eHive.Params.ParamContainer.unsubstituted_param_hash |
The documentation for this class was generated from the following file: