Snake case

main
Bob Mottram 2021-12-26 10:22:19 +00:00
parent 963ed4aa1f
commit 3d9559bf27
5 changed files with 10 additions and 10 deletions

View File

@ -18,7 +18,7 @@ from webapp_utils import getPostAttachmentsAsHtml
from webapp_utils import editTextArea
from webapp_media import addEmbeddedElements
from utils import local_actor_url
from utils import getActorLanguagesList
from utils import get_actor_languages_list
from utils import getBaseContentFromPost
from utils import getContentFromPost
from utils import isAccountDir
@ -270,7 +270,7 @@ def _htmlBlogPostContent(debug: bool, session, authorized: bool,
getPersonFromCache(base_dir, personUrl, person_cache, False)
languagesUnderstood = []
if actorJson:
languagesUnderstood = getActorLanguagesList(actorJson)
languagesUnderstood = get_actor_languages_list(actorJson)
jsonContent = getContentFromPost(post_json_object, system_language,
languagesUnderstood)
if jsonContent:

View File

@ -10,7 +10,7 @@ __module_group__ = "Core"
import os
import json
from urllib import request, parse
from utils import getActorLanguagesList
from utils import get_actor_languages_list
from utils import removeHtml
from utils import hasObjectDict
from utils import getConfigParam
@ -21,7 +21,7 @@ from cache import getPersonFromCache
def getActorLanguages(actorJson: {}) -> str:
"""Returns a string containing languages used by the given actor
"""
langList = getActorLanguagesList(actorJson)
langList = get_actor_languages_list(actorJson)
if not langList:
return ''
languagesStr = ''
@ -110,7 +110,7 @@ def understoodPostLanguage(base_dir: str, nickname: str, domain: str,
if not actorJson:
print('WARN: unable to load actor to check languages ' + personUrl)
return False
languagesUnderstood = getActorLanguagesList(actorJson)
languagesUnderstood = get_actor_languages_list(actorJson)
if not languagesUnderstood:
return True
for lang in languagesUnderstood:

View File

@ -58,7 +58,7 @@ from utils import getSHA256
from utils import dangerousSVG
from utils import canReplyTo
from utils import isGroupAccount
from utils import getActorLanguagesList
from utils import get_actor_languages_list
from utils import getCategoryTypes
from utils import getSupportedLanguages
from utils import setConfigParam
@ -5595,7 +5595,7 @@ def _testSetActorLanguages():
assert actorJson['attachment'][0]['type'] == 'PropertyValue'
assert isinstance(actorJson['attachment'][0]['value'], str)
assert ',' in actorJson['attachment'][0]['value']
langList = getActorLanguagesList(actorJson)
langList = get_actor_languages_list(actorJson)
assert 'en' in langList
assert 'fr' in langList
assert 'es' in langList

View File

@ -34,7 +34,7 @@ def local_actor_url(http_prefix: str, nickname: str, domain_full: str) -> str:
return http_prefix + '://' + domain_full + '/users/' + nickname
def getActorLanguagesList(actorJson: {}) -> []:
def get_actor_languages_list(actorJson: {}) -> []:
"""Returns a list containing languages used by the given actor
"""
if not actorJson.get('attachment'):

View File

@ -25,7 +25,7 @@ from posts import downloadAnnounce
from posts import populateRepliesJson
from utils import removeHashFromPostId
from utils import removeHtml
from utils import getActorLanguagesList
from utils import get_actor_languages_list
from utils import getBaseContentFromPost
from utils import getContentFromPost
from utils import hasObjectDict
@ -1854,7 +1854,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
getPersonFromCache(base_dir, personUrl, person_cache, False)
languagesUnderstood = []
if actorJson:
languagesUnderstood = getActorLanguagesList(actorJson)
languagesUnderstood = get_actor_languages_list(actorJson)
contentStr = getContentFromPost(post_json_object, system_language,
languagesUnderstood)
if not contentStr: