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