summaryrefslogtreecommitdiff
path: root/win/js.py
diff options
context:
space:
mode:
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)