mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
c41d18396e
commit
a2b11135f3
16
daemon.py
16
daemon.py
|
@ -10904,7 +10904,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
http_prefix,
|
http_prefix,
|
||||||
maxPostsInNewsFeed, 'tlnews',
|
maxPostsInNewsFeed, 'tlnews',
|
||||||
True,
|
True,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
if not inboxNewsFeed:
|
if not inboxNewsFeed:
|
||||||
|
@ -10932,7 +10932,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
http_prefix,
|
http_prefix,
|
||||||
maxPostsInBlogsFeed, 'tlnews',
|
maxPostsInBlogsFeed, 'tlnews',
|
||||||
True,
|
True,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
currNickname = path.split('/users/')[1]
|
currNickname = path.split('/users/')[1]
|
||||||
|
@ -11055,7 +11055,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
http_prefix,
|
http_prefix,
|
||||||
maxPostsInNewsFeed, 'tlfeatures',
|
maxPostsInNewsFeed, 'tlfeatures',
|
||||||
True,
|
True,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
if not inboxFeaturesFeed:
|
if not inboxFeaturesFeed:
|
||||||
|
@ -11083,7 +11083,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
http_prefix,
|
http_prefix,
|
||||||
maxPostsInBlogsFeed, 'tlfeatures',
|
maxPostsInBlogsFeed, 'tlfeatures',
|
||||||
True,
|
True,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
currNickname = path.split('/users/')[1]
|
currNickname = path.split('/users/')[1]
|
||||||
|
@ -11514,7 +11514,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
base_dir, domain, port, path,
|
base_dir, domain, port, path,
|
||||||
http_prefix, maxPostsInFeed, 'outbox',
|
http_prefix, maxPostsInFeed, 'outbox',
|
||||||
authorized,
|
authorized,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
if outboxFeed:
|
if outboxFeed:
|
||||||
|
@ -11542,7 +11542,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
http_prefix,
|
http_prefix,
|
||||||
maxPostsInFeed, 'outbox',
|
maxPostsInFeed, 'outbox',
|
||||||
authorized,
|
authorized,
|
||||||
self.server.newswireVotesThreshold,
|
self.server.newswire_votes_threshold,
|
||||||
self.server.positive_voting,
|
self.server.positive_voting,
|
||||||
self.server.voting_time_mins)
|
self.server.voting_time_mins)
|
||||||
else:
|
else:
|
||||||
|
@ -18448,7 +18448,7 @@ def runDaemon(content_license_url: str,
|
||||||
show_published_date_only: bool,
|
show_published_date_only: bool,
|
||||||
voting_time_mins: int,
|
voting_time_mins: int,
|
||||||
positive_voting: bool,
|
positive_voting: bool,
|
||||||
newswireVotesThreshold: int,
|
newswire_votes_threshold: int,
|
||||||
newsInstance: bool,
|
newsInstance: bool,
|
||||||
blogsInstance: bool,
|
blogsInstance: bool,
|
||||||
mediaInstance: bool,
|
mediaInstance: bool,
|
||||||
|
@ -18635,7 +18635,7 @@ def runDaemon(content_license_url: str,
|
||||||
httpd.positive_voting = positive_voting
|
httpd.positive_voting = positive_voting
|
||||||
# number of votes needed to remove a newswire item from the news timeline
|
# 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
|
# 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
|
# 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
|
# If the feed is too large then this is probably a DoS attempt
|
||||||
httpd.max_newswire_feed_size_kb = max_newswire_feed_size_kb
|
httpd.max_newswire_feed_size_kb = max_newswire_feed_size_kb
|
||||||
|
|
|
@ -899,7 +899,7 @@ def personBoxJson(recentPostsCache: {},
|
||||||
session, base_dir: str, domain: str, port: int, path: str,
|
session, base_dir: str, domain: str, port: int, path: str,
|
||||||
http_prefix: str, noOfItems: int, boxname: str,
|
http_prefix: str, noOfItems: int, boxname: str,
|
||||||
authorized: bool,
|
authorized: bool,
|
||||||
newswireVotesThreshold: int, positive_voting: bool,
|
newswire_votes_threshold: int, positive_voting: bool,
|
||||||
voting_time_mins: int) -> {}:
|
voting_time_mins: int) -> {}:
|
||||||
"""Obtain the inbox/outbox/moderation feed for the given person
|
"""Obtain the inbox/outbox/moderation feed for the given person
|
||||||
"""
|
"""
|
||||||
|
@ -973,7 +973,7 @@ def personBoxJson(recentPostsCache: {},
|
||||||
elif boxname == 'tlnews':
|
elif boxname == 'tlnews':
|
||||||
return createNewsTimeline(session, base_dir, nickname, domain, port,
|
return createNewsTimeline(session, base_dir, nickname, domain, port,
|
||||||
http_prefix, noOfItems, headerOnly,
|
http_prefix, noOfItems, headerOnly,
|
||||||
newswireVotesThreshold, positive_voting,
|
newswire_votes_threshold, positive_voting,
|
||||||
voting_time_mins, pageNumber)
|
voting_time_mins, pageNumber)
|
||||||
elif boxname == 'tlfeatures':
|
elif boxname == 'tlfeatures':
|
||||||
return createFeaturesTimeline(session, base_dir,
|
return createFeaturesTimeline(session, base_dir,
|
||||||
|
|
16
posts.py
16
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,
|
def createNewsTimeline(session, base_dir: str, nickname: str, domain: str,
|
||||||
port: int, http_prefix: str, itemsPerPage: int,
|
port: int, http_prefix: str, itemsPerPage: int,
|
||||||
headerOnly: bool, newswireVotesThreshold: int,
|
headerOnly: bool, newswire_votes_threshold: int,
|
||||||
positive_voting: bool, voting_time_mins: int,
|
positive_voting: bool, voting_time_mins: int,
|
||||||
pageNumber: int) -> {}:
|
pageNumber: int) -> {}:
|
||||||
return _createBoxIndexed({}, session, base_dir, 'outbox', 'news',
|
return _createBoxIndexed({}, session, base_dir, 'outbox', 'news',
|
||||||
domain, port, http_prefix,
|
domain, port, http_prefix,
|
||||||
itemsPerPage, headerOnly, True,
|
itemsPerPage, headerOnly, True,
|
||||||
newswireVotesThreshold, positive_voting,
|
newswire_votes_threshold, positive_voting,
|
||||||
voting_time_mins, pageNumber)
|
voting_time_mins, pageNumber)
|
||||||
|
|
||||||
|
|
||||||
|
@ -3598,7 +3598,7 @@ def removePostInteractions(postJsonObject: {}, force: bool) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def _passedNewswireVoting(newswireVotesThreshold: int,
|
def _passedNewswireVoting(newswire_votes_threshold: int,
|
||||||
base_dir: str, domain: str,
|
base_dir: str, domain: str,
|
||||||
postFilename: str,
|
postFilename: str,
|
||||||
positive_voting: bool,
|
positive_voting: bool,
|
||||||
|
@ -3606,7 +3606,7 @@ def _passedNewswireVoting(newswireVotesThreshold: int,
|
||||||
"""Returns true if the post has passed through newswire voting
|
"""Returns true if the post has passed through newswire voting
|
||||||
"""
|
"""
|
||||||
# apply votes within this timeline
|
# apply votes within this timeline
|
||||||
if newswireVotesThreshold <= 0:
|
if newswire_votes_threshold <= 0:
|
||||||
return True
|
return True
|
||||||
# note that the presence of an arrival file also indicates
|
# note that the presence of an arrival file also indicates
|
||||||
# that this post is moderated
|
# that this post is moderated
|
||||||
|
@ -3634,14 +3634,14 @@ def _passedNewswireVoting(newswireVotesThreshold: int,
|
||||||
return True
|
return True
|
||||||
if not positive_voting:
|
if not positive_voting:
|
||||||
if votesOnNewswireItem(votesJson) >= \
|
if votesOnNewswireItem(votesJson) >= \
|
||||||
newswireVotesThreshold:
|
newswire_votes_threshold:
|
||||||
# Too many veto votes.
|
# Too many veto votes.
|
||||||
# Continue without incrementing
|
# Continue without incrementing
|
||||||
# the posts counter
|
# the posts counter
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
if votesOnNewswireItem < \
|
if votesOnNewswireItem < \
|
||||||
newswireVotesThreshold:
|
newswire_votes_threshold:
|
||||||
# Not enough votes.
|
# Not enough votes.
|
||||||
# Continue without incrementing
|
# Continue without incrementing
|
||||||
# the posts counter
|
# the posts counter
|
||||||
|
@ -3653,7 +3653,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
session, base_dir: str, boxname: str,
|
session, base_dir: str, boxname: str,
|
||||||
nickname: str, domain: str, port: int, http_prefix: str,
|
nickname: str, domain: str, port: int, http_prefix: str,
|
||||||
itemsPerPage: int, headerOnly: bool, authorized: bool,
|
itemsPerPage: int, headerOnly: bool, authorized: bool,
|
||||||
newswireVotesThreshold: int, positive_voting: bool,
|
newswire_votes_threshold: int, positive_voting: bool,
|
||||||
voting_time_mins: int, pageNumber: int) -> {}:
|
voting_time_mins: int, pageNumber: int) -> {}:
|
||||||
"""Constructs the box feed for a person with the given nickname
|
"""Constructs the box feed for a person with the given nickname
|
||||||
"""
|
"""
|
||||||
|
@ -3732,7 +3732,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
break
|
break
|
||||||
|
|
||||||
# Has this post passed through the newswire voting stage?
|
# Has this post passed through the newswire voting stage?
|
||||||
if not _passedNewswireVoting(newswireVotesThreshold,
|
if not _passedNewswireVoting(newswire_votes_threshold,
|
||||||
base_dir, domain,
|
base_dir, domain,
|
||||||
postFilename,
|
postFilename,
|
||||||
positive_voting,
|
positive_voting,
|
||||||
|
|
Loading…
Reference in New Issue