Background file path

main
Bob Mottram 2020-07-25 15:03:09 +01:00
parent 1b33c20fd5
commit 10b9f2818d
1 changed files with 7 additions and 7 deletions

View File

@ -606,8 +606,10 @@ def setThemeImages(baseDir: str, name: str) -> None:
searchBannerFilename = \ searchBannerFilename = \
baseDir + '/img/search_banner_' + themeNameLower + '.png' baseDir + '/img/search_banner_' + themeNameLower + '.png'
for subdir, dirs, files in os.walk(baseDir + backgroundNames = ('login', 'shares', 'delete', 'follow',
'/accounts'): 'options', 'block', 'search', 'calendar')
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
for acct in dirs: for acct in dirs:
if '@' not in acct: if '@' not in acct:
continue continue
@ -616,8 +618,6 @@ def setThemeImages(baseDir: str, name: str) -> None:
accountDir = \ accountDir = \
os.path.join(baseDir + '/accounts', acct) os.path.join(baseDir + '/accounts', acct)
backgroundNames = ('login', 'shares', 'delete', 'follow',
'options', 'block', 'search', 'calendar')
for backgroundType in backgroundNames: for backgroundType in backgroundNames:
if themeNameLower == 'default': if themeNameLower == 'default':
backgroundImageFilename = \ backgroundImageFilename = \
@ -630,14 +630,14 @@ def setThemeImages(baseDir: str, name: str) -> None:
if os.path.isfile(backgroundImageFilename): if os.path.isfile(backgroundImageFilename):
try: try:
copyfile(backgroundImageFilename, copyfile(backgroundImageFilename,
accountDir + '/' + backgroundType + baseDir + '/accounts/' + backgroundType +
'-background.png') '-background.png')
except BaseException: except BaseException:
pass pass
elif os.path.isfile(accountDir + '/' + backgroundType + elif os.path.isfile(baseDir + '/accounts/' + backgroundType +
'-background.png'): '-background.png'):
try: try:
os.remove(accountDir + '/' + backgroundType + os.remove(baseDir + '/accounts/' + backgroundType +
'-background.png') '-background.png')
except BaseException: except BaseException:
pass pass