Update jsonrpclib library r20 to (b59217c).

This commit is contained in:
JackDandy 2015-06-16 17:19:43 +01:00
parent 81de04efa1
commit 11d1168c4f
5 changed files with 29 additions and 17 deletions

View file

@ -48,6 +48,7 @@
* Update dateutil library 2.2 to 2.4.2 (a6b8925)
* Update ConfigObj library 4.6.0 to 5.1.0 (a68530a)
* Update Beautiful Soup to 4.3.2 (r353)
* Update jsonrpclib library r20 to (b59217c)
[develop changelog]
* Update Requests library 2.7.0 (ab1f493) to 2.7.0 (8b5e457)

View file

@ -1,6 +1,6 @@
import lib.jsonrpclib
from lib.jsonrpclib import Fault
from lib.jsonrpclib.jsonrpc import USE_UNIX_SOCKETS
import jsonrpclib
from jsonrpclib import Fault
from jsonrpclib.jsonrpc import USE_UNIX_SOCKETS
import SimpleXMLRPCServer
import SocketServer
import socket

View file

@ -1,7 +1,6 @@
from config import Config
from jsonrpclib.config import Config
config = Config.instance()
from history import History
from jsonrpclib.history import History
history = History.instance()
import jsonrpc
from jsonrpc import Server, MultiCall, Fault
from jsonrpc import ProtocolError, loads, dumps
from jsonrpclib.jsonrpc import Server, MultiCall, Fault
from jsonrpclib.jsonrpc import ProtocolError, loads, dumps

View file

@ -3,7 +3,7 @@ import inspect
import re
import traceback
from lib.jsonrpclib import config
from jsonrpclib import config
iter_types = [
types.DictType,
@ -129,6 +129,13 @@ def load(obj):
except ImportError:
raise TranslationError('Could not import %s from module %s.' %
(json_class_name, json_module_tree))
# The returned class is the top-level module, not the one we really
# want. (E.g., if we import a.b.c, we now have a.) Walk through other
# path components to get to b and c.
for i in json_module_parts[1:]:
temp_module = getattr(temp_module, i)
json_class = getattr(temp_module, json_class_name)
# Creating the object...
new_obj = None

View file

@ -57,9 +57,9 @@ import string
import random
# Library includes
import lib.jsonrpclib
from lib.jsonrpclib import config
from lib.jsonrpclib import history
import jsonrpclib
from jsonrpclib import config
from jsonrpclib import history
# JSON library importing
cjson = None
@ -71,7 +71,7 @@ except ImportError:
import json
except ImportError:
try:
import lib.simplejson as json
import simplejson as json
except ImportError:
raise ImportError(
'You must have the cjson, json, or simplejson ' +
@ -148,10 +148,15 @@ class JSONTarget(object):
return ''.join(self.data)
class Transport(TransportMixIn, XMLTransport):
pass
def __init__(self):
TransportMixIn.__init__(self)
XMLTransport.__init__(self)
class SafeTransport(TransportMixIn, XMLSafeTransport):
pass
def __init__(self):
TransportMixIn.__init__(self)
XMLSafeTransport.__init__(self)
from httplib import HTTP, HTTPConnection
from socket import socket
@ -481,7 +486,7 @@ def dumps(params=[], methodname=None, methodresponse=None,
raise ValueError('Method name must be a string, or methodresponse '+
'must be set to True.')
if config.use_jsonclass == True:
from lib.jsonrpclib import jsonclass
from jsonrpclib import jsonclass
params = jsonclass.dump(params)
if methodresponse is True:
if rpcid is None:
@ -509,7 +514,7 @@ def loads(data):
# should return something like the following:
# { 'jsonrpc':'2.0', 'error': fault.error(), id: None }
if config.use_jsonclass == True:
from lib.jsonrpclib import jsonclass
from jsonrpclib import jsonclass
result = jsonclass.load(result)
return result