From a9e19a2a2e3bc913d11f8899db55f73e3cd38cff Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Nov 2020 19:21:11 +0000 Subject: [PATCH] Passing booleans to functions --- theme.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/theme.py b/theme.py index 1d85f533..8492060a 100644 --- a/theme.py +++ b/theme.py @@ -198,22 +198,34 @@ def setThemeFromDict(baseDir: str, name: str, css = cssfile.read() for paramName, paramValue in themeParams.items(): if paramName == 'newswire-publish-icon': - setNewswirePublishAsIcon(baseDir, - paramValue.lower() == 'true') + if paramValue.lower() == 'true': + setNewswirePublishAsIcon(baseDir, True) + else: + setNewswirePublishAsIcon(baseDir, False) continue elif paramName == 'full-width-timeline-buttons': - paramBool = paramValue.lower() == 'true' - setFullWidthTimelineButtonHeader(baseDir, paramBool) + if paramValue.lower() == 'true': + setFullWidthTimelineButtonHeader(baseDir, True) + else: + setFullWidthTimelineButtonHeader(baseDir, False) continue elif paramName == 'icons-as-buttons': - setIconsAsButtons(baseDir, paramValue.lower() == 'true') + if paramValue.lower() == 'true': + setIconsAsButtons(baseDir, True) + else: + setIconsAsButtons(baseDir, False) continue elif paramName == 'rss-icon-at-top': - setRssIconAtTop(baseDir, paramValue.lower() == 'true') + if paramValue.lower() == 'true': + setRssIconAtTop(baseDir, True) + else: + setRssIconAtTop(baseDir, False) continue elif paramName == 'publish-button-at-top': - setPublishButtonAtTop(baseDir, - paramValue.lower() == 'true') + if paramValue.lower() == 'true': + setPublishButtonAtTop(baseDir, True) + else: + setPublishButtonAtTop(baseDir, False) continue css = setCSSparam(css, paramName, paramValue) filename = baseDir + '/' + filename