Snake case

merge-requests/22/merge
Bob Mottram 2021-12-27 21:59:07 +00:00
parent 7de8995310
commit d76a578767
5 changed files with 13 additions and 12 deletions

View File

@ -18,7 +18,7 @@ from utils import camel_case_split
from utils import get_domain_from_actor
from utils import getNicknameFromActor
from utils import getGenderFromBio
from utils import getDisplayName
from utils import get_display_name
from utils import remove_html
from utils import load_json
from utils import save_json
@ -470,7 +470,7 @@ def _postToSpeakerJson(base_dir: str, http_prefix: str,
summary = html.unescape(summary)
speakerName = \
getDisplayName(base_dir, post_json_object['actor'], person_cache)
get_display_name(base_dir, post_json_object['actor'], person_cache)
if not speakerName:
return
speakerName = _removeEmojiFromText(speakerName)

View File

@ -908,7 +908,7 @@ def dangerous_svg(content: str, allow_local_network_access: bool) -> bool:
separators, invalid_strings)
def getDisplayName(base_dir: str, actor: str, person_cache: {}) -> str:
def get_display_name(base_dir: str, actor: str, person_cache: {}) -> str:
"""Returns the display name for the given actor
"""
if '/statuses/' in actor:

View File

@ -10,7 +10,7 @@ __module_group__ = "Calendar"
import os
from datetime import datetime
from datetime import date
from utils import getDisplayName
from utils import get_display_name
from utils import get_config_param
from utils import getNicknameFromActor
from utils import get_domain_from_actor
@ -159,8 +159,8 @@ def _htmlCalendarDay(person_cache: {}, cssCache: {}, translate: {},
if ev.get('sender'):
senderActor = ev['sender']
dispName = \
getDisplayName(base_dir, senderActor,
person_cache)
get_display_name(base_dir, senderActor,
person_cache)
if dispName:
senderName = \
'<a href="' + senderActor + '">' + \

View File

@ -44,7 +44,7 @@ from utils import get_cached_post_filename
from utils import get_protocol_prefixes
from utils import isNewsPost
from utils import isBlogPost
from utils import getDisplayName
from utils import get_display_name
from utils import isPublicPost
from utils import updateRecentPostsCache
from utils import remove_id_ending
@ -997,7 +997,8 @@ def _getPostTitleAnnounceHtml(base_dir: str,
announceDomain, announcePort = get_domain_from_actor(attributedTo)
getPersonFromCache(base_dir, attributedTo, person_cache, allowDownloads)
announceDisplayName = getDisplayName(base_dir, attributedTo, person_cache)
announceDisplayName = \
get_display_name(base_dir, attributedTo, person_cache)
if not announceDisplayName:
announceDisplayName = announceNickname + '@' + announceDomain
@ -1180,7 +1181,7 @@ def _getPostTitleReplyHtml(base_dir: str,
containerClassIcons, containerClass)
getPersonFromCache(base_dir, replyActor, person_cache, allowDownloads)
replyDisplayName = getDisplayName(base_dir, replyActor, person_cache)
replyDisplayName = get_display_name(base_dir, replyActor, person_cache)
if not replyDisplayName:
replyDisplayName = replyNickname + '@' + replyDomain
@ -1580,7 +1581,7 @@ def individualPostAsHtml(signing_priv_key_pem: str,
actorNickname = 'dev'
actorDomain, actorPort = get_domain_from_actor(postActor)
displayName = getDisplayName(base_dir, postActor, person_cache)
displayName = get_display_name(base_dir, postActor, person_cache)
if displayName:
if ':' in displayName:
displayName = \

View File

@ -10,7 +10,7 @@ __module_group__ = "Web Interface"
import os
from pprint import pprint
from webfinger import webfingerHandle
from utils import getDisplayName
from utils import get_display_name
from utils import is_group_account
from utils import has_object_dict
from utils import get_occupation_name
@ -2361,7 +2361,7 @@ def _individualFollowAsHtml(signing_priv_key_pem: str,
if not avatarUrl:
avatarUrl = followUrl + '/avatar.png'
displayName = getDisplayName(base_dir, followUrl, person_cache)
displayName = get_display_name(base_dir, followUrl, person_cache)
isGroup = False
if not displayName:
# lookup the correct webfinger for the followUrl