diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2014-02-26 15:07:33 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2014-02-28 15:23:50 -0500 |
commit | 260cf5c0a4754be39b05f6a247b8a354de7eced6 (patch) | |
tree | 4ac8e483e10c45005af2b853b1b243cf0f2705fa /jsonrpc | |
parent | 829f82226795f1306de87cfbd53544509d75b406 (diff) | |
download | bitcoin-260cf5c0a4754be39b05f6a247b8a354de7eced6.tar.xz |
Squashed 'qa/rpc-tests/python-bitcoinrpc/' content from commit e484743
git-subtree-dir: qa/rpc-tests/python-bitcoinrpc
git-subtree-split: e48474322de165212c5aa29574297e78b09df8d6
Diffstat (limited to 'jsonrpc')
-rw-r--r-- | jsonrpc/__init__.py | 2 | ||||
-rw-r--r-- | jsonrpc/authproxy.py | 3 | ||||
-rw-r--r-- | jsonrpc/json.py | 9 | ||||
-rw-r--r-- | jsonrpc/proxy.py | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/jsonrpc/__init__.py b/jsonrpc/__init__.py new file mode 100644 index 0000000000..8441fa3120 --- /dev/null +++ b/jsonrpc/__init__.py @@ -0,0 +1,2 @@ +from .json import loads, dumps, JSONEncodeException, JSONDecodeException +from jsonrpc.proxy import ServiceProxy, JSONRPCException diff --git a/jsonrpc/authproxy.py b/jsonrpc/authproxy.py new file mode 100644 index 0000000000..e90ef361d0 --- /dev/null +++ b/jsonrpc/authproxy.py @@ -0,0 +1,3 @@ +from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException + +__all__ = ['AuthServiceProxy', 'JSONRPCException'] diff --git a/jsonrpc/json.py b/jsonrpc/json.py new file mode 100644 index 0000000000..95398630f7 --- /dev/null +++ b/jsonrpc/json.py @@ -0,0 +1,9 @@ +_json = __import__('json') +loads = _json.loads +dumps = _json.dumps +if hasattr(_json, 'JSONEncodeException'): + JSONEncodeException = _json.JSONEncodeException + JSONDecodeException = _json.JSONDecodeException +else: + JSONEncodeException = TypeError + JSONDecodeException = ValueError diff --git a/jsonrpc/proxy.py b/jsonrpc/proxy.py new file mode 100644 index 0000000000..0d2be1e93b --- /dev/null +++ b/jsonrpc/proxy.py @@ -0,0 +1 @@ +from bitcoinrpc.authproxy import AuthServiceProxy as ServiceProxy, JSONRPCException |