Пример #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()
    if not graph:
        return None
    filename = 'garbage%so%s.png' % (index, reduce_graph)
    rendered_file = _get_graph(graph, filename)
    if rendered_file:
        bottle.static_file(rendered_file, root=server.tmpdir)
    else:
        return None
Пример #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.static_file(rendered_file, root=server.tmpdir)
    else:
        return None
Пример #3
0
def static_file(filename):
    """Get static files (CSS-files)."""
    return bottle.static_file(filename, root=static_files)
Пример #4
0
def static_file(filename):
    """Get static files (CSS-files)."""
    bottle.static_file(filename, root=static_files)