mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
a16202afbe
commit
7fd45f1fcd
|
@ -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:
|
||||
|
|
2
utils.py
2
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:
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue