예제 #1
0
 def escape(cls, s):
     """Escape the string.  Works like :func:`escape` with the difference
     that for subclasses of :class:`Markup` this function would return the
     correct subclass.
     """
     rv = escape(s)
     if rv.__class__ is not cls:
         return cls(rv)
     return rv
예제 #2
0
 def escape(cls, s):
     """Escape the string.  Works like :func:`escape` with the difference
     that for subclasses of :class:`Markup` this function would return the
     correct subclass.
     """
     rv = escape(s)
     if rv.__class__ is not cls:
         return cls(rv)
     return rv
예제 #3
0
def _escape_argspec(obj, iterable, escape):
    """Helper for various string-wrapped functions."""
    for key, value in iterable:
        if hasattr(value, '__html__') or isinstance(value, string_types):
            obj[key] = escape(value)
    return obj
예제 #4
0
def _escape_argspec(obj, iterable, escape):
    """Helper for various string-wrapped functions."""
    for key, value in iterable:
        if hasattr(value, '__html__') or isinstance(value, string_types):
            obj[key] = escape(value)
    return obj