theme: add support for themes.json switch to dictionary (#34024)

This commit is contained in:
Frédéric Péters 2019-06-16 20:21:59 +02:00
parent 3d71a85196
commit 7915360e1f
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ def get_themes():
'themes.json')
if not os.path.exists(filename):
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:
theme['module'] = dirname
themes.append(theme)