MCPcopy Index your code
hub / github.com/nodejs/node / render

Method render

tools/inspector_protocol/jinja2/nativetypes.py:199–213  ·  view source on GitHub ↗

Render the template to produce a native Python type. If the result is a single node, its value is returned. Otherwise, the nodes are concatenated as strings. If the result can be parsed with :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the string

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

197
198class NativeTemplate(Template):
199 def render(self, *args, **kwargs):
200 """Render the template to produce a native Python type. If the result
201 is a single node, its value is returned. Otherwise, the nodes are
202 concatenated as strings. If the result can be parsed with
203 :func:`ast.literal_eval`, the parsed value is returned. Otherwise, the
204 string is returned.
205 """
206 vars = dict(*args, **kwargs)
207
208 try:
209 return native_concat(self.root_render_func(self.new_context(vars)))
210 except Exception:
211 exc_info = sys.exc_info()
212
213 return self.environment.handle_exception(exc_info, True)
214
215
216class NativeEnvironment(Environment):

Callers

nothing calls this directly

Calls 4

exc_infoMethod · 0.80
native_concatFunction · 0.70
new_contextMethod · 0.45
handle_exceptionMethod · 0.45

Tested by

no test coverage detected