Exemple #1
0
def load_config(pth):
    if '.' in pth:
        (_id, ext) = pth.split('.')
    else:
        _id = pth
        ext = None

    graph = Graph()
    graph.id = _id

    try:
        config = graph.config
    except AttributeError:
        abort(500)

    if ext == 'png':
        image = graph.graph()
        if image:
            return Response(image, mimetype='image/png')
        else:
            abort(404)

    return render_template('index.html',
                           graphite_host=graphite_host,
                           graph=dumps(config))
Exemple #2
0
def load_blob(_id):
    graph = Graph()
    graph.id = _id
    image = graph.blob

    if image:
        return Response(image, mimetype='image/png')
    else:
        abort(500)