mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Merge pull request #40 from SemjonKerner/sort_config_dict
Sort json config file (0.4.5)
This commit is contained in:
commit
0924467487
@ -60,10 +60,17 @@ class Config:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def _sort_dict(self):
|
||||||
|
tmpdict = dict()
|
||||||
|
for key in sorted(self.config_dict.keys()):
|
||||||
|
tmpdict[key] = self.config_dict[key]
|
||||||
|
self.config_dict = tmpdict
|
||||||
|
|
||||||
def save_config(self):
|
def save_config(self):
|
||||||
"""
|
"""
|
||||||
save the cache to the file
|
save the cache to the file
|
||||||
"""
|
"""
|
||||||
|
self._sort_dict()
|
||||||
with open(filename(), 'w') as f:
|
with open(filename(), 'w') as f:
|
||||||
f.write(json.dumps(self.config_dict))
|
f.write(json.dumps(self.config_dict))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user