Snake case

main
Bob Mottram 2021-12-27 15:56:15 +00:00
parent 682a6755e0
commit e9a569b44f
3 changed files with 10 additions and 10 deletions

View File

@ -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'] + '...'

View File

@ -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()

View File

@ -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 += \