def configure_manifest_files(app):
def parse_manifest_json():<EOL><INDENT>try:<EOL><INDENT>global manifest<EOL>manifest_file = os.path.join(os.path.dirname(__file__),<EOL>'<STR_LIT>')<EOL>with open(manifest_file, '<STR_LIT:r>') as f:<EOL><INDENT>manifest.update(json.load(f))<EOL>for k in manifest.keys():<EOL><INDENT>manifest[k] = os.path.join("<STR_LIT>", manifest[k])<EOL><DEDENT><DEDENT><DEDENT>except Exception:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>pass<EOL><DEDENT><DEDENT>def get_asset_url(filename):<EOL><INDENT>if app.debug:<EOL><INDENT>parse_manifest_json()<EOL><DEDENT>return url_for('<STR_LIT>', filename=manifest.get(filename, '<STR_LIT>'))<EOL><DEDENT>parse_manifest_json()<EOL>@app.context_processor<EOL>def get_url_for_asset():<EOL><INDENT>"""<STR_LIT>"""<EOL>return dict(url_for_asset=get_asset_url)<EOL><DEDENT>
Loads the manifest file and register the `url_for_asset_` template tag.
:param app:
:return: