From 03df6dffae8e2f3cc9c8003f5f5bbc014795b3bd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 14 Nov 2020 12:44:24 +0000 Subject: [PATCH] Move banners to theme directories --- person.py | 12 +++--- theme.py | 38 +++++++++--------- img/banner_blue.png => theme/blue/banner.png | Bin img/image_blue.png => theme/blue/image.png | Bin .../blue/search_banner.png | Bin {img => theme/default}/banner.png | Bin {img => theme/default}/image.png | Bin {img => theme/default}/search_banner.png | Bin .../hacker/banner.png | Bin .../hacker/image.png | Bin .../hacker/search_banner.png | Bin .../henge/banner.png | Bin img/image_henge.png => theme/henge/image.png | Bin .../henge/left_col_image.png | Bin .../henge/login_background.jpg | Bin .../henge/options_background.jpg | Bin .../henge/right_col_image.png | Bin .../henge/search_banner.png | Bin .../indymediaclassic/banner.png | Bin .../indymediaclassic/image.png | Bin .../indymediaclassic/left_col_image.png | Bin .../indymediaclassic/login_background.jpg | Bin .../indymediaclassic/options_background.jpg | Bin .../indymediaclassic/right_col_image.png | Bin .../indymediaclassic/search_banner.png | Bin .../indymediamodern/banner.png | Bin .../indymediamodern/image.png | Bin .../indymediamodern/search_banner.png | Bin img/banner_lcd.png => theme/lcd/banner.png | Bin img/image_lcd.png => theme/lcd/image.png | Bin .../lcd/search_banner.png | Bin .../light/banner.png | Bin img/image_light.png => theme/light/image.png | Bin .../light/right_col_image.png | Bin .../light/search_banner.png | Bin .../night/banner.png | Bin img/image_night.png => theme/night/image.png | Bin .../night/left_col_image.png | Bin .../night/login_background.jpg | Bin .../night/options_background.jpg | Bin .../night/right_col_image.png | Bin .../night/search_banner.png | Bin .../purple/banner.png | Bin .../purple/image.png | Bin .../purple/login_background.jpg | Bin .../purple/options_background.jpg | Bin .../purple/right_col_image.png | Bin .../purple/search_banner.png | Bin .../solidaric/banner.png | Bin .../solidaric/image.png | Bin .../solidaric/left_col_image.png | Bin .../solidaric/login_background.jpg | Bin .../solidaric/options_background.jpg | Bin .../solidaric/right_col_image.png | Bin .../solidaric/search_banner.png | Bin .../starlight/banner.png | Bin .../starlight/follow_background.jpg | Bin .../starlight/image.png | Bin .../starlight/left_col_image.png | Bin .../starlight/login_background.jpg | Bin .../starlight/options_background.jpg | Bin .../starlight/right_col_image.png | Bin .../starlight/search_background.jpg | Bin .../starlight/search_banner.png | Bin img/banner_zen.png => theme/zen/banner.png | Bin img/image_zen.png => theme/zen/image.png | Bin .../zen/left_col_image.png | Bin .../zen/login_background.jpg | Bin .../zen/options_background.jpg | Bin .../zen/right_col_image.png | Bin .../zen/search_banner.png | Bin 71 files changed, 24 insertions(+), 26 deletions(-) rename img/banner_blue.png => theme/blue/banner.png (100%) rename img/image_blue.png => theme/blue/image.png (100%) rename img/search_banner_blue.png => theme/blue/search_banner.png (100%) rename {img => theme/default}/banner.png (100%) rename {img => theme/default}/image.png (100%) rename {img => theme/default}/search_banner.png (100%) rename img/banner_hacker.png => theme/hacker/banner.png (100%) rename img/image_hacker.png => theme/hacker/image.png (100%) rename img/search_banner_hacker.png => theme/hacker/search_banner.png (100%) rename img/banner_henge.png => theme/henge/banner.png (100%) rename img/image_henge.png => theme/henge/image.png (100%) rename img/left_col_image_henge.png => theme/henge/left_col_image.png (100%) rename img/login_background_henge.jpg => theme/henge/login_background.jpg (100%) rename img/options_background_henge.jpg => theme/henge/options_background.jpg (100%) rename img/right_col_image_henge.png => theme/henge/right_col_image.png (100%) rename img/search_banner_henge.png => theme/henge/search_banner.png (100%) rename img/banner_indymediaclassic.png => theme/indymediaclassic/banner.png (100%) rename img/image_indymediaclassic.png => theme/indymediaclassic/image.png (100%) rename img/left_col_image_indymediaclassic.png => theme/indymediaclassic/left_col_image.png (100%) rename img/login_background_indymediaclassic.jpg => theme/indymediaclassic/login_background.jpg (100%) rename img/options_background_indymediaclassic.jpg => theme/indymediaclassic/options_background.jpg (100%) rename img/right_col_image_indymediaclassic.png => theme/indymediaclassic/right_col_image.png (100%) rename img/search_banner_indymediaclassic.png => theme/indymediaclassic/search_banner.png (100%) rename img/banner_indymediamodern.png => theme/indymediamodern/banner.png (100%) rename img/image_indymediamodern.png => theme/indymediamodern/image.png (100%) rename img/search_banner_indymediamodern.png => theme/indymediamodern/search_banner.png (100%) rename img/banner_lcd.png => theme/lcd/banner.png (100%) rename img/image_lcd.png => theme/lcd/image.png (100%) rename img/search_banner_lcd.png => theme/lcd/search_banner.png (100%) rename img/banner_light.png => theme/light/banner.png (100%) rename img/image_light.png => theme/light/image.png (100%) rename img/right_col_image_light.png => theme/light/right_col_image.png (100%) rename img/search_banner_light.png => theme/light/search_banner.png (100%) rename img/banner_night.png => theme/night/banner.png (100%) rename img/image_night.png => theme/night/image.png (100%) rename img/left_col_image_night.png => theme/night/left_col_image.png (100%) rename img/login_background_night.jpg => theme/night/login_background.jpg (100%) rename img/options_background_night.jpg => theme/night/options_background.jpg (100%) rename img/right_col_image_night.png => theme/night/right_col_image.png (100%) rename img/search_banner_night.png => theme/night/search_banner.png (100%) rename img/banner_purple.png => theme/purple/banner.png (100%) rename img/image_purple.png => theme/purple/image.png (100%) rename img/login_background_purple.jpg => theme/purple/login_background.jpg (100%) rename img/options_background_purple.jpg => theme/purple/options_background.jpg (100%) rename img/right_col_image_purple.png => theme/purple/right_col_image.png (100%) rename img/search_banner_purple.png => theme/purple/search_banner.png (100%) rename img/banner_solidaric.png => theme/solidaric/banner.png (100%) rename img/image_solidaric.png => theme/solidaric/image.png (100%) rename img/left_col_image_solidaric.png => theme/solidaric/left_col_image.png (100%) rename img/login_background_solidaric.jpg => theme/solidaric/login_background.jpg (100%) rename img/options_background_solidaric.jpg => theme/solidaric/options_background.jpg (100%) rename img/right_col_image_solidaric.png => theme/solidaric/right_col_image.png (100%) rename img/search_banner_solidaric.png => theme/solidaric/search_banner.png (100%) rename img/banner_starlight.png => theme/starlight/banner.png (100%) rename img/follow_background_starlight.jpg => theme/starlight/follow_background.jpg (100%) rename img/image_starlight.png => theme/starlight/image.png (100%) rename img/left_col_image_starlight.png => theme/starlight/left_col_image.png (100%) rename img/login_background_starlight.jpg => theme/starlight/login_background.jpg (100%) rename img/options_background_starlight.jpg => theme/starlight/options_background.jpg (100%) rename img/right_col_image_starlight.png => theme/starlight/right_col_image.png (100%) rename img/search_background_starlight.jpg => theme/starlight/search_background.jpg (100%) rename img/search_banner_starlight.png => theme/starlight/search_banner.png (100%) rename img/banner_zen.png => theme/zen/banner.png (100%) rename img/image_zen.png => theme/zen/image.png (100%) rename img/left_col_image_zen.png => theme/zen/left_col_image.png (100%) rename img/login_background_zen.jpg => theme/zen/login_background.jpg (100%) rename img/options_background_zen.jpg => theme/zen/options_background.jpg (100%) rename img/right_col_image_zen.png => theme/zen/right_col_image.png (100%) rename img/search_banner_zen.png => theme/zen/search_banner.png (100%) diff --git a/person.py b/person.py index c0b624f6c..76ced36c7 100644 --- a/person.py +++ b/person.py @@ -485,17 +485,17 @@ def createPerson(baseDir: str, nickname: str, domain: str, port: int, theme = getConfigParam(baseDir, 'theme') if not theme: theme = 'default' - defaultProfileImageFilename = baseDir + '/img/image.png' + defaultProfileImageFilename = baseDir + '/theme/default/image.png' if theme: - if os.path.isfile(baseDir + '/img/image_' + theme + '.png'): - defaultBannerFilename = baseDir + '/img/image_' + theme + '.png' + if os.path.isfile(baseDir + '/theme/' + theme + '/image.png'): + defaultBannerFilename = baseDir + '/theme/' + theme + '/image.png' if os.path.isfile(defaultProfileImageFilename): copyfile(defaultProfileImageFilename, baseDir + '/accounts/' + nickname + '@' + domain + '/image.png') - defaultBannerFilename = baseDir + '/img/banner.png' + defaultBannerFilename = baseDir + '/theme/default/banner.png' if theme: - if os.path.isfile(baseDir + '/img/banner_' + theme + '.png'): - defaultBannerFilename = baseDir + '/img/banner_' + theme + '.png' + if os.path.isfile(baseDir + '/theme/' + theme + '/banner.png'): + defaultBannerFilename = baseDir + '/theme/' + theme + '/banner.png' if os.path.isfile(defaultBannerFilename): copyfile(defaultBannerFilename, baseDir + '/accounts/' + nickname + '@' + domain + '/banner.png') diff --git a/theme.py b/theme.py index 548b3e56f..044c19b46 100644 --- a/theme.py +++ b/theme.py @@ -1248,26 +1248,26 @@ def setThemeImages(baseDir: str, name: str) -> None: if themeNameLower == 'default': profileImageFilename = \ - baseDir + '/img/image.png' + baseDir + '/theme/default/image.png' bannerFilename = \ - baseDir + '/img/banner.png' + baseDir + '/theme/default/banner.png' searchBannerFilename = \ - baseDir + '/img/search_banner.png' + baseDir + '/theme/default/search_banner.png' leftColImageFilename = \ - baseDir + '/img/left_col_image.png' + baseDir + '/theme/default/left_col_image.png' rightColImageFilename = \ - baseDir + '/img/right_col_image.png' + baseDir + '/theme/default/right_col_image.png' else: profileImageFilename = \ - baseDir + '/img/image_' + themeNameLower + '.png' + baseDir + '/theme/' + themeNameLower + '/image.png' bannerFilename = \ - baseDir + '/img/banner_' + themeNameLower + '.png' + baseDir + '/theme/' + themeNameLower + '/banner.png' searchBannerFilename = \ - baseDir + '/img/search_banner_' + themeNameLower + '.png' + baseDir + '/theme/' + themeNameLower + '/search_banner.png' leftColImageFilename = \ - baseDir + '/img/left_col_image_' + themeNameLower + '.png' + baseDir + '/theme/' + themeNameLower + '/left_col_image.png' rightColImageFilename = \ - baseDir + '/img/right_col_image_' + themeNameLower + '.png' + baseDir + '/theme/' + themeNameLower + '/right_col_image.png' backgroundNames = ('login', 'shares', 'delete', 'follow', 'options', 'block', 'search', 'calendar') @@ -1286,30 +1286,28 @@ def setThemeImages(baseDir: str, name: str) -> None: for ext in extensions: if themeNameLower == 'default': backgroundImageFilename = \ - baseDir + '/img/' + backgroundType + \ - '-background.' + ext + baseDir + '/theme/default/' + \ + backgroundType + '_background.' + ext else: backgroundImageFilename = \ - baseDir + '/img/' + backgroundType + \ - '_background_' + themeNameLower + '.' + ext + baseDir + '/theme/' + themeNameLower + '/' + \ + backgroundType + '_background' + '.' + ext if os.path.isfile(backgroundImageFilename): try: copyfile(backgroundImageFilename, - baseDir + '/accounts/' + backgroundType + - '-background.' + ext) + baseDir + '/accounts/' + + backgroundType + '-background.' + ext) continue except BaseException: pass # background image was not found # so remove any existing file if os.path.isfile(baseDir + '/accounts/' + - backgroundType + - '-background.' + ext): + backgroundType + '-background.' + ext): try: os.remove(baseDir + '/accounts/' + - backgroundType + - '-background.' + ext) + backgroundType + '-background.' + ext) except BaseException: pass diff --git a/img/banner_blue.png b/theme/blue/banner.png similarity index 100% rename from img/banner_blue.png rename to theme/blue/banner.png diff --git a/img/image_blue.png b/theme/blue/image.png similarity index 100% rename from img/image_blue.png rename to theme/blue/image.png diff --git a/img/search_banner_blue.png b/theme/blue/search_banner.png similarity index 100% rename from img/search_banner_blue.png rename to theme/blue/search_banner.png diff --git a/img/banner.png b/theme/default/banner.png similarity index 100% rename from img/banner.png rename to theme/default/banner.png diff --git a/img/image.png b/theme/default/image.png similarity index 100% rename from img/image.png rename to theme/default/image.png diff --git a/img/search_banner.png b/theme/default/search_banner.png similarity index 100% rename from img/search_banner.png rename to theme/default/search_banner.png diff --git a/img/banner_hacker.png b/theme/hacker/banner.png similarity index 100% rename from img/banner_hacker.png rename to theme/hacker/banner.png diff --git a/img/image_hacker.png b/theme/hacker/image.png similarity index 100% rename from img/image_hacker.png rename to theme/hacker/image.png diff --git a/img/search_banner_hacker.png b/theme/hacker/search_banner.png similarity index 100% rename from img/search_banner_hacker.png rename to theme/hacker/search_banner.png diff --git a/img/banner_henge.png b/theme/henge/banner.png similarity index 100% rename from img/banner_henge.png rename to theme/henge/banner.png diff --git a/img/image_henge.png b/theme/henge/image.png similarity index 100% rename from img/image_henge.png rename to theme/henge/image.png diff --git a/img/left_col_image_henge.png b/theme/henge/left_col_image.png similarity index 100% rename from img/left_col_image_henge.png rename to theme/henge/left_col_image.png diff --git a/img/login_background_henge.jpg b/theme/henge/login_background.jpg similarity index 100% rename from img/login_background_henge.jpg rename to theme/henge/login_background.jpg diff --git a/img/options_background_henge.jpg b/theme/henge/options_background.jpg similarity index 100% rename from img/options_background_henge.jpg rename to theme/henge/options_background.jpg diff --git a/img/right_col_image_henge.png b/theme/henge/right_col_image.png similarity index 100% rename from img/right_col_image_henge.png rename to theme/henge/right_col_image.png diff --git a/img/search_banner_henge.png b/theme/henge/search_banner.png similarity index 100% rename from img/search_banner_henge.png rename to theme/henge/search_banner.png diff --git a/img/banner_indymediaclassic.png b/theme/indymediaclassic/banner.png similarity index 100% rename from img/banner_indymediaclassic.png rename to theme/indymediaclassic/banner.png diff --git a/img/image_indymediaclassic.png b/theme/indymediaclassic/image.png similarity index 100% rename from img/image_indymediaclassic.png rename to theme/indymediaclassic/image.png diff --git a/img/left_col_image_indymediaclassic.png b/theme/indymediaclassic/left_col_image.png similarity index 100% rename from img/left_col_image_indymediaclassic.png rename to theme/indymediaclassic/left_col_image.png diff --git a/img/login_background_indymediaclassic.jpg b/theme/indymediaclassic/login_background.jpg similarity index 100% rename from img/login_background_indymediaclassic.jpg rename to theme/indymediaclassic/login_background.jpg diff --git a/img/options_background_indymediaclassic.jpg b/theme/indymediaclassic/options_background.jpg similarity index 100% rename from img/options_background_indymediaclassic.jpg rename to theme/indymediaclassic/options_background.jpg diff --git a/img/right_col_image_indymediaclassic.png b/theme/indymediaclassic/right_col_image.png similarity index 100% rename from img/right_col_image_indymediaclassic.png rename to theme/indymediaclassic/right_col_image.png diff --git a/img/search_banner_indymediaclassic.png b/theme/indymediaclassic/search_banner.png similarity index 100% rename from img/search_banner_indymediaclassic.png rename to theme/indymediaclassic/search_banner.png diff --git a/img/banner_indymediamodern.png b/theme/indymediamodern/banner.png similarity index 100% rename from img/banner_indymediamodern.png rename to theme/indymediamodern/banner.png diff --git a/img/image_indymediamodern.png b/theme/indymediamodern/image.png similarity index 100% rename from img/image_indymediamodern.png rename to theme/indymediamodern/image.png diff --git a/img/search_banner_indymediamodern.png b/theme/indymediamodern/search_banner.png similarity index 100% rename from img/search_banner_indymediamodern.png rename to theme/indymediamodern/search_banner.png diff --git a/img/banner_lcd.png b/theme/lcd/banner.png similarity index 100% rename from img/banner_lcd.png rename to theme/lcd/banner.png diff --git a/img/image_lcd.png b/theme/lcd/image.png similarity index 100% rename from img/image_lcd.png rename to theme/lcd/image.png diff --git a/img/search_banner_lcd.png b/theme/lcd/search_banner.png similarity index 100% rename from img/search_banner_lcd.png rename to theme/lcd/search_banner.png diff --git a/img/banner_light.png b/theme/light/banner.png similarity index 100% rename from img/banner_light.png rename to theme/light/banner.png diff --git a/img/image_light.png b/theme/light/image.png similarity index 100% rename from img/image_light.png rename to theme/light/image.png diff --git a/img/right_col_image_light.png b/theme/light/right_col_image.png similarity index 100% rename from img/right_col_image_light.png rename to theme/light/right_col_image.png diff --git a/img/search_banner_light.png b/theme/light/search_banner.png similarity index 100% rename from img/search_banner_light.png rename to theme/light/search_banner.png diff --git a/img/banner_night.png b/theme/night/banner.png similarity index 100% rename from img/banner_night.png rename to theme/night/banner.png diff --git a/img/image_night.png b/theme/night/image.png similarity index 100% rename from img/image_night.png rename to theme/night/image.png diff --git a/img/left_col_image_night.png b/theme/night/left_col_image.png similarity index 100% rename from img/left_col_image_night.png rename to theme/night/left_col_image.png diff --git a/img/login_background_night.jpg b/theme/night/login_background.jpg similarity index 100% rename from img/login_background_night.jpg rename to theme/night/login_background.jpg diff --git a/img/options_background_night.jpg b/theme/night/options_background.jpg similarity index 100% rename from img/options_background_night.jpg rename to theme/night/options_background.jpg diff --git a/img/right_col_image_night.png b/theme/night/right_col_image.png similarity index 100% rename from img/right_col_image_night.png rename to theme/night/right_col_image.png diff --git a/img/search_banner_night.png b/theme/night/search_banner.png similarity index 100% rename from img/search_banner_night.png rename to theme/night/search_banner.png diff --git a/img/banner_purple.png b/theme/purple/banner.png similarity index 100% rename from img/banner_purple.png rename to theme/purple/banner.png diff --git a/img/image_purple.png b/theme/purple/image.png similarity index 100% rename from img/image_purple.png rename to theme/purple/image.png diff --git a/img/login_background_purple.jpg b/theme/purple/login_background.jpg similarity index 100% rename from img/login_background_purple.jpg rename to theme/purple/login_background.jpg diff --git a/img/options_background_purple.jpg b/theme/purple/options_background.jpg similarity index 100% rename from img/options_background_purple.jpg rename to theme/purple/options_background.jpg diff --git a/img/right_col_image_purple.png b/theme/purple/right_col_image.png similarity index 100% rename from img/right_col_image_purple.png rename to theme/purple/right_col_image.png diff --git a/img/search_banner_purple.png b/theme/purple/search_banner.png similarity index 100% rename from img/search_banner_purple.png rename to theme/purple/search_banner.png diff --git a/img/banner_solidaric.png b/theme/solidaric/banner.png similarity index 100% rename from img/banner_solidaric.png rename to theme/solidaric/banner.png diff --git a/img/image_solidaric.png b/theme/solidaric/image.png similarity index 100% rename from img/image_solidaric.png rename to theme/solidaric/image.png diff --git a/img/left_col_image_solidaric.png b/theme/solidaric/left_col_image.png similarity index 100% rename from img/left_col_image_solidaric.png rename to theme/solidaric/left_col_image.png diff --git a/img/login_background_solidaric.jpg b/theme/solidaric/login_background.jpg similarity index 100% rename from img/login_background_solidaric.jpg rename to theme/solidaric/login_background.jpg diff --git a/img/options_background_solidaric.jpg b/theme/solidaric/options_background.jpg similarity index 100% rename from img/options_background_solidaric.jpg rename to theme/solidaric/options_background.jpg diff --git a/img/right_col_image_solidaric.png b/theme/solidaric/right_col_image.png similarity index 100% rename from img/right_col_image_solidaric.png rename to theme/solidaric/right_col_image.png diff --git a/img/search_banner_solidaric.png b/theme/solidaric/search_banner.png similarity index 100% rename from img/search_banner_solidaric.png rename to theme/solidaric/search_banner.png diff --git a/img/banner_starlight.png b/theme/starlight/banner.png similarity index 100% rename from img/banner_starlight.png rename to theme/starlight/banner.png diff --git a/img/follow_background_starlight.jpg b/theme/starlight/follow_background.jpg similarity index 100% rename from img/follow_background_starlight.jpg rename to theme/starlight/follow_background.jpg diff --git a/img/image_starlight.png b/theme/starlight/image.png similarity index 100% rename from img/image_starlight.png rename to theme/starlight/image.png diff --git a/img/left_col_image_starlight.png b/theme/starlight/left_col_image.png similarity index 100% rename from img/left_col_image_starlight.png rename to theme/starlight/left_col_image.png diff --git a/img/login_background_starlight.jpg b/theme/starlight/login_background.jpg similarity index 100% rename from img/login_background_starlight.jpg rename to theme/starlight/login_background.jpg diff --git a/img/options_background_starlight.jpg b/theme/starlight/options_background.jpg similarity index 100% rename from img/options_background_starlight.jpg rename to theme/starlight/options_background.jpg diff --git a/img/right_col_image_starlight.png b/theme/starlight/right_col_image.png similarity index 100% rename from img/right_col_image_starlight.png rename to theme/starlight/right_col_image.png diff --git a/img/search_background_starlight.jpg b/theme/starlight/search_background.jpg similarity index 100% rename from img/search_background_starlight.jpg rename to theme/starlight/search_background.jpg diff --git a/img/search_banner_starlight.png b/theme/starlight/search_banner.png similarity index 100% rename from img/search_banner_starlight.png rename to theme/starlight/search_banner.png diff --git a/img/banner_zen.png b/theme/zen/banner.png similarity index 100% rename from img/banner_zen.png rename to theme/zen/banner.png diff --git a/img/image_zen.png b/theme/zen/image.png similarity index 100% rename from img/image_zen.png rename to theme/zen/image.png diff --git a/img/left_col_image_zen.png b/theme/zen/left_col_image.png similarity index 100% rename from img/left_col_image_zen.png rename to theme/zen/left_col_image.png diff --git a/img/login_background_zen.jpg b/theme/zen/login_background.jpg similarity index 100% rename from img/login_background_zen.jpg rename to theme/zen/login_background.jpg diff --git a/img/options_background_zen.jpg b/theme/zen/options_background.jpg similarity index 100% rename from img/options_background_zen.jpg rename to theme/zen/options_background.jpg diff --git a/img/right_col_image_zen.png b/theme/zen/right_col_image.png similarity index 100% rename from img/right_col_image_zen.png rename to theme/zen/right_col_image.png diff --git a/img/search_banner_zen.png b/theme/zen/search_banner.png similarity index 100% rename from img/search_banner_zen.png rename to theme/zen/search_banner.png