mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
c1034b21d1
commit
5254142511
10
utils.py
10
utils.py
|
@ -372,9 +372,9 @@ def get_image_mime_type(image_filename: str) -> str:
|
|||
'webp': 'webp',
|
||||
'ico': 'x-icon'
|
||||
}
|
||||
for ext, mimeExt in extensionsToMime.items():
|
||||
for ext, mime_ext in extensionsToMime.items():
|
||||
if image_filename.endswith('.' + ext):
|
||||
return 'image/' + mimeExt
|
||||
return 'image/' + mime_ext
|
||||
return 'image/png'
|
||||
|
||||
|
||||
|
@ -403,7 +403,7 @@ def get_media_extensions() -> []:
|
|||
get_video_extensions() + get_audio_extensions()
|
||||
|
||||
|
||||
def getImageFormats() -> str:
|
||||
def get_image_formats() -> str:
|
||||
"""Returns a string of permissable image formats
|
||||
used when selecting an image for a new post
|
||||
"""
|
||||
|
@ -430,10 +430,10 @@ def getMediaFormats() -> str:
|
|||
"""Returns a string of permissable media formats
|
||||
used when selecting an attachment for a new post
|
||||
"""
|
||||
mediaExt = get_media_extensions()
|
||||
media_ext = get_media_extensions()
|
||||
|
||||
mediaFormats = ''
|
||||
for ext in mediaExt:
|
||||
for ext in media_ext:
|
||||
if mediaFormats:
|
||||
mediaFormats += ', '
|
||||
mediaFormats += '.' + ext
|
||||
|
|
|
@ -24,7 +24,7 @@ from utils import isSystemAccount
|
|||
from utils import removeHtml
|
||||
from utils import load_json
|
||||
from utils import get_config_param
|
||||
from utils import getImageFormats
|
||||
from utils import get_image_formats
|
||||
from utils import acct_dir
|
||||
from utils import getSupportedLanguages
|
||||
from utils import local_actor_url
|
||||
|
@ -1307,7 +1307,7 @@ def _htmlEditProfileInstance(base_dir: str, translate: {},
|
|||
news_instanceStr: str) -> (str, str, str, str):
|
||||
"""Edit profile instance settings
|
||||
"""
|
||||
imageFormats = getImageFormats()
|
||||
imageFormats = get_image_formats()
|
||||
|
||||
# Instance details section
|
||||
instanceDescription = \
|
||||
|
@ -1838,7 +1838,7 @@ def _htmlEditProfileBackground(news_instance: bool, translate: {}) -> str:
|
|||
' <label class="labels">' + translate[idx] + '</label><br><br>\n'
|
||||
|
||||
if not news_instance:
|
||||
imageFormats = getImageFormats()
|
||||
imageFormats = get_image_formats()
|
||||
editProfileForm += \
|
||||
' <label class="labels">' + \
|
||||
translate['Background image'] + '</label>\n' + \
|
||||
|
@ -1989,7 +1989,7 @@ def _htmlEditProfileMain(base_dir: str, displayNickname: str, bioStr: str,
|
|||
translate: {}) -> str:
|
||||
"""main info on edit profile screen
|
||||
"""
|
||||
imageFormats = getImageFormats()
|
||||
imageFormats = get_image_formats()
|
||||
|
||||
editProfileForm = ' <div class="container">\n'
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ from utils import removeHtml
|
|||
from utils import load_json
|
||||
from utils import get_config_param
|
||||
from utils import get_image_extensions
|
||||
from utils import getImageFormats
|
||||
from utils import get_image_formats
|
||||
from utils import acct_dir
|
||||
from utils import local_actor_url
|
||||
from webapp_utils import htmlHeaderWithExternalStyle
|
||||
|
@ -78,7 +78,7 @@ def htmlWelcomeProfile(base_dir: str, nickname: str, domain: str,
|
|||
avatarUrl = \
|
||||
local_actor_url(http_prefix, nickname, domain_full) + '/avatar.' + ext
|
||||
|
||||
imageFormats = getImageFormats()
|
||||
imageFormats = get_image_formats()
|
||||
profileForm += '<div class="container">' + profileText + '</div>\n'
|
||||
profileForm += \
|
||||
'<form enctype="multipart/form-data" method="POST" ' + \
|
||||
|
|
Loading…
Reference in New Issue