예제 #1
0
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
예제 #2
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
예제 #4
0
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
예제 #5
0
def get_riemann_client():
    """
    Get the current riemann_client
    or create one if none exists for the current app context
    """
    if 'riemann_client' not in g:
        g.riemann_client = RiemannClient()
        maybe_register_teardown(current_app, teardown_riemann)

    return g.riemann_client