forked from indymedia/epicyon
Copy themed search banners
parent
2f0a96de5e
commit
82b0494ad0
16
theme.py
16
theme.py
|
@ -511,11 +511,15 @@ def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
baseDir + '/img/image.png'
|
baseDir + '/img/image.png'
|
||||||
bannerFilename = \
|
bannerFilename = \
|
||||||
baseDir + '/img/banner.png'
|
baseDir + '/img/banner.png'
|
||||||
|
searchBannerFilename = \
|
||||||
|
baseDir + '/img/search_banner.png'
|
||||||
else:
|
else:
|
||||||
profileImageFilename = \
|
profileImageFilename = \
|
||||||
baseDir + '/img/image_' + themeNameLower + '.png'
|
baseDir + '/img/image_' + themeNameLower + '.png'
|
||||||
bannerFilename = \
|
bannerFilename = \
|
||||||
baseDir + '/img/banner_' + themeNameLower + '.png'
|
baseDir + '/img/banner_' + themeNameLower + '.png'
|
||||||
|
searchBannerFilename = \
|
||||||
|
baseDir + '/img/search_banner_' + themeNameLower + '.png'
|
||||||
if os.path.isfile(profileImageFilename) and \
|
if os.path.isfile(profileImageFilename) and \
|
||||||
os.path.isfile(bannerFilename):
|
os.path.isfile(bannerFilename):
|
||||||
for subdir, dirs, files in os.walk(baseDir +
|
for subdir, dirs, files in os.walk(baseDir +
|
||||||
|
@ -527,14 +531,26 @@ def setThemeImages(baseDir: str, name: str) -> None:
|
||||||
continue
|
continue
|
||||||
accountDir = \
|
accountDir = \
|
||||||
os.path.join(baseDir + '/accounts', acct)
|
os.path.join(baseDir + '/accounts', acct)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
copyfile(profileImageFilename,
|
copyfile(profileImageFilename,
|
||||||
accountDir + '/image.png')
|
accountDir + '/image.png')
|
||||||
|
except BaseException:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
copyfile(bannerFilename,
|
copyfile(bannerFilename,
|
||||||
accountDir + '/banner.png')
|
accountDir + '/banner.png')
|
||||||
except BaseException:
|
except BaseException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
if os.path.isfile(searchBannerFilename):
|
||||||
|
copyfile(searchBannerFilename,
|
||||||
|
accountDir + '/search_banner.png')
|
||||||
|
except BaseException:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def setTheme(baseDir: str, name: str) -> bool:
|
def setTheme(baseDir: str, name: str) -> bool:
|
||||||
result = False
|
result = False
|
||||||
|
|
Loading…
Reference in New Issue