Snake case

merge-requests/30/head
Bob Mottram 2021-12-27 23:02:50 +00:00
parent d9ee8a3ff8
commit 4246688359
4 changed files with 36 additions and 34 deletions

View File

@ -243,7 +243,7 @@ from languages import getActorLanguages
from languages import setActorLanguages
from like import updateLikesCollection
from reaction import updateReactionCollection
from utils import undoReactionCollectionEntry
from utils import undo_reaction_collection_entry
from utils import get_new_post_endpoints
from utils import has_actor
from utils import setReplyIntervalHours
@ -8704,8 +8704,9 @@ class PubServer(BaseHTTPRequestHandler):
recent_posts_cache = self.server.recent_posts_cache
reactionPostJson = load_json(reactionPostFilename, 0, 1)
if origFilename and origPostUrl:
undoReactionCollectionEntry(recent_posts_cache,
base_dir, reactionPostFilename,
undo_reaction_collection_entry(recent_posts_cache,
base_dir,
reactionPostFilename,
reactionUrl,
undoActor, domain, debug,
reactionPostJson,
@ -8714,7 +8715,7 @@ class PubServer(BaseHTTPRequestHandler):
reactionPostFilename = origFilename
if debug:
print('Removing emoji reaction for ' + reactionPostFilename)
undoReactionCollectionEntry(recent_posts_cache,
undo_reaction_collection_entry(recent_posts_cache,
base_dir,
reactionPostFilename, reactionUrl,
undoActor, domain, debug,

View File

@ -57,7 +57,7 @@ from utils import removeModerationPostFromIndex
from utils import load_json
from utils import save_json
from utils import undoLikesCollectionEntry
from utils import undoReactionCollectionEntry
from utils import undo_reaction_collection_entry
from utils import has_group_type
from utils import local_actor_url
from utils import has_object_stringType
@ -1446,7 +1446,7 @@ def _receiveUndoReaction(recent_posts_cache: {},
if debug:
print('DEBUG: unreaction has no content')
return True
undoReactionCollectionEntry(recent_posts_cache, base_dir, post_filename,
undo_reaction_collection_entry(recent_posts_cache, base_dir, post_filename,
postReactionId, reactionActor, domain,
debug, None, emojiContent)
# regenerate the html
@ -1463,11 +1463,12 @@ def _receiveUndoReaction(recent_posts_cache: {},
if announceReactionFilename:
postReactionId = announceReactionUrl
post_filename = announceReactionFilename
undoReactionCollectionEntry(recent_posts_cache,
undo_reaction_collection_entry(recent_posts_cache,
base_dir,
post_filename,
postReactionId,
reactionActor, domain,
reactionActor,
domain,
debug, None,
emojiContent)
if reactionPostJson:

View File

@ -23,7 +23,7 @@ from utils import url_permitted
from utils import get_nickname_from_actor
from utils import get_domain_from_actor
from utils import locate_post
from utils import undoReactionCollectionEntry
from utils import undo_reaction_collection_entry
from utils import has_group_type
from utils import local_actor_url
from utils import load_json
@ -432,7 +432,7 @@ def outboxUndoReaction(recent_posts_cache: {},
print('DEBUG: c2s undo reaction post not found in inbox or outbox')
print(messageId)
return True
undoReactionCollectionEntry(recent_posts_cache, base_dir, post_filename,
undo_reaction_collection_entry(recent_posts_cache, base_dir, post_filename,
messageId, message_json['actor'],
domain, debug, None, emojiContent)
if debug:

View File

@ -2276,7 +2276,7 @@ def undoLikesCollectionEntry(recent_posts_cache: {},
save_json(post_json_object, post_filename)
def undoReactionCollectionEntry(recent_posts_cache: {},
def undo_reaction_collection_entry(recent_posts_cache: {},
base_dir: str, post_filename: str,
objectUrl: str,
actor: str, domain: str, debug: bool,
@ -2299,7 +2299,7 @@ def undoReactionCollectionEntry(recent_posts_cache: {},
try:
os.remove(cached_post_filename)
except OSError:
print('EX: undoReactionCollectionEntry ' +
print('EX: undo_reaction_collection_entry ' +
'unable to delete cached post ' +
str(cached_post_filename))
remove_post_from_cache(post_json_object, recent_posts_cache)