Avoid function name confusion

main
Bob Mottram 2020-12-27 20:39:32 +00:00
parent a2cca64b32
commit 7438d647e1
1 changed files with 4 additions and 4 deletions

View File

@ -187,13 +187,13 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
return htmlStr return htmlStr
def getBrokenFavSubstitute() -> str: def _getBrokenFavSubstitute() -> str:
"""Substitute link used if a favicon is not available """Substitute link used if a favicon is not available
""" """
return " onerror=\"this.onerror=null; this.style='width:0%'; this.src=''\"" return " onerror=\"this.onerror=null; this.style='width:0%'; this.src=''\""
def getFavicon(url: str) -> str: def getNewswireFavicon(url: str) -> str:
"""Returns a favicon url from the given article link """Returns a favicon url from the given article link
""" """
if '://' not in url: if '://' not in url:
@ -232,12 +232,12 @@ def _htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool,
dateStrLink = dateStr.replace('T', ' ') dateStrLink = dateStr.replace('T', ' ')
dateStrLink = dateStrLink.replace('Z', '') dateStrLink = dateStrLink.replace('Z', '')
url = item[1] url = item[1]
faviconUrl = getFavicon(url) faviconUrl = getNewswireFavicon(url)
faviconLink = '' faviconLink = ''
if faviconUrl: if faviconUrl:
faviconLink = \ faviconLink = \
'<img loading="lazy" src="' + faviconUrl + '" ' + \ '<img loading="lazy" src="' + faviconUrl + '" ' + \
getBrokenFavSubstitute() + '/>' _getBrokenFavSubstitute() + '/>'
moderatedItem = item[5] moderatedItem = item[5]
htmlStr += separatorStr htmlStr += separatorStr
if moderatedItem and 'vote:' + nickname in item[2]: if moderatedItem and 'vote:' + nickname in item[2]: