This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/templating.py

14 lines
444 B
Python
Raw Permalink Normal View History

import flask.templating
import ereuse_devicehub.resources.device.models
class Environment(flask.templating.Environment):
"""As flask's environment but with some globals set"""
def __init__(self, app, **options):
super().__init__(app, **options)
self.globals[isinstance.__name__] = isinstance
self.globals[issubclass.__name__] = issubclass
self.globals['d'] = ereuse_devicehub.resources.device.models