loader.py
Extension allowing to load other extensions using relative file paths.
TemplateExtensionLoader (Extension)
¤
Extension allowing to load other extensions using relative file paths.
__init__(self, environment)
special
¤
Initialize the object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
environment |
The Jinja environment. |
required |
Source code in copier_templates_extensions/extensions/loader.py
def __init__(self, environment):
"""Initialize the object.
Arguments:
environment: The Jinja environment.
"""
super().__init__(environment)
# patch jinja's extension loading mechanism
jinja_env_module.import_string = self._patched_import_string