From 349cfa7acb95abe865209a28e417ec74b56f9bba Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Iniesta Date: Tue, 21 Feb 2012 15:53:40 +0100 Subject: Imported Upstream version 2.2.1 --- win/js.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 win/js.py (limited to 'win/js.py') diff --git a/win/js.py b/win/js.py new file mode 100644 index 0000000..d1d4db3 --- /dev/null +++ b/win/js.py @@ -0,0 +1,10 @@ +import json + +# usage: +# print JSON().encode(kv) + +class JSON(json.JSONEncoder): + def __init__(self, **kwargs): + args = dict(sort_keys=True, indent=2) + args.update(kwargs) + json.JSONEncoder.__init__(self, **args) -- cgit v1.2.3