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)
|
setThemeFromDict(baseDir, 'light', themeParams)
|
||||||
|
|
||||||
|
|
||||||
def setTheme(baseDir: str, name: str) -> bool:
|
def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
result = False
|
"""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':
|
if themeNameLower == 'default':
|
||||||
profileImageFilename = \
|
profileImageFilename = \
|
||||||
baseDir + '/img/image.png'
|
baseDir + '/img/image.png'
|
||||||
|
@ -380,6 +372,23 @@ def setTheme(baseDir: str, name: str) -> bool:
|
||||||
accountDir + '/banner.png')
|
accountDir + '/banner.png')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
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
|
result = True
|
||||||
|
|
||||||
if not result:
|
if not result:
|
||||||
|
|
Loading…
Reference in New Issue