From 7915360e1fb89e3297da88b3735245d2aa4d704a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 16 Jun 2019 20:21:59 +0200 Subject: [PATCH] theme: add support for themes.json switch to dictionary (#34024) --- hobo/theme/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hobo/theme/utils.py b/hobo/theme/utils.py index 518907f..a91b2ad 100644 --- a/hobo/theme/utils.py +++ b/hobo/theme/utils.py @@ -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)