diff options
author | Georg Brandl <georg@python.org> | 2015-03-08 16:55:34 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2015-03-08 16:55:34 +0100 |
commit | d0efb42a4179f331dd67d4d301c81b2c01d8e386 (patch) | |
tree | 172f81f7d18e2e6fb28c0ead629e10a8443ec6ee /sphinx/util/jsdump.py | |
parent | 2a6b9d58088a186884884d8f30542df8963de075 (diff) | |
download | sphinx-git-d0efb42a4179f331dd67d4d301c81b2c01d8e386.tar.gz |
util: pep8 fixes
Diffstat (limited to 'sphinx/util/jsdump.py')
-rw-r--r-- | sphinx/util/jsdump.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/util/jsdump.py b/sphinx/util/jsdump.py index 49813672d..362f67942 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -53,6 +53,7 @@ def encode_string(s): return '\\u%04x\\u%04x' % (s1, s2) return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"' + def decode_string(s): return ESCAPED.sub(lambda m: eval(u + '"' + m.group() + '"'), s) @@ -74,6 +75,7 @@ delete implements short while do import static with double in super""".split()) + def dumps(obj, key=False): if key: if not isinstance(obj, string_types): @@ -101,6 +103,7 @@ def dumps(obj, key=False): return encode_string(obj) raise TypeError(type(obj)) + def dump(obj, f): f.write(dumps(obj)) @@ -195,5 +198,6 @@ def loads(x): raise ValueError("nothing loaded from string") return obj + def load(f): return loads(f.read()) |