aboutsummaryrefslogtreecommitdiff
path: root/win/js.py
blob: c5158246f7b87bd22a3120bcabca3d55238a2a79 (plain) (blame)
1
2
3
4
5
6
7
8
9
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)