From a2b11135f3d6928dff17a8f3d69cc925a1396d9c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 25 Dec 2021 20:17:35 +0000 Subject: [PATCH] Snake case --- daemon.py | 16 ++++++++-------- person.py | 4 ++-- posts.py | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/daemon.py b/daemon.py index 05c40e086..e2ea1072f 100644 --- a/daemon.py +++ b/daemon.py @@ -10904,7 +10904,7 @@ class PubServer(BaseHTTPRequestHandler): http_prefix, maxPostsInNewsFeed, 'tlnews', True, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) if not inboxNewsFeed: @@ -10932,7 +10932,7 @@ class PubServer(BaseHTTPRequestHandler): http_prefix, maxPostsInBlogsFeed, 'tlnews', True, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) currNickname = path.split('/users/')[1] @@ -11055,7 +11055,7 @@ class PubServer(BaseHTTPRequestHandler): http_prefix, maxPostsInNewsFeed, 'tlfeatures', True, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) if not inboxFeaturesFeed: @@ -11083,7 +11083,7 @@ class PubServer(BaseHTTPRequestHandler): http_prefix, maxPostsInBlogsFeed, 'tlfeatures', True, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) currNickname = path.split('/users/')[1] @@ -11514,7 +11514,7 @@ class PubServer(BaseHTTPRequestHandler): base_dir, domain, port, path, http_prefix, maxPostsInFeed, 'outbox', authorized, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) if outboxFeed: @@ -11542,7 +11542,7 @@ class PubServer(BaseHTTPRequestHandler): http_prefix, maxPostsInFeed, 'outbox', authorized, - self.server.newswireVotesThreshold, + self.server.newswire_votes_threshold, self.server.positive_voting, self.server.voting_time_mins) else: @@ -18448,7 +18448,7 @@ def runDaemon(content_license_url: str, show_published_date_only: bool, voting_time_mins: int, positive_voting: bool, - newswireVotesThreshold: int, + newswire_votes_threshold: int, newsInstance: bool, blogsInstance: bool, mediaInstance: bool, @@ -18635,7 +18635,7 @@ def runDaemon(content_license_url: str, httpd.positive_voting = positive_voting # number of votes needed to remove a newswire item from the news timeline # or if positive voting is anabled to add the item to the news timeline - httpd.newswireVotesThreshold = newswireVotesThreshold + httpd.newswire_votes_threshold = newswire_votes_threshold # maximum overall size of an rss/atom feed read by the newswire daemon # If the feed is too large then this is probably a DoS attempt httpd.max_newswire_feed_size_kb = max_newswire_feed_size_kb diff --git a/person.py b/person.py index f9bb1e002..6567ad029 100644 --- a/person.py +++ b/person.py @@ -899,7 +899,7 @@ def personBoxJson(recentPostsCache: {}, session, base_dir: str, domain: str, port: int, path: str, http_prefix: str, noOfItems: int, boxname: str, authorized: bool, - newswireVotesThreshold: int, positive_voting: bool, + newswire_votes_threshold: int, positive_voting: bool, voting_time_mins: int) -> {}: """Obtain the inbox/outbox/moderation feed for the given person """ @@ -973,7 +973,7 @@ def personBoxJson(recentPostsCache: {}, elif boxname == 'tlnews': return createNewsTimeline(session, base_dir, nickname, domain, port, http_prefix, noOfItems, headerOnly, - newswireVotesThreshold, positive_voting, + newswire_votes_threshold, positive_voting, voting_time_mins, pageNumber) elif boxname == 'tlfeatures': return createFeaturesTimeline(session, base_dir, diff --git a/posts.py b/posts.py index 67e162834..386750d8d 100644 --- a/posts.py +++ b/posts.py @@ -3364,13 +3364,13 @@ def createMediaTimeline(session, base_dir: str, nickname: str, domain: str, def createNewsTimeline(session, base_dir: str, nickname: str, domain: str, port: int, http_prefix: str, itemsPerPage: int, - headerOnly: bool, newswireVotesThreshold: int, + headerOnly: bool, newswire_votes_threshold: int, positive_voting: bool, voting_time_mins: int, pageNumber: int) -> {}: return _createBoxIndexed({}, session, base_dir, 'outbox', 'news', domain, port, http_prefix, itemsPerPage, headerOnly, True, - newswireVotesThreshold, positive_voting, + newswire_votes_threshold, positive_voting, voting_time_mins, pageNumber) @@ -3598,7 +3598,7 @@ def removePostInteractions(postJsonObject: {}, force: bool) -> bool: return True -def _passedNewswireVoting(newswireVotesThreshold: int, +def _passedNewswireVoting(newswire_votes_threshold: int, base_dir: str, domain: str, postFilename: str, positive_voting: bool, @@ -3606,7 +3606,7 @@ def _passedNewswireVoting(newswireVotesThreshold: int, """Returns true if the post has passed through newswire voting """ # apply votes within this timeline - if newswireVotesThreshold <= 0: + if newswire_votes_threshold <= 0: return True # note that the presence of an arrival file also indicates # that this post is moderated @@ -3634,14 +3634,14 @@ def _passedNewswireVoting(newswireVotesThreshold: int, return True if not positive_voting: if votesOnNewswireItem(votesJson) >= \ - newswireVotesThreshold: + newswire_votes_threshold: # Too many veto votes. # Continue without incrementing # the posts counter return False else: if votesOnNewswireItem < \ - newswireVotesThreshold: + newswire_votes_threshold: # Not enough votes. # Continue without incrementing # the posts counter @@ -3653,7 +3653,7 @@ def _createBoxIndexed(recentPostsCache: {}, session, base_dir: str, boxname: str, nickname: str, domain: str, port: int, http_prefix: str, itemsPerPage: int, headerOnly: bool, authorized: bool, - newswireVotesThreshold: int, positive_voting: bool, + newswire_votes_threshold: int, positive_voting: bool, voting_time_mins: int, pageNumber: int) -> {}: """Constructs the box feed for a person with the given nickname """ @@ -3732,7 +3732,7 @@ def _createBoxIndexed(recentPostsCache: {}, break # Has this post passed through the newswire voting stage? - if not _passedNewswireVoting(newswireVotesThreshold, + if not _passedNewswireVoting(newswire_votes_threshold, base_dir, domain, postFilename, positive_voting,