class ModuleLoader(BaseLoader):
This loader loads templates from precompiled templates.
Example usage:
>>> loader = ChoiceLoader([ ... ModuleLoader('/path/to/compiled/templates'), ... FileSystemLoader('/path/to/templates') ... ])
Templates can be precompiled with Environment.compile_templates
.
Static Method | get_module_filename |
Undocumented |
Static Method | get_template_key |
Undocumented |
Method | __init__ |
Undocumented |
Method | load |
No summary |
Class Variable | has_source_access |
Undocumented |
Instance Variable | module |
Undocumented |
Instance Variable | package_name |
Undocumented |
Inherited from BaseLoader
:
Method | get_source |
No summary |
Method | list_templates |
Iterates over all templates. If the loader does not support that it should raise a TypeError which is the default behavior. |
Undocumented
Parameters | |
name:str | Undocumented |
Returns | |
str | Undocumented |
Undocumented
Parameters | |
name:str | Undocumented |
Returns | |
str | Undocumented |
Undocumented
Parameters | |
path:t.Union[ | Undocumented |
jinja2.loaders.BaseLoader.load
get_source
. Subclasses should not
override this method as loaders working on collections of other
loaders (such as PrefixLoader
or ChoiceLoader
)
will not call this method but get_source
directly.Parameters | |
environment:Environment | Undocumented |
name:str | Undocumented |
globals:t.Optional[ | Undocumented |
Returns | |
Template | Undocumented |