diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-10-07 19:52:31 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-10-07 19:52:43 +0200 |
commit | 7e6bd572a64177e1648a52829f077415180daa1f (patch) | |
tree | 0d6309cfec294aea6f3e2ddddea13481f996f5b5 /pyload/remote/json_converter.py | |
parent | Checksum: reverted b2e7352 due to a case sensitive issue (diff) | |
download | pyload-7e6bd572a64177e1648a52829f077415180daa1f.tar.xz |
gzip compression for api
Diffstat (limited to 'pyload/remote/json_converter.py')
-rw-r--r-- | pyload/remote/json_converter.py | 11 |
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 |