def _replace_list_until(self, items, replace_until):
     # @{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)]))
     if len(replaced) > replace_until:
         replaced[replace_until:] = [escape(item)
                                     for item in replaced[replace_until:]]
     return replaced + items
示例#2
0
 def _escape_as_data(self, value):
     return escape(value)