Snake case

main
Bob Mottram 2021-12-26 20:20:36 +00:00
parent 2c88fb0f42
commit fb9f938c2c
3 changed files with 11 additions and 11 deletions

View File

@ -42,7 +42,7 @@ from utils import get_base_content_from_post
from utils import remove_domain_port
from utils import get_port_from_domain
from utils import has_object_dict
from utils import rejectPostId
from utils import reject_post_id
from utils import removeInvalidChars
from utils import fileLastModified
from utils import isPublicPost
@ -4501,8 +4501,8 @@ def _rejectAnnounce(announceFilename: str,
announcePostId: str, recent_posts_cache: {}):
"""Marks an announce as rejected
"""
rejectPostId(base_dir, nickname, domain, announcePostId,
recent_posts_cache)
reject_post_id(base_dir, nickname, domain, announcePostId,
recent_posts_cache)
# reject the post referenced by the announce activity object
if not os.path.isfile(announceFilename + '.reject'):

View File

@ -2554,8 +2554,8 @@ def camelCaseSplit(text: str) -> str:
return resultStr.strip()
def rejectPostId(base_dir: str, nickname: str, domain: str,
post_id: str, recent_posts_cache: {}) -> None:
def reject_post_id(base_dir: str, nickname: str, domain: str,
post_id: str, recent_posts_cache: {}) -> None:
""" Marks the given post as rejected,
for example an announce which is too old
"""
@ -2605,10 +2605,10 @@ def is_dm(post_json_object: {}) -> bool:
for f in fields:
if not post_json_object['object'].get(f):
continue
for toAddress in post_json_object['object'][f]:
if toAddress.endswith('#Public'):
for to_address in post_json_object['object'][f]:
if to_address.endswith('#Public'):
return False
if toAddress.endswith('followers'):
if to_address.endswith('followers'):
return False
return True

View File

@ -32,7 +32,7 @@ from utils import has_object_dict
from utils import updateAnnounceCollection
from utils import is_pgp_encrypted
from utils import is_dm
from utils import rejectPostId
from utils import reject_post_id
from utils import isRecentPost
from utils import get_config_param
from utils import get_full_domain
@ -1510,8 +1510,8 @@ def individualPostAsHtml(signing_priv_key_pem: str,
if not postJsonAnnounce:
# if the announce could not be downloaded then mark it as rejected
announcedPostId = removeIdEnding(post_json_object['id'])
rejectPostId(base_dir, nickname, domain, announcedPostId,
recent_posts_cache)
reject_post_id(base_dir, nickname, domain, announcedPostId,
recent_posts_cache)
return ''
post_json_object = postJsonAnnounce