Skip to content

octoprint.util.jinja#

FilteredFileSystemLoader(searchpath, path_filter = None, **kwargs) #

Bases: FileSystemLoader

Jinja2 FileSystemLoader subclass that allows filtering templates.

Only such templates will be accessible for whose paths the provided path_filter filter function returns True.

path_filter will receive the actual path on disc and should behave just like callables provided to Python's internal filter function, returning True if the path is cleared and False if it is supposed to be removed from results and hence filter(path_filter, iterable) should be equivalent to [item for item in iterable if path_filter(item)].

If path_filter is not set or not a callable, the loader will behave just like the regular Jinja2 FileSystemLoader.

WarningLoader(loader, warning_message) #

Bases: BaseLoader

Logs a warning if the loader is used to successfully load a template.