forked from indymedia/epicyon
Tidying
parent
ce5d235131
commit
69d3521647
35
theme.py
35
theme.py
|
@ -338,20 +338,12 @@ def setThemeLight(baseDir: str):
|
|||
setThemeFromDict(baseDir, 'light', themeParams)
|
||||
|
||||
|
||||
def setTheme(baseDir: str, name: str) -> bool:
|
||||
result = False
|
||||
def setThemeImages(baseDir: str, name: str) -> None:
|
||||
"""Changes the profile background image
|
||||
and banner to the defaults
|
||||
"""
|
||||
themeNameLower = name.lower()
|
||||
|
||||
prevThemeName = getTheme(baseDir)
|
||||
|
||||
themes = getThemesList()
|
||||
for themeName in themes:
|
||||
themeNameLower = themeName.lower()
|
||||
if name == themeNameLower:
|
||||
globals()['setTheme' + themeName](baseDir)
|
||||
if prevThemeName:
|
||||
if prevThemeName.lower() != themeNameLower:
|
||||
# change the banner and profile image
|
||||
# to the default for the theme
|
||||
if themeNameLower == 'default':
|
||||
profileImageFilename = \
|
||||
baseDir + '/img/image.png'
|
||||
|
@ -380,6 +372,23 @@ def setTheme(baseDir: str, name: str) -> bool:
|
|||
accountDir + '/banner.png')
|
||||
except BaseException:
|
||||
pass
|
||||
|
||||
|
||||
def setTheme(baseDir: str, name: str) -> bool:
|
||||
result = False
|
||||
|
||||
prevThemeName = getTheme(baseDir)
|
||||
|
||||
themes = getThemesList()
|
||||
for themeName in themes:
|
||||
themeNameLower = themeName.lower()
|
||||
if name == themeNameLower:
|
||||
globals()['setTheme' + themeName](baseDir)
|
||||
if prevThemeName:
|
||||
if prevThemeName.lower() != themeNameLower:
|
||||
# change the banner and profile image
|
||||
# to the default for the theme
|
||||
setThemeImages(baseDir, name)
|
||||
result = True
|
||||
|
||||
if not result:
|
||||
|
|
Loading…
Reference in New Issue