robot.variables package
Implements storing and resolving variables.
This package is mainly for internal usage, but utilities for finding variables can be used externally as well.
Submodules
robot.variables.assigner module
- class robot.variables.assigner.NoReturnValueResolver[source]
Bases:
ReturnValueResolver
- class robot.variables.assigner.OneReturnValueResolver(assignment)[source]
Bases:
ReturnValueResolver
- class robot.variables.assigner.MultiReturnValueResolver(assignments)[source]
Bases:
ReturnValueResolver
- class robot.variables.assigner.ScalarsOnlyReturnValueResolver(assignments)[source]
Bases:
MultiReturnValueResolver
- class robot.variables.assigner.ScalarsAndListReturnValueResolver(assignments)[source]
Bases:
MultiReturnValueResolver
robot.variables.evaluation module
robot.variables.filesetter module
- class robot.variables.filesetter.VariableFileSetter(store: VariableStore)[source]
Bases:
object
robot.variables.finders module
- class robot.variables.finders.StoredFinder(store)[source]
Bases:
object- identifiers = '$@&'
- find(variable: VariableMatch)[source]
- class robot.variables.finders.NumberFinder[source]
Bases:
object- identifiers = '$'
- find(variable: VariableMatch)[source]
- class robot.variables.finders.EmptyFinder[source]
Bases:
object- identifiers = '$@&'
- empty = NormalizedDict({'${EMPTY}': '', '&{EMPTY}': {}, '@{EMPTY}': ()})
- find(variable: VariableMatch)[source]
- class robot.variables.finders.InlinePythonFinder(variables)[source]
Bases:
object- identifiers = '$@&'
- find(variable: VariableMatch)[source]
robot.variables.notfound module
- robot.variables.notfound.variable_not_found(name: str, candidates: Mapping[str, object], message: str | None = None, deco_braces: bool = True) NoReturn[source]
Raise VariableError for missing variable name.
Error message includes recommendations for similar variable names if any are found. Finding recommendations has a performance effect, so this function should only been called when such information is actually useful.
robot.variables.replacer module
- class robot.variables.replacer.VariableReplacer(variables)[source]
Bases:
object- replace_list(items, replace_until=None, ignore_errors=False)[source]
Replaces variables from a list of items.
If an item in a list is a @{list} variable its value is returned. Possible variables from other items are replaced using ‘replace_scalar’. Result is always a list.
‘replace_until’ can be used to limit replacing arguments to certain index from the beginning. Used with Run Keyword variants that only want to resolve some arguments in the beginning and pass others to called keywords unmodified.
robot.variables.resolvable module
- class robot.variables.resolvable.GlobalVariableValue(value)[source]
Bases:
Resolvable
robot.variables.scopes module
robot.variables.search module
- robot.variables.search.search_variable(string: str, identifiers: Sequence[str] = '$@&%*', parse_type: bool = False, ignore_errors: bool = False) VariableMatch[source]
- robot.variables.search.contains_variable(string: str, identifiers: Sequence[str] = '$@&') bool[source]
- robot.variables.search.is_assign(string: str, identifiers: Sequence[str] = '$@&', allow_assign_mark: bool = False, allow_nested: bool = False, allow_items: bool = False) bool[source]
- robot.variables.search.is_scalar_assign(string: str, allow_assign_mark: bool = False, allow_nested: bool = False, allow_items: bool = False) bool[source]
- robot.variables.search.is_list_assign(string: str, allow_assign_mark: bool = False, allow_nested: bool = False, allow_items: bool = False) bool[source]
- robot.variables.search.is_dict_assign(string: str, allow_assign_mark: bool = False, allow_nested: bool = False, allow_items: bool = False) bool[source]
- class robot.variables.search.VariableMatch(string: str, identifier: str | None = None, base: str | None = None, type: str | None = None, items: tuple[str, ...] = (), start: int = -1, end: int = -1)[source]
Bases:
object- property name: str | None
- property before: str
- property match: str | None
- property after: str
robot.variables.store module
robot.variables.tablesetter module
- class robot.variables.tablesetter.VariableTableSetter(store: VariableStore)[source]
Bases:
object
- class robot.variables.tablesetter.VariableResolver(value: Sequence[str], name: str | None = None, type: str | None = None, error_reporter: Callable[[str], None] | None = None)[source]
Bases:
Resolvable- classmethod from_name_and_value(name: str, value: str | Sequence[str], separator: str | None = None, error_reporter: Callable[[str], None] | None = None) VariableResolver[source]
- classmethod from_variable(var: Var | Variable) VariableResolver[source]
- class robot.variables.tablesetter.ScalarVariableResolver(value: str | Sequence[str], separator: str | None = None, name=None, type=None, error_reporter=None)[source]
Bases:
VariableResolver
- class robot.variables.tablesetter.ListVariableResolver(value: Sequence[str], name: str | None = None, type: str | None = None, error_reporter: Callable[[str], None] | None = None)[source]
Bases:
VariableResolver
- class robot.variables.tablesetter.DictVariableResolver(value: Sequence[str], name=None, type=None, error_reporter=None)[source]
Bases:
VariableResolver