1 import os 2 from . import app 3 4 BANNER_LOCATION = "/var/lib/copr/banner-include.html" 5 6 7 @app.context_processor 8 -def include_banner(): 9 if os.path.exists(BANNER_LOCATION): 10 return {"copr_banner": open(BANNER_LOCATION).read()} 11 else: 12 return {} 13 14 15 @app.context_processor 16 -def inject_fedmenu(): 17 """ Inject fedmenu url if available. """ 18 if 'FEDMENU_URL' in app.config: 19 return dict( 20 fedmenu_url=app.config['FEDMENU_URL'], 21 fedmenu_data_url=app.config['FEDMENU_DATA_URL'], 22 ) 23 return dict() 24