third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py
def render(self, caller, template, template_vars):
        """
        Renders the template with variable bindings.

        It's okay to invoke |render| method recursively and |caller| is pushed
        onto the call stack, which is accessible via
        |callers_from_first_to_last| method, etc.

        Args:
            caller: An object to be pushed onto the call stack.
            template: A MakoTemplate.
            template_vars: A dict of template variable bindings.
        """
        assert caller is not None
        assert isinstance(template, MakoTemplate)
        assert isinstance(template_vars, dict)

        self._caller_stack.append(caller)

        try:
            mako_template = template.mako_template(
                pass_key=_MAKO_TEMPLATE_PASS_KEY)
            mako_context = mako.runtime.Context(self._text_buffer,
                                                **template_vars)
            mako_template.render_context(mako_context)
        except:
            # Print stacktrace of template rendering.
            sys.stderr.write("\n")
            sys.stderr.write("==== template rendering error ====\n")
            sys.stderr.write("  * name: {}, type: {}\n".format(
                _guess_caller_name(self.last_caller), type(self.last_caller)))
            sys.stderr.write("  * depth: {}, module_id: {}\n".format(
                len(self._caller_stack), mako_template.module_id))
            sys.stderr.write("---- template source ----\n")
            sys.stderr.write(mako_template.source)

            # Save the error state at the deepest call.
            current = self._caller_stack
            on_error = self._caller_stack_on_error
            if (len(current) <= len(on_error)
                    and all(current[i] == on_error[i]
                            for i in range(len(current)))):
                pass  # Error happened in a deeper caller.
            else:
                self._caller_stack_on_error = list(self._caller_stack)

            raise
        finally:
            self._caller_stack.pop()

        Renders the template with variable bindings.

        It's okay to invoke |render| method recursively and |caller| is pushed
        onto the call stack, which is accessible via
        |callers_from_first_to_last| method, etc.

        Args:
            caller: An object to be pushed onto the call stack.
            template: A MakoTemplate.
            template_vars: A dict of template variable bindings.
        
Renders the template with variable bindings.
Renders the template with variable bindings .
def render(self, caller, template, template_vars):
        assert caller is not None
        assert isinstance(template, MakoTemplate)
        assert isinstance(template_vars, dict)
        self._caller_stack.append(caller)
        try:
            mako_template = template.mako_template(
                pass_key=_MAKO_TEMPLATE_PASS_KEY)
            mako_context = mako.runtime.Context(self._text_buffer,
                                                **template_vars)
            mako_template.render_context(mako_context)
        except:
            sys.stderr.write("\n")
            sys.stderr.write("==== template rendering error ====\n")
            sys.stderr.write("  * name: {}, type: {}\n".format(
                _guess_caller_name(self.last_caller), type(self.last_caller)))
            sys.stderr.write("  * depth: {}, module_id: {}\n".format(
                len(self._caller_stack), mako_template.module_id))
            sys.stderr.write("---- template source ----\n")
            sys.stderr.write(mako_template.source)
            current = self._caller_stack
            on_error = self._caller_stack_on_error
            if (len(current) <= len(on_error)
                    and all(current[i] == on_error[i]
                            for i in range(len(current)))):
                pass  
            else:
                self._caller_stack_on_error = list(self._caller_stack)
            raise
        finally:
            self._caller_stack.pop()
def render ( self , caller , template , template_vars ) : assert caller is not None assert isinstance ( template , MakoTemplate ) assert isinstance ( template_vars , dict ) self . _caller_stack . append ( caller ) try : mako_template = template . mako_template ( pass_key = _MAKO_TEMPLATE_PASS_KEY ) mako_context = mako . runtime . Context ( self . _text_buffer , ** template_vars ) mako_template . render_context ( mako_context ) except : sys . stderr . write ( "\n" ) sys . stderr . write ( "==== template rendering error ====\n" ) sys . stderr . write ( "  * name: {}, type: {}\n" . format ( _guess_caller_name ( self . last_caller ) , type ( self . last_caller ) ) ) sys . stderr . write ( "  * depth: {}, module_id: {}\n" . format ( len ( self . _caller_stack ) , mako_template . module_id ) ) sys . stderr . write ( "---- template source ----\n" ) sys . stderr . write ( mako_template . source ) current = self . _caller_stack on_error = self . _caller_stack_on_error if ( len ( current ) <= len ( on_error ) and all ( current [ i ] == on_error [ i ] for i in range ( len ( current ) ) ) ) : pass else : self . _caller_stack_on_error = list ( self . _caller_stack ) raise finally : self . _caller_stack . pop ( )
Renders the template with variable bindings.
Renders the template with variable bindings .
"""
        Renders the template with variable bindings.

        It's okay to invoke |render| method recursively and |caller| is pushed
        onto the call stack, which is accessible via
        |callers_from_first_to_last| method, etc.

        Args:
            caller: An object to be pushed onto the call stack.
            template: A MakoTemplate.
            template_vars: A dict of template variable bindings.
        """ # Print stacktrace of template rendering. # Save the error state at the deepest call. # Error happened in a deeper caller.
self
caller
An object to be pushed onto the call stack.
An object to be pushed onto the call stack .
template
None
template_vars
A dict of template variable bindings.
A dict of template variable bindings .