The variables module (varmod)¶
The varmod is a centralized service that allow all the modules to share variables for collecting statistics or sharing global informations.
It allows to store a value associated with a name (a variable), to get it back. It also allows to make some basic operations on the variables :
- intopvar provides any integer operations on variables. The operator can be + - x or / providing the corresponding arithmetic operation.
- stropvar provides string operations. The operator can be only ‘c’ at that time corresponding to the concatenation operation.
API¶
-
cmd_varmod.
delns_varmod
(varmod_id, ns='default')[source]¶ Delete a variables workspace and all its content
-
cmd_varmod.
setvar_varmod
(varmod_id, ns, param_name, param_value)[source]¶ Set value on variable param_name
-
cmd_varmod.
intopvar_varmod
(varmod_id, ns, param_name, op, operand)[source]¶ Do integer operation op with operand on variable param_name. op can be ‘+’, ‘-‘, ‘x’ or ‘/’
-
cmd_varmod.
flopvar_varmod
(varmod_id, ns, param_name, op, operand)[source]¶ Do floating point operation op with operand on variable param_name. op can be ‘+’, ‘-‘, ‘x’ or ‘/’
-
cmd_varmod.
stropvar_varmod
(varmod_id, ns, param_name, op, operand)[source]¶ Do string operation op with operand on variable param_name. op can only be ‘c’ for concatenation
-
cmd_varmod.
get_token_varmod
(varmod_id, ns, token_name)[source]¶ gives a token to the client if the token is free
-
cmd_varmod.
release_token_varmod
(varmod_id, ns, token_name)[source]¶ gives a token to the client if the token is free