From 82b0494ad0a12e38e143215319c5fdbb9792cb63 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 10 Jun 2020 16:09:14 +0100 Subject: [PATCH] Copy themed search banners --- theme.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/theme.py b/theme.py index 48d649f33..53fc9be09 100644 --- a/theme.py +++ b/theme.py @@ -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