Mercurial > hg > WSGraph
diff wsgraph/web.py @ 20:542232f858a9
rearrange this all around for argument order
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 10 Dec 2012 17:46:07 -0800 |
parents | 8162dc8dd93a |
children | f56d27f03e4a |
line wrap: on
line diff
--- a/wsgraph/web.py Mon Dec 10 17:44:11 2012 -0800 +++ b/wsgraph/web.py Mon Dec 10 17:46:07 2012 -0800 @@ -24,18 +24,19 @@ """front-end to json.dumps""" return json.dumps(instance, sort_keys=self.sort_keys) - def node(self, node, graph, request): + def node(self, request, graph, node): return Response(content_type=self.content_type, body=self.format(graph.node(node))) - def edge(self, node1, node2, graph, request): + def edge(self, request, graph, node1, node2): return Response(content_type=self.content_type, - body=self.format(graph.edge(node))) + body=self.format(graph.edge(node1, node2))) - def graph(self, graph, request): + def graph(self, request, graph): return Response(content_type=self.content_type, body='hello? is it me you\'re looking for?') + class Dispatcher(object): def __init__(self, graph, @@ -124,7 +125,7 @@ # formatter formatter = self.formatters[len(segments)] - return formatter(*segments, self.graph, request) + return formatter(request, self.graph, *segments) return Response(content_type='text/plain', body=content)