class documentation

class NativeEnvironment(Environment):

View In Hierarchy

An environment that renders templates to native Python types.

Inherited from Environment:

Method __init__ Undocumented
Method ​_compile Internal hook that can be overridden to hook a different compile method in.
Method ​_filter​_test​_common Undocumented
Method ​_generate Internal hook that can be overridden to hook a different generate method in.
Method ​_load​_template Undocumented
Method ​_parse Internal parsing function used by parse and compile.
Method ​_tokenize Called by the parser to do the preprocessing and filtering for all the extensions. Returns a ~jinja2.lexer.TokenStream.
Method add​_extension Adds an extension after the environment was created.
Method call​_filter Invoke a filter on a value the same way the compiler does.
Method call​_test Invoke a test on a value the same way the compiler does.
Method compile No summary
Method compile​_expression A handy helper method that returns a callable that accepts keyword arguments that appear as variables in the expression. If called it returns the result of the expression.
Method compile​_templates No summary
Method extend Add the items to the instance of the environment if they do not exist yet. This is used by :ref:`extensions <writing-extensions>` to register callbacks and configuration values without breaking inheritance.
Method from​_string Load a template from a source string without using loader.
Method get​_or​_select​_template Use select_template if an iterable of template names is given, or get_template if one name is given.
Method get​_template Load a template by name with loader and return a Template. If the template does not exist a TemplateNotFound exception is raised.
Method getattr Get an item or attribute of an object but prefer the attribute. Unlike getitem the attribute must be a string.
Method getitem Get an item or attribute of an object but prefer the item.
Method handle​_exception Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template.
Method iter​_extensions Iterates over the extensions by priority.
Method join​_path No summary
Method lex No summary
Method list​_templates Returns a list of templates for this environment. This requires that the loader supports the loader's ~BaseLoader.list_templates method.
Method make​_globals Make the globals map for a template. Any given template globals overlay the environment globals.
Method overlay No summary
Method parse No summary
Method preprocess Preprocesses the source with all extensions. This is automatically called for all parsing and compiling methods but not for lex because there you usually only want the actual source tokenized.
Method select​_template Like get_template, but tries loading multiple names. If none of the names can be loaded a TemplatesNotFound exception is raised.
Class Variable linked​_to Undocumented
Class Variable overlayed Undocumented
Class Variable sandboxed Undocumented
Class Variable shared Undocumented
Class Variable template​_class Undocumented
Instance Variable auto​_reload Undocumented
Instance Variable autoescape Undocumented
Instance Variable block​_end​_string Undocumented
Instance Variable block​_start​_string Undocumented
Instance Variable bytecode​_cache Undocumented
Instance Variable cache Undocumented
Instance Variable comment​_end​_string Undocumented
Instance Variable comment​_start​_string Undocumented
Instance Variable extensions Undocumented
Instance Variable filters Undocumented
Instance Variable finalize Undocumented
Instance Variable globals Undocumented
Instance Variable is​_async Undocumented
Instance Variable keep​_trailing​_newline Undocumented
Instance Variable line​_comment​_prefix Undocumented
Instance Variable line​_statement​_prefix Undocumented
Instance Variable loader Undocumented
Instance Variable lstrip​_blocks Undocumented
Instance Variable newline​_sequence Undocumented
Instance Variable optimized Undocumented
Instance Variable policies Undocumented
Instance Variable tests Undocumented
Instance Variable trim​_blocks Undocumented
Instance Variable undefined Undocumented
Instance Variable variable​_end​_string Undocumented
Instance Variable variable​_start​_string Undocumented
Property lexer The lexer for this environment.