summaryrefslogtreecommitdiffstats
path: root/pyload/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-10-07 19:52:31 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-10-07 19:52:43 +0200
commit7e6bd572a64177e1648a52829f077415180daa1f (patch)
tree0d6309cfec294aea6f3e2ddddea13481f996f5b5 /pyload/remote
parentChecksum: reverted b2e7352 due to a case sensitive issue (diff)
downloadpyload-7e6bd572a64177e1648a52829f077415180daa1f.tar.xz
gzip compression for api
Diffstat (limited to 'pyload/remote')
-rw-r--r--pyload/remote/json_converter.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pyload/remote/json_converter.py b/pyload/remote/json_converter.py
index a7a0645ce..b4e57c4a0 100644
--- a/pyload/remote/json_converter.py
+++ b/pyload/remote/json_converter.py
@@ -59,6 +59,17 @@ def dumps(*args, **kwargs):
return json.dumps(*args, **kwargs)
+def dump(*args, **kwargs):
+ if 'compact' in kwargs and kwargs['compact']:
+ kwargs['cls'] = BaseEncoderCompact
+ del kwargs['compact']
+ else:
+ kwargs['cls'] = BaseEncoder
+
+ kwargs['separators'] = separators
+ return json.dump(*args, **kwargs)
+
+
def loads(*args, **kwargs):
kwargs['object_hook'] = convert_obj
return json.loads(*args, **kwargs) \ No newline at end of file