def initialize_standalone(): # Initialize app = flask.Flask(__name__) config_cache.get_config()['app'] = app # Load configuration settings app.config.update(services.config_layer.get_config()) # Create singleton for access services.util.AppConfigKeeper.create_instance(app.config) attach_blueprints(app)
def get_app(): return config_cache.get_config()['app']
def get_config(): return config_cache.get_config()['config']
def set_app(app): config_cache.get_config()['app'] = app
def set_overwrite_config(config): config_cache.get_config()['config'] = config
def set_db_adapter(new_adapter): config_cache.get_config()['db_adapter'] = new_adapter
def get_db_adapter(): config = config_cache.get_config() if not config['db_adapter']: import services config['db_adapter'] = services.db_service.DBAdapter() return config['db_adapter']
def render_common_template_vals(slug=None): return config_cache.get_config()['get_common_template_vals'](slug)
def set_render_common_template_vals(func): config_cache.get_config()['get_common_template_vals'] = func