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
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
def static_file(filename): """Get static files (CSS-files).""" bottle.send_file(filename, root=static_files)
def serve_img(filename): """Expose static images.""" bottle.send_file(filename, root="templates/img")
def static_file(filename): """Get static files (CSS-files).""" bottle.send_file(filename, root=static_files)
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)