mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sort keys in JSON config files for easier diffing
Fixes #1814990 [Sort JSON keys in configuration files](https://bugs.launchpad.net/calibre/+bug/1814990)
This commit is contained in:
parent
aafc038b17
commit
215c05d2e2
@ -412,7 +412,7 @@ class JSONConfig(XMLConfig):
|
|||||||
return json.loads(raw.decode('utf-8'), object_hook=from_json)
|
return json.loads(raw.decode('utf-8'), object_hook=from_json)
|
||||||
|
|
||||||
def to_raw(self):
|
def to_raw(self):
|
||||||
return json.dumps(self, indent=2, default=to_json)
|
return json.dumps(self, indent=2, default=to_json, sort_keys=True)
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user