Coverage for qutebrowser/utils/jinja.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # qutebrowser is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Error while loading template</title> </head> <body> <p><span style="font-size:120%;color:red"> The %FILE% template could not be found!<br> Please check your qutebrowser installation </span><br> %ERROR% </p> </body> </html> """
"""Jinja loader which uses utils.read_file to load templates.
Attributes: _subdir: The subdirectory to find templates in. """
.format(template, path)) # Currently we don't implement auto-reloading, so we always return True # for up-to-date.
"""Our own jinja environment which is more strict."""
autoescape=lambda _name: self._autoescape, undefined=jinja2.StrictUndefined)
def no_autoescape(self): """Context manager to temporarily turn off autoescaping."""
"""Load images from a relative path (to qutebrowser).
Arguments: path: The relative path to the image """
"""Get a data: url for the broken qutebrowser logo."""
"""Override jinja's getattr() to be less clever.
This means it doesn't fall back to __getitem__, and it doesn't hide AttributeError. """
"""Render the given template and pass the given arguments to it."""
|