Ejemplo n.º 1
0
def garbage_graph(index):
    """Get graph representation of reference cycle."""
    graph = _compute_garbage_graphs()[int(index)]
    reduce_graph = bottle.request.GET.get('reduce', '')
    if reduce_graph:
        graph = graph.reduce_to_cycles()
    filename = 'garbage%so%s.png' % (index, reduce_graph)
    rendered_file = _get_graph(graph, filename)
    if rendered_file:
        bottle.send_file(rendered_file, root=tmpdir)
    else:
        return None
Ejemplo n.º 2
0
def garbage_graph(index):
    """Get graph representation of reference cycle."""
    graph = _compute_garbage_graphs()[int(index)]
    reduce_graph = bottle.request.GET.get('reduce', '')
    if reduce_graph:
        graph = graph.reduce_to_cycles()
    if not graph:
        return None
    filename = 'garbage%so%s.png' % (index, reduce_graph)
    rendered_file = _get_graph(graph, filename)
    if rendered_file:
        bottle.send_file(rendered_file, root=server.tmpdir)
    else:
        return None
Ejemplo n.º 3
0
def static_file(filename):
    """Get static files (CSS-files)."""
    bottle.send_file(filename, root=static_files)
Ejemplo n.º 4
0
def serve_img(filename):
    """Expose static images."""
    bottle.send_file(filename, root="templates/img")
Ejemplo n.º 5
0
def static_file(filename):
    """Get static files (CSS-files)."""
    bottle.send_file(filename, root=static_files)
Ejemplo n.º 6
0
def tracker_dist():
    """Render timespace chart for tracker data."""
    filename = os.path.join(tmpdir, 'distribution.png')
    charts.tracker_timespace(filename, cache.stats)
    bottle.send_file('distribution.png', root=tmpdir)