diff --git a/newswire.py b/newswire.py index c9eb463fb..572d0fe64 100644 --- a/newswire.py +++ b/newswire.py @@ -19,7 +19,7 @@ from collections import OrderedDict from utils import valid_post_date from categories import setHashtagCategory from utils import dangerousSVG -from utils import getFavFilenameFromUrl +from utils import get_fav_filename_from_url from utils import get_base_content_from_post from utils import has_object_dict from utils import firstParagraphFromString @@ -184,7 +184,7 @@ def _downloadNewswireFeedFavicon(session, base_dir: str, return False # save to the cache - favFilename = getFavFilenameFromUrl(base_dir, favUrl) + favFilename = get_fav_filename_from_url(base_dir, favUrl) if os.path.isfile(favFilename): return True try: diff --git a/utils.py b/utils.py index 4b68654e8..a4a4c8f02 100644 --- a/utils.py +++ b/utils.py @@ -3238,7 +3238,7 @@ def getNewPostEndpoints() -> []: ) -def getFavFilenameFromUrl(base_dir: str, faviconUrl: str) -> str: +def get_fav_filename_from_url(base_dir: str, faviconUrl: str) -> str: """Returns the cached filename for a favicon based upon its url """ if '://' in faviconUrl: diff --git a/webapp_column_right.py b/webapp_column_right.py index 6f31bc246..49879b982 100644 --- a/webapp_column_right.py +++ b/webapp_column_right.py @@ -11,7 +11,7 @@ import os from datetime import datetime from content import removeLongWords from content import limitRepeatedWords -from utils import getFavFilenameFromUrl +from utils import get_fav_filename_from_url from utils import get_base_content_from_post from utils import removeHtml from utils import locatePost @@ -243,7 +243,8 @@ def _htmlNewswire(base_dir: str, newswire: {}, nickname: str, moderator: bool, faviconUrl = getNewswireFaviconUrl(url) faviconLink = '' if faviconUrl: - cachedFaviconFilename = getFavFilenameFromUrl(base_dir, faviconUrl) + cachedFaviconFilename = \ + get_fav_filename_from_url(base_dir, faviconUrl) if os.path.isfile(cachedFaviconFilename): faviconUrl = \ cachedFaviconFilename.replace(base_dir, '') @@ -251,7 +252,7 @@ def _htmlNewswire(base_dir: str, newswire: {}, nickname: str, moderator: bool, extensions = ('png', 'jpg', 'gif', 'avif', 'svg', 'webp') for ext in extensions: cachedFaviconFilename = \ - getFavFilenameFromUrl(base_dir, faviconUrl) + get_fav_filename_from_url(base_dir, faviconUrl) cachedFaviconFilename = \ cachedFaviconFilename.replace('.ico', '.' + ext) if os.path.isfile(cachedFaviconFilename):