Robot Framework
robot.variables.replacer.VariableReplacer Class Reference

Public Member Functions

def __init__ (self, variable_store)
 
def replace_list (self, items, replace_until=None, ignore_errors=False)
 Replaces variables from a list of items. More...
 
def replace_scalar (self, item, ignore_errors=False)
 Replaces variables from a scalar item. More...
 
def replace_string (self, item, custom_unescaper=None, ignore_errors=False)
 Replaces variables from a string. More...
 

Private Member Functions

def _get_dict_variable_item (self, name, variable, key)
 
def _get_sequence_variable_item (self, name, variable, index)
 
def _get_variable_item (self, match, value)
 
def _get_variable_value (self, match, ignore_errors)
 
def _parse_sequence_variable_index (self, index)
 
def _replace_list (self, items, ignore_errors)
 
def _replace_list_item (self, item, ignore_errors)
 
def _replace_list_until (self, items, replace_until, ignore_errors)
 
def _replace_scalar (self, match, ignore_errors=False)
 
def _replace_string (self, match, unescaper, ignore_errors)
 
def _search_variable (self, item, ignore_errors)
 
def _validate_value (self, match, value)
 

Private Attributes

 _finder
 

Detailed Description

Definition at line 25 of file replacer.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.variables.replacer.VariableReplacer.__init__ (   self,
  variable_store 
)

Definition at line 27 of file replacer.py.

Member Function Documentation

◆ _get_dict_variable_item()

def robot.variables.replacer.VariableReplacer._get_dict_variable_item (   self,
  name,
  variable,
  key 
)
private

Definition at line 191 of file replacer.py.

◆ _get_sequence_variable_item()

def robot.variables.replacer.VariableReplacer._get_sequence_variable_item (   self,
  name,
  variable,
  index 
)
private

Definition at line 158 of file replacer.py.

◆ _get_variable_item()

def robot.variables.replacer.VariableReplacer._get_variable_item (   self,
  match,
  value 
)
private

Definition at line 141 of file replacer.py.

◆ _get_variable_value()

def robot.variables.replacer.VariableReplacer._get_variable_value (   self,
  match,
  ignore_errors 
)
private

Definition at line 117 of file replacer.py.

◆ _parse_sequence_variable_index()

def robot.variables.replacer.VariableReplacer._parse_sequence_variable_index (   self,
  index 
)
private

Definition at line 180 of file replacer.py.

◆ _replace_list()

def robot.variables.replacer.VariableReplacer._replace_list (   self,
  items,
  ignore_errors 
)
private

Definition at line 59 of file replacer.py.

◆ _replace_list_item()

def robot.variables.replacer.VariableReplacer._replace_list_item (   self,
  item,
  ignore_errors 
)
private

Definition at line 64 of file replacer.py.

◆ _replace_list_until()

def robot.variables.replacer.VariableReplacer._replace_list_until (   self,
  items,
  replace_until,
  ignore_errors 
)
private

Definition at line 47 of file replacer.py.

◆ _replace_scalar()

def robot.variables.replacer.VariableReplacer._replace_scalar (   self,
  match,
  ignore_errors = False 
)
private

Definition at line 90 of file replacer.py.

◆ _replace_string()

def robot.variables.replacer.VariableReplacer._replace_string (   self,
  match,
  unescaper,
  ignore_errors 
)
private

Definition at line 106 of file replacer.py.

◆ _search_variable()

def robot.variables.replacer.VariableReplacer._search_variable (   self,
  item,
  ignore_errors 
)
private

Definition at line 85 of file replacer.py.

◆ _validate_value()

def robot.variables.replacer.VariableReplacer._validate_value (   self,
  match,
  value 
)
private

Definition at line 202 of file replacer.py.

◆ replace_list()

def robot.variables.replacer.VariableReplacer.replace_list (   self,
  items,
  replace_until = None,
  ignore_errors = False 
)

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 of the arguments in the beginning and pass others
    to called keywords unmodified.

Definition at line 41 of file replacer.py.

◆ replace_scalar()

def robot.variables.replacer.VariableReplacer.replace_scalar (   self,
  item,
  ignore_errors = False 
)

Replaces variables from a scalar item.

    If the item is not a string it is returned as is. If it is a variable,
    its value is returned. Otherwise possible variables are replaced with
    'replace_string'. Result may be any object.

Definition at line 79 of file replacer.py.

◆ replace_string()

def robot.variables.replacer.VariableReplacer.replace_string (   self,
  item,
  custom_unescaper = None,
  ignore_errors = False 
)

Replaces variables from a string.

Result is always a string.

    Input can also be an already found VariableMatch.

Definition at line 99 of file replacer.py.

Member Data Documentation

◆ _finder

robot.variables.replacer.VariableReplacer._finder
private

Definition at line 28 of file replacer.py.


The documentation for this class was generated from the following file: