# HG changeset patch # User Jeff Hammel # Date 1355189791 28800 # Node ID 1053290ba067b778be586dab73c297379253c975 # Parent 569a5d93b8e32a0358bbb54c9235010f8f0bdb43 finish up this throwaway thing diff -r 569a5d93b8e3 -r 1053290ba067 wsgraph/web.py --- a/wsgraph/web.py Mon Dec 10 17:34:14 2012 -0800 +++ b/wsgraph/web.py Mon Dec 10 17:36:31 2012 -0800 @@ -24,12 +24,8 @@ def node(self, node, graph, request): return Response(body=self.format(graph.node(node))) -def JSONFormatter(node, graph, request): - return json.dumps(graph.node(node), sort_keys=True) -def JSONGraphFormatter(graph, request): - return json.dumps({'nodes': graph.nodes(), - 'edges': graph.edges()}, - sort_keys=True) + def edge(self, node1, node2, graph, request): + return Response(body=self.format(graph.edge(node))) class Dispatcher(object): @@ -112,8 +108,7 @@ if rank not in (0,1,2): return exc.HTTPNotFound() - - # is resource in the graph? [TODO] + # is resource in the graph? if (rank == EDGE) or (rank == NODE): if tuple(segments) not in self.graph: return exc.HTTPNotFound()