From 65e42a7c120307960b61ee7e381f54d2c919cd01 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 26 Dec 2021 12:16:36 +0000 Subject: [PATCH] Snake case --- daemon.py | 4 ++-- utils.py | 6 +++--- webapp_profile.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daemon.py b/daemon.py index f81e17114..686a9868a 100644 --- a/daemon.py +++ b/daemon.py @@ -270,7 +270,7 @@ from utils import loadTranslationsFromFile from utils import getLocalNetworkAddresses from utils import decodedHost from utils import isPublicPost -from utils import getLockedAccount +from utils import get_locked_account from utils import hasUsersPath from utils import getFullDomain from utils import removeHtml @@ -7116,7 +7116,7 @@ class PubServer(BaseHTTPRequestHandler): movedTo = movedTo.split('"')[1] if actor_json['type'] == 'Group': isGroup = True - lockedAccount = getLockedAccount(actor_json) + lockedAccount = get_locked_account(actor_json) donateUrl = getDonationUrl(actor_json) websiteUrl = getWebsite(actor_json, self.server.translate) xmppAddress = getXmppAddress(actor_json) diff --git a/utils.py b/utils.py index 3943caa01..3f97869ab 100644 --- a/utils.py +++ b/utils.py @@ -157,7 +157,7 @@ def get_sha_512(msg: str): return digest.finalize() -def _localNetworkHost(host: str) -> bool: +def _local_network_host(host: str) -> bool: """Returns true if the given host is on the local network """ if host.startswith('localhost') or \ @@ -174,14 +174,14 @@ def decodedHost(host: str) -> str: """ if ':' not in host: # eg. mydomain:8000 - if not _localNetworkHost(host): + if not _local_network_host(host): if not host.endswith('.onion'): if not host.endswith('.i2p'): return idna.decode(host) return host -def getLockedAccount(actor_json: {}) -> bool: +def get_locked_account(actor_json: {}) -> bool: """Returns whether the given account requires follower approval """ if not actor_json.get('manuallyApprovesFollowers'): diff --git a/webapp_profile.py b/webapp_profile.py index 4671acc29..cae3d946b 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -14,7 +14,7 @@ from utils import getDisplayName from utils import isGroupAccount from utils import has_object_dict from utils import getOccupationName -from utils import getLockedAccount +from utils import get_locked_account from utils import getFullDomain from utils import isArtist from utils import isDormant @@ -185,7 +185,7 @@ def htmlProfileAfterSearch(cssCache: {}, if profile_json.get('name'): displayName = profile_json['name'] - lockedAccount = getLockedAccount(profile_json) + lockedAccount = get_locked_account(profile_json) if lockedAccount: displayName += '🔒' movedTo = ''