diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-06-16 16:16:03 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-06-16 16:16:03 -0700 |
commit | 2db58930a6f8c955c4d437657bd07e2939a705f2 (patch) | |
tree | b1d388bd4adc1d3134d255cd0c4d8746d7b2468b /python/itsdangerous/_json.py | |
parent | 9f93b9429c77e631972186049fbc7518e2cf5d4b (diff) | |
download | yt-local-2db58930a6f8c955c4d437657bd07e2939a705f2.tar.lz yt-local-2db58930a6f8c955c4d437657bd07e2939a705f2.tar.xz yt-local-2db58930a6f8c955c4d437657bd07e2939a705f2.zip |
Convert watch page to flask framework
Diffstat (limited to 'python/itsdangerous/_json.py')
-rw-r--r-- | python/itsdangerous/_json.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/python/itsdangerous/_json.py b/python/itsdangerous/_json.py new file mode 100644 index 0000000..426b36e --- /dev/null +++ b/python/itsdangerous/_json.py @@ -0,0 +1,18 @@ +try: + import simplejson as json +except ImportError: + import json + + +class _CompactJSON(object): + """Wrapper around json module that strips whitespace.""" + + @staticmethod + def loads(payload): + return json.loads(payload) + + @staticmethod + def dumps(obj, **kwargs): + kwargs.setdefault("ensure_ascii", False) + kwargs.setdefault("separators", (",", ":")) + return json.dumps(obj, **kwargs) |