mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
682a6755e0
commit
e9a569b44f
4
blog.py
4
blog.py
|
@ -25,7 +25,7 @@ from utils import is_account_dir
|
|||
from utils import remove_html
|
||||
from utils import get_config_param
|
||||
from utils import get_full_domain
|
||||
from utils import getMediaFormats
|
||||
from utils import get_media_formats
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import locate_post
|
||||
|
@ -814,7 +814,7 @@ def htmlEditBlog(media_instance: bool, translate: {},
|
|||
editBlogImageSection += \
|
||||
' <input type="file" id="attachpic" name="attachpic"'
|
||||
editBlogImageSection += \
|
||||
' accept="' + getMediaFormats() + '">'
|
||||
' accept="' + get_media_formats() + '">'
|
||||
editBlogImageSection += ' </div>'
|
||||
|
||||
placeholderMessage = translate['Write something'] + '...'
|
||||
|
|
12
utils.py
12
utils.py
|
@ -426,7 +426,7 @@ def isImageFile(filename: str) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def getMediaFormats() -> str:
|
||||
def get_media_formats() -> str:
|
||||
"""Returns a string of permissable media formats
|
||||
used when selecting an attachment for a new post
|
||||
"""
|
||||
|
@ -459,15 +459,15 @@ def remove_html(content: str) -> str:
|
|||
elif not removing:
|
||||
result += ch
|
||||
|
||||
plainText = result.replace(' ', ' ')
|
||||
plain_text = result.replace(' ', ' ')
|
||||
|
||||
# insert spaces after full stops
|
||||
strLen = len(plainText)
|
||||
strLen = len(plain_text)
|
||||
result = ''
|
||||
for i in range(strLen):
|
||||
result += plainText[i]
|
||||
if plainText[i] == '.' and i < strLen - 1:
|
||||
if plainText[i + 1] >= 'A' and plainText[i + 1] <= 'Z':
|
||||
result += plain_text[i]
|
||||
if plain_text[i] == '.' and i < strLen - 1:
|
||||
if plain_text[i + 1] >= 'A' and plain_text[i + 1] <= 'Z':
|
||||
result += ' '
|
||||
|
||||
result = result.replace(' ', ' ').strip()
|
||||
|
|
|
@ -12,7 +12,7 @@ from utils import get_new_post_endpoints
|
|||
from utils import isPublicPostFromUrl
|
||||
from utils import getNicknameFromActor
|
||||
from utils import getDomainFromActor
|
||||
from utils import getMediaFormats
|
||||
from utils import get_media_formats
|
||||
from utils import get_config_param
|
||||
from utils import acct_dir
|
||||
from utils import get_currencies
|
||||
|
@ -361,7 +361,7 @@ def htmlNewPost(cssCache: {}, media_instance: bool, translate: {},
|
|||
|
||||
newPostImageSection += \
|
||||
' <input type="file" id="attachpic" name="attachpic"'
|
||||
formatsString = getMediaFormats()
|
||||
formatsString = get_media_formats()
|
||||
# remove svg as a permitted format
|
||||
formatsString = formatsString.replace(', .svg', '').replace('.svg, ', '')
|
||||
newPostImageSection += \
|
||||
|
|
Loading…
Reference in New Issue