From 3d9559bf27e18f72e4f5d14dbc790d1ed1ff0865 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 26 Dec 2021 10:22:19 +0000 Subject: [PATCH] Snake case --- blog.py | 4 ++-- languages.py | 6 +++--- tests.py | 4 ++-- utils.py | 2 +- webapp_post.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blog.py b/blog.py index ffaca2742..a97f0d72d 100644 --- a/blog.py +++ b/blog.py @@ -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: diff --git a/languages.py b/languages.py index 4acf50411..bdde434a7 100644 --- a/languages.py +++ b/languages.py @@ -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: diff --git a/tests.py b/tests.py index 1a47ee55b..3f4d82cd8 100644 --- a/tests.py +++ b/tests.py @@ -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 diff --git a/utils.py b/utils.py index ad4a7470a..9a5945ad7 100644 --- a/utils.py +++ b/utils.py @@ -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'): diff --git a/webapp_post.py b/webapp_post.py index 990aa5d1c..28f9abcd2 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -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: