Copy themed search banners

main
Bob Mottram 2020-06-10 16:09:14 +01:00
parent 2f0a96de5e
commit 82b0494ad0
1 changed files with 16 additions and 0 deletions

View File

@ -511,11 +511,15 @@ def setThemeImages(baseDir: str, name: str) -> None:
baseDir + '/img/image.png'
bannerFilename = \
baseDir + '/img/banner.png'
searchBannerFilename = \
baseDir + '/img/search_banner.png'
else:
profileImageFilename = \
baseDir + '/img/image_' + themeNameLower + '.png'
bannerFilename = \
baseDir + '/img/banner_' + themeNameLower + '.png'
searchBannerFilename = \
baseDir + '/img/search_banner_' + themeNameLower + '.png'
if os.path.isfile(profileImageFilename) and \
os.path.isfile(bannerFilename):
for subdir, dirs, files in os.walk(baseDir +
@ -527,14 +531,26 @@ def setThemeImages(baseDir: str, name: str) -> None:
continue
accountDir = \
os.path.join(baseDir + '/accounts', acct)
try:
copyfile(profileImageFilename,
accountDir + '/image.png')
except BaseException:
pass
try:
copyfile(bannerFilename,
accountDir + '/banner.png')
except BaseException:
pass
try:
if os.path.isfile(searchBannerFilename):
copyfile(searchBannerFilename,
accountDir + '/search_banner.png')
except BaseException:
pass
def setTheme(baseDir: str, name: str) -> bool:
result = False