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)
| 197 | |
| 198 | class 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 | |
| 216 | class NativeEnvironment(Environment): |
nothing calls this directly
no test coverage detected