merge-requests/8/head
Bob Mottram 2020-11-03 10:42:07 +00:00
parent 96f993d026
commit 32cfdf6f38
1 changed files with 10 additions and 16 deletions

View File

@ -6092,15 +6092,16 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
return htmlStr
def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
def getImageFile(baseDir: str, name: str,
nickname: str, domain: str) -> (str, str):
"""
returns the banner filename
returns the filenames for an image with the given name
"""
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
bannerFile = ''
bannerFilename = ''
for ext in bannerExtensions:
bannerFile = 'banner.' + ext
bannerFile = name + '.' + ext
bannerFilename = baseDir + '/accounts/' + \
nickname + '@' + domain + '/' + bannerFile
if os.path.isfile(bannerFilename):
@ -6108,21 +6109,14 @@ def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
return bannerFile, bannerFilename
def getBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
return getImageFile(baseDir, 'banner', nickname, domain)
def getSearchBannerFile(baseDir: str,
nickname: str, domain: str) -> (str, str):
"""
returns the search banner filename
"""
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
bannerFile = ''
bannerFilename = ''
for ext in bannerExtensions:
bannerFile = 'search_banner.' + ext
bannerFilename = baseDir + '/accounts/' + \
nickname + '@' + domain + '/' + bannerFile
if os.path.isfile(bannerFilename):
break
return bannerFile, bannerFilename
return getImageFile(baseDir, 'search_banner', nickname, domain)
def headerButtonsFrontScreen(translate: {},