summaryrefslogtreecommitdiff
path: root/win/js.py
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2012-02-21 15:53:40 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2012-02-21 15:53:40 +0100
commit349cfa7acb95abe865209a28e417ec74b56f9bba (patch)
treead65334821b587c4ecdd461be84c94305ffdb888 /win/js.py
Imported Upstream version 2.2.1upstream/2.2.1
Diffstat (limited to 'win/js.py')
-rw-r--r--win/js.py10
1 files changed, 10 insertions, 0 deletions
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)