Move banners to theme directories
12
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')
|
||||
|
|
38
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
|
||||
|
||||
|
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 449 KiB |
Before Width: | Height: | Size: 200 KiB After Width: | Height: | Size: 200 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 147 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 284 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 197 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 315 KiB |
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 315 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 239 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 210 KiB |
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 162 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 219 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 411 KiB After Width: | Height: | Size: 411 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 307 KiB After Width: | Height: | Size: 307 KiB |
Before Width: | Height: | Size: 489 KiB After Width: | Height: | Size: 489 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 307 KiB After Width: | Height: | Size: 307 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 494 KiB After Width: | Height: | Size: 494 KiB |