Community modules (#24848)
This commit is contained in:
parent
63b095212b
commit
1efc82403b
37 changed files with 987 additions and 84 deletions
|
@ -235,3 +235,31 @@ class UserspaceJSONEncoder(QMKJSONEncoder):
|
|||
return '01build_targets'
|
||||
|
||||
return key
|
||||
|
||||
|
||||
class CommunityModuleJSONEncoder(QMKJSONEncoder):
|
||||
"""Custom encoder to make qmk_module.json's a little nicer to work with.
|
||||
"""
|
||||
def sort_dict(self, item):
|
||||
"""Sorts the hashes in a nice way.
|
||||
"""
|
||||
key = item[0]
|
||||
|
||||
if self.indentation_level == 1:
|
||||
if key == 'module_name':
|
||||
return '00module_name'
|
||||
if key == 'maintainer':
|
||||
return '01maintainer'
|
||||
if key == 'url':
|
||||
return '02url'
|
||||
if key == 'features':
|
||||
return '03features'
|
||||
if key == 'keycodes':
|
||||
return '04keycodes'
|
||||
elif self.indentation_level == 3: # keycodes
|
||||
if key == 'key':
|
||||
return '00key'
|
||||
if key == 'aliases':
|
||||
return '01aliases'
|
||||
|
||||
return key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue