mirror of https://gitlab.com/bashrc2/epicyon
Simplify
parent
96f993d026
commit
32cfdf6f38
|
@ -6092,15 +6092,16 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
|
||||||
return htmlStr
|
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')
|
bannerExtensions = ('png', 'jpg', 'jpeg', 'gif', 'avif', 'webp')
|
||||||
bannerFile = ''
|
bannerFile = ''
|
||||||
bannerFilename = ''
|
bannerFilename = ''
|
||||||
for ext in bannerExtensions:
|
for ext in bannerExtensions:
|
||||||
bannerFile = 'banner.' + ext
|
bannerFile = name + '.' + ext
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
if os.path.isfile(bannerFilename):
|
if os.path.isfile(bannerFilename):
|
||||||
|
@ -6108,21 +6109,14 @@ def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
|
||||||
return bannerFile, bannerFilename
|
return bannerFile, bannerFilename
|
||||||
|
|
||||||
|
|
||||||
|
def getBannerFile(baseDir: str,
|
||||||
|
nickname: str, domain: str) -> (str, str):
|
||||||
|
return getImageFile(baseDir, 'banner', nickname, domain)
|
||||||
|
|
||||||
|
|
||||||
def getSearchBannerFile(baseDir: str,
|
def getSearchBannerFile(baseDir: str,
|
||||||
nickname: str, domain: str) -> (str, str):
|
nickname: str, domain: str) -> (str, str):
|
||||||
"""
|
return getImageFile(baseDir, 'search_banner', nickname, domain)
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
def headerButtonsFrontScreen(translate: {},
|
def headerButtonsFrontScreen(translate: {},
|
||||||
|
|
Loading…
Reference in New Issue