From 0a1f09175ff7fef908df0b52abd18b5beaa81bf3 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 27 Dec 2021 17:49:35 +0000 Subject: [PATCH] Snake case --- blocking.py | 6 +++--- posts.py | 4 ++-- utils.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blocking.py b/blocking.py index 6b94d948d..b7ca26ed5 100644 --- a/blocking.py +++ b/blocking.py @@ -25,7 +25,7 @@ from utils import setConfigParam from utils import has_users_path from utils import get_full_domain from utils import remove_id_ending -from utils import isEvil +from utils import is_evil from utils import locate_post from utils import evil_incarnate from utils import getDomainFromActor @@ -315,7 +315,7 @@ def isBlockedDomain(base_dir: str, domain: str, if '.' not in domain: return False - if isEvil(domain): + if is_evil(domain): return True shortDomain = _getShortDomain(domain) @@ -361,7 +361,7 @@ def isBlocked(base_dir: str, nickname: str, domain: str, blockedCache: [] = None) -> bool: """Is the given nickname blocked? """ - if isEvil(blockDomain): + if is_evil(blockDomain): return True blockHandle = None diff --git a/posts.py b/posts.py index 3169f6033..690f74b5b 100644 --- a/posts.py +++ b/posts.py @@ -50,7 +50,7 @@ from utils import has_users_path from utils import valid_post_date from utils import get_full_domain from utils import get_followers_list -from utils import isEvil +from utils import is_evil from utils import get_status_number from utils import createPersonDir from utils import urlPermitted @@ -4333,7 +4333,7 @@ def getPublicPostDomainsBlocked(session, base_dir: str, continue # get the domain after the @ domainName = domainName.split('@')[1].strip() - if isEvil(domainName): + if is_evil(domainName): blockedDomains.append(domainName) continue if domainName in blockedStr: diff --git a/utils.py b/utils.py index 374a21aa9..7b41232d9 100644 --- a/utils.py +++ b/utils.py @@ -742,7 +742,7 @@ def evil_incarnate() -> []: 'kiwifarms.cc', 'djitter.com') -def isEvil(domain: str) -> bool: +def is_evil(domain: str) -> bool: # https://www.youtube.com/watch?v=5qw1hcevmdU if not isinstance(domain, str): print('WARN: Malformed domain ' + str(domain)) @@ -818,7 +818,7 @@ def domainPermitted(domain: str, federation_list: []): def urlPermitted(url: str, federation_list: []): - if isEvil(url): + if is_evil(url): return False if not federation_list: return True