build an info.json from KLE
This commit is contained in:
parent
34446b79d7
commit
0f8b34771d
3 changed files with 124 additions and 44 deletions
|
@ -17,6 +17,17 @@ class InfoJSONEncoder(json.JSONEncoder):
|
|||
if not self.indent:
|
||||
self.indent = 4
|
||||
|
||||
def default(self, obj):
|
||||
"""Fix certain objects that don't encode.
|
||||
"""
|
||||
if isinstance(obj, Decimal):
|
||||
if obj == int(obj):
|
||||
return int(obj)
|
||||
|
||||
return float(obj)
|
||||
|
||||
return json.JSONEncoder.default(self, obj)
|
||||
|
||||
def encode(self, obj):
|
||||
"""Encode JSON objects for QMK.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue