[jayrock] push by azizatif - Updated Python proxy generator to use json instead of simplejson on 2011-05-03 18:08 GMT

8 views
Skip to first unread message

jay...@googlecode.com

unread,
May 3, 2011, 2:08:40 PM5/3/11
to jayrock...@googlegroups.com
Revision: 96f47e35c92a
Author: azizatif
Date: Tue May 3 11:05:31 2011
Log: Updated Python proxy generator to use json instead of simplejson
http://code.google.com/p/jayrock/source/detail?r=96f47e35c92a

Modified:
/src/Jayrock/JsonRpc/Web/JsonRpcPythonProxyGenerator.cs

=======================================
--- /src/Jayrock/JsonRpc/Web/JsonRpcPythonProxyGenerator.cs Fri Apr 15
16:09:54 2011
+++ /src/Jayrock/JsonRpc/Web/JsonRpcPythonProxyGenerator.cs Tue May 3
11:05:31 2011
@@ -61,7 +61,7 @@

private static void WriteProlog(IndentedTextWriter writer)
{
- writer.WriteLine("import simplejson");
+ writer.WriteLine("import json");
writer.WriteLine("import urllib");
writer.WriteLine();
}
@@ -155,7 +155,7 @@
{
writer.WriteLine(@"def __call(self, method, params):
self.__id = self.__id + 1
- response = simplejson.loads(urllib.urlopen(self.url,
urllib.urlencode([('JSON-RPC', simplejson.dumps({ 'id' :
self.__id, 'method' : method, 'params' : params }))])).read())
+ response = json.loads(urllib.urlopen(self.url,
urllib.urlencode([('JSON-RPC', json.dumps({ 'id' : self.__id, 'method' :
method, 'params' : params }))])).read())
if response.has_key('error'): raise Error(None, response)
return response['result']
");

Reply all
Reply to author
Forward
0 new messages