theme: add support for themes.json switch to dictionary (#34024)
This commit is contained in:
parent
3d71a85196
commit
7915360e1f
|
@ -31,7 +31,10 @@ def get_themes():
|
||||||
'themes.json')
|
'themes.json')
|
||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
continue
|
continue
|
||||||
for theme in json.load(open(filename)):
|
themes_data = json.load(open(filename))
|
||||||
|
if not isinstance(themes_data, dict):
|
||||||
|
themes_data = {'themes': themes_data}
|
||||||
|
for theme in themes_data['themes']:
|
||||||
if not 'module' in theme:
|
if not 'module' in theme:
|
||||||
theme['module'] = dirname
|
theme['module'] = dirname
|
||||||
themes.append(theme)
|
themes.append(theme)
|
||||||
|
|
Loading…
Reference in New Issue