Esempio n. 1
0
def get_blueprints_manager():
    """
    Get the current blueprints manager
    or create one if none exists for the current app context
    """
    if 'blueprints_manager' not in g:
        g.blueprints_manager = BlueprintsManager()
        maybe_register_teardown(current_app, teardown_blueprints_manager)
    return g.blueprints_manager
def get_blueprints_manager():
    """
    Get the current blueprints manager
    or create one if none exists for the current app context
    """
    if 'blueprints_manager' not in g:
        g.blueprints_manager = BlueprintsManager()
        maybe_register_teardown(current_app, teardown_blueprints_manager)
    return g.blueprints_manager
def get_storage_manager():
    if 'storage_manager' not in g:
        # g.storage_manager = _create_instance()  # TODO: import only once!

        # need to persist same instance across requests...
        g.storage_manager = instance()
        maybe_register_teardown(current_app, teardown_storage_manager)

    return g.storage_manager