"""Utils for the template library.""" from flask import url_for from auth import config from auth.connectors import manifest def asset(name): """The URI of an asset. Used in template, this method retrieves the URI of an asset. For local developments, it will find the assets in the local development, for QA and Production, it will use information that are in our CDN. Args: name (str): the name of the asset. Returns: URI: the URI of the asset. """ if config.ENVIRONMENT in [config.PROD_ENVIRONMENT, config.QA_ENVIRONMENT]: return manifest.manifest.get_url(name) return url_for('static', filename=name)