Esempio n. 1
0
 def _verity_values_for_set_variable_if(self,values,default=False):
     if not values:
         if default:
             return [None]
         raise RuntimeError('At least one value is required')
     if is_list_var(values[0]):
         values[:1] =[utils.escape(item) for item in
                      self._variables[values[0]]]
         return self._verity_values_for_set_variable_if(values)
     return values
 def _replace_list_until(self, items, replace_until, ignore_errors):
     # @{list} variables can contain more or less arguments than needed.
     # Therefore we need to go through items one by one, and escape possible
     # extra items we got.
     replaced = []
     while len(replaced) < replace_until and items:
         replaced.extend(self._replace_list([items.pop(0)], ignore_errors))
     if len(replaced) > replace_until:
         replaced[replace_until:] = [escape(item) for item in replaced[replace_until:]]
     return replaced + items
Esempio n. 3
0
 def _replace_list_until(self, items, replace_until, ignore_errors):
     # @{list} variables can contain more or less arguments than needed.
     # Therefore we need to go through items one by one, and escape possible
     # extra items we got.
     replaced = []
     while len(replaced) < replace_until and items:
         replaced.extend(self._replace_list([items.pop(0)], ignore_errors))
     if len(replaced) > replace_until:
         replaced[replace_until:] = [escape(item)
                                     for item in replaced[replace_until:]]
     return replaced + items
 def replace_from_beginning(self, how_many, args):
     # There might be @{list} variables and those might have more or less
     # arguments that is needed. Therefore we need to go through arguments
     # one by one.
     processed = []
     while len(processed) < how_many and args:
         processed += self.current.replace_list([args.pop(0)])
     # In case @{list} variable is unpacked, the arguments going further
     # needs to be escaped, otherwise those are unescaped twice.
     processed[how_many:] = [utils.escape(arg) for arg in processed[how_many:]]
     return processed + args
Esempio n. 5
0
 def replace_from_beginning(self, how_many, args):
     # There might be @{list} variables and those might have more or less
     # arguments that is needed. Therefore we need to go through arguments
     # one by one.
     processed = []
     while len(processed) < how_many and args:
         processed += self.current.replace_list([args.pop(0)])
     # In case @{list} variable is unpacked, the arguments going further
     # needs to be escaped, otherwise those are unescaped twice.
     processed[how_many:] = [
         utils.escape(arg) for arg in processed[how_many:]
     ]
     return processed + args
Esempio n. 6
0
 def _escape_as_data(self, value):
     return utils.escape(value)
Esempio n. 7
0
 def _escape(self, value):
     return utils.escape(value)
Esempio n. 8
0
 def _escape_doc(self, value):
     return escape(value)
Esempio n. 9
0
 def _escape_as_data(self, value):
     return escape(value)
Esempio n. 10
0
 def _escape_as_data(self, value):
     return utils.escape(value)
Esempio n. 11
0
 def _escape_as_data(self, value):
     return escape(value)
Esempio n. 12
0
 def _escape(self, item):
     item = utils.escape(item)
     # Escape also special syntax used by Run Kw If and Run Kws.
     if item in ('ELSE', 'ELSE IF', 'AND'):
         item = '\\' + item
     return item
Esempio n. 13
0
 def _escape(self, item):
     item = utils.escape(item)
     # Escape also special syntax used by Run Kw If and Run Kws.
     if item in ('ELSE', 'ELSE IF', 'AND'):
         item = '\\' + item
     return item
Esempio n. 14
0
 def _escape(self, value):
     return utils.escape(value)
 def _escape(self, item):
     item = utils.escape(item)
     # Escape also special syntax used by Run Kw If and Run Kws.
     if item in ("ELSE", "ELSE IF", "AND"):
         item = "\\" + item
     return item