(self, s, args, kwargs, format_func=None)
return type(s)(rv)
If a format call is detected, then this is routed through this
        method so that our safety sandbox can be used for it.
If a format call is detected, then this is routed through this
        method so that our safety sandbox can be used for it.
If a format call is detected then this is routed through this method so that our safety sandbox can be used for it .
def format_string(self, s, args, kwargs, format_func=None):
        """If a format call is detected, then this is routed through this
        method so that our safety sandbox can be used for it.
        """
        if isinstance(s, Markup):
            formatter = SandboxedEscapeFormatter(self, s.escape)
        else:
            formatter = SandboxedFormatter(self)

        if format_func is not None and format_func.__name__ == "format_map":
            if len(args) != 1 or kwargs:
                raise TypeError(
                    "format_map() takes exactly one argument %d given"
                    % (len(args) + (kwargs is not None))
                )

            kwargs = args[0]
            args = None

        kwargs = _MagicFormatMapping(args, kwargs)
        rv = formatter.vformat(s, args, kwargs)
        return type(s)(rv)
def format_string ( self , s , args , kwargs , format_func = None ) : if isinstance ( s , Markup ) : formatter = SandboxedEscapeFormatter ( self , s . escape ) else : formatter = SandboxedFormatter ( self ) if format_func is not None and format_func . __name__ == "format_map" : if len ( args ) != 1 or kwargs : raise TypeError ( "format_map() takes exactly one argument %d given" % ( len ( args ) + ( kwargs is not None ) ) ) kwargs = args [ 0 ] args = None kwargs = _MagicFormatMapping ( args , kwargs ) rv = formatter . vformat ( s , args , kwargs ) return type ( s ) ( rv )