Passing booleans to functions

main
Bob Mottram 2020-11-14 19:21:11 +00:00
parent 7c833a177c
commit a9e19a2a2e
1 changed files with 20 additions and 8 deletions

View File

@ -198,22 +198,34 @@ def setThemeFromDict(baseDir: str, name: str,
css = cssfile.read() css = cssfile.read()
for paramName, paramValue in themeParams.items(): for paramName, paramValue in themeParams.items():
if paramName == 'newswire-publish-icon': if paramName == 'newswire-publish-icon':
setNewswirePublishAsIcon(baseDir, if paramValue.lower() == 'true':
paramValue.lower() == 'true') setNewswirePublishAsIcon(baseDir, True)
else:
setNewswirePublishAsIcon(baseDir, False)
continue continue
elif paramName == 'full-width-timeline-buttons': elif paramName == 'full-width-timeline-buttons':
paramBool = paramValue.lower() == 'true' if paramValue.lower() == 'true':
setFullWidthTimelineButtonHeader(baseDir, paramBool) setFullWidthTimelineButtonHeader(baseDir, True)
else:
setFullWidthTimelineButtonHeader(baseDir, False)
continue continue
elif paramName == 'icons-as-buttons': elif paramName == 'icons-as-buttons':
setIconsAsButtons(baseDir, paramValue.lower() == 'true') if paramValue.lower() == 'true':
setIconsAsButtons(baseDir, True)
else:
setIconsAsButtons(baseDir, False)
continue continue
elif paramName == 'rss-icon-at-top': elif paramName == 'rss-icon-at-top':
setRssIconAtTop(baseDir, paramValue.lower() == 'true') if paramValue.lower() == 'true':
setRssIconAtTop(baseDir, True)
else:
setRssIconAtTop(baseDir, False)
continue continue
elif paramName == 'publish-button-at-top': elif paramName == 'publish-button-at-top':
setPublishButtonAtTop(baseDir, if paramValue.lower() == 'true':
paramValue.lower() == 'true') setPublishButtonAtTop(baseDir, True)
else:
setPublishButtonAtTop(baseDir, False)
continue continue
css = setCSSparam(css, paramName, paramValue) css = setCSSparam(css, paramName, paramValue)
filename = baseDir + '/' + filename filename = baseDir + '/' + filename