# Path: opendiamond/dataretriever/util.py
# ATTR_SUFFIX = '.text_attr'


import os
import datetime
from xml.sax.saxutils import quoteattr
from flask import Blueprint, url_for, Response, stream_with_context, send_file, \
    jsonify
from werkzeug.datastructures import Headers
from opendiamond.dataretriever.util import ATTR_SUFFIX
#  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
#




BASEURL = 'collection'
STYLE = False
LOCAL_OBJ_URI = True  # if true, return local file path, otherwise http.
INDEXDIR = DATAROOT = None


def init(config):
    global INDEXDIR, DATAROOT  # pylint: disable=global-statement
    INDEXDIR = config.indexdir
    DATAROOT = config.dataroot


scope_blueprint = Blueprint('diamond_store', __name__)


@scope_blueprint.route('/<gididx>')
@scope_blueprint.route('/<gididx>/limit/<int:limit>')
def get_scope(gididx, limit=None):
    index = 'GIDIDX' + gididx.upper()
    index = _get_index_absolute_path(index)

    # Streaming response:
    # http://flask.pocoo.org/docs/0.12/patterns/streaming/
    def generate():

# Path: opendiamond/dataretriever/util.py
# ATTR_SUFFIX = '.text_attr'


# Path: opendiamond/dataretriever/diamond_store.py
import os
import datetime
from xml.sax.saxutils import quoteattr
from flask import Blueprint, url_for, Response, stream_with_context, send_file, \
    jsonify
from werkzeug.datastructures import Headers
from opendiamond.dataretriever.util import ATTR_SUFFIX

#  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
#




BASEURL = 'collection'
STYLE = False
LOCAL_OBJ_URI = True  # if true, return local file path, otherwise http.
INDEXDIR = DATAROOT = None


def init(config):
    global INDEXDIR, DATAROOT  # pylint: disable=global-statement
    INDEXDIR = config.indexdir
    DATAROOT = config.dataroot


scope_blueprint = Blueprint('diamond_store', __name__)


@scope_blueprint.route('/<gididx>')
@scope_blueprint.route('/<gididx>/limit/<int:limit>')
def get_scope(gididx, limit=None):
    index = 'GIDIDX' + gididx.upper()
    index = _get_index_absolute_path(index)

    # Streaming response:
    # http://flask.pocoo.org/docs/0.12/patterns/streaming/
    def generate():

        num_entries = 0