Allow optional stylesheets in extensions.

main
Alex Huszagh 2022-04-30 17:15:41 -05:00
parent eac6429258
commit 92bc22b70e
1 changed files with 6 additions and 1 deletions

View File

@ -95,8 +95,13 @@ def load_json(path):
def read_template_dir(directory):
'''Read the template data from a directory'''
# Make the stylesheet template optional.
stylesheet = ''
stylesheet_path = f'{directory}/stylesheet.qss.in'
if os.path.exists(stylesheet_path):
stylesheet = open(f'{directory}/stylesheet.qss.in').read()
data = {
'stylesheet': open(f'{directory}/stylesheet.qss.in').read(),
'stylesheet': stylesheet,
'icons': [],
}
if os.path.exists(f'{directory}/icons.json'):