mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
0a5889c531
commit
c63e319bb9
|
@ -18415,7 +18415,7 @@ def runDaemon(content_license_url: str,
|
||||||
verify_all_signatures: bool,
|
verify_all_signatures: bool,
|
||||||
send_threads_timeout_mins: int,
|
send_threads_timeout_mins: int,
|
||||||
dormant_months: int,
|
dormant_months: int,
|
||||||
maxNewswirePosts: int,
|
max_newswire_posts: int,
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
maxFeedItemSizeKb: int,
|
maxFeedItemSizeKb: int,
|
||||||
publishButtonAtTop: bool,
|
publishButtonAtTop: bool,
|
||||||
|
@ -18427,7 +18427,7 @@ def runDaemon(content_license_url: str,
|
||||||
maxNewsPosts: int,
|
maxNewsPosts: int,
|
||||||
maxMirroredArticles: int,
|
maxMirroredArticles: int,
|
||||||
maxNewswireFeedSizeKb: int,
|
maxNewswireFeedSizeKb: int,
|
||||||
maxNewswirePostsPerSource: int,
|
max_newswire_postsPerSource: int,
|
||||||
showPublishedDateOnly: bool,
|
showPublishedDateOnly: bool,
|
||||||
votingTimeMins: int,
|
votingTimeMins: int,
|
||||||
positiveVoting: bool,
|
positiveVoting: bool,
|
||||||
|
@ -18576,7 +18576,7 @@ def runDaemon(content_license_url: str,
|
||||||
httpd.newswire = {}
|
httpd.newswire = {}
|
||||||
|
|
||||||
# maximum number of posts to appear in the newswire on the right column
|
# maximum number of posts to appear in the newswire on the right column
|
||||||
httpd.maxNewswirePosts = maxNewswirePosts
|
httpd.max_newswire_posts = max_newswire_posts
|
||||||
|
|
||||||
# whether to require that all incoming posts have valid jsonld signatures
|
# whether to require that all incoming posts have valid jsonld signatures
|
||||||
httpd.verify_all_signatures = verify_all_signatures
|
httpd.verify_all_signatures = verify_all_signatures
|
||||||
|
@ -18627,7 +18627,7 @@ def runDaemon(content_license_url: str,
|
||||||
# this is the maximum number of posts to show for each.
|
# this is the maximum number of posts to show for each.
|
||||||
# This avoids one or two sources from dominating the news,
|
# This avoids one or two sources from dominating the news,
|
||||||
# and also prevents big feeds from slowing down page load times
|
# and also prevents big feeds from slowing down page load times
|
||||||
httpd.maxNewswirePostsPerSource = maxNewswirePostsPerSource
|
httpd.max_newswire_postsPerSource = max_newswire_postsPerSource
|
||||||
|
|
||||||
# Show only the date at the bottom of posts, and not the time
|
# Show only the date at the bottom of posts, and not the time
|
||||||
httpd.showPublishedDateOnly = showPublishedDateOnly
|
httpd.showPublishedDateOnly = showPublishedDateOnly
|
||||||
|
|
26
epicyon.py
26
epicyon.py
|
@ -173,7 +173,7 @@ parser.add_argument('-p', '--port', dest='port', type=int,
|
||||||
default=None,
|
default=None,
|
||||||
help='Port number to run on')
|
help='Port number to run on')
|
||||||
parser.add_argument('--postsPerSource',
|
parser.add_argument('--postsPerSource',
|
||||||
dest='maxNewswirePostsPerSource', type=int,
|
dest='max_newswire_postsPerSource', type=int,
|
||||||
default=4,
|
default=4,
|
||||||
help='Maximum newswire posts per feed or account')
|
help='Maximum newswire posts per feed or account')
|
||||||
parser.add_argument('--dormant_months',
|
parser.add_argument('--dormant_months',
|
||||||
|
@ -191,8 +191,8 @@ parser.add_argument('--send_threads_timeout_mins',
|
||||||
default=30,
|
default=30,
|
||||||
help='How many minutes before a thread to send out ' +
|
help='How many minutes before a thread to send out ' +
|
||||||
'posts expires')
|
'posts expires')
|
||||||
parser.add_argument('--maxNewswirePosts',
|
parser.add_argument('--max_newswire_posts',
|
||||||
dest='maxNewswirePosts', type=int,
|
dest='max_newswire_posts', type=int,
|
||||||
default=20,
|
default=20,
|
||||||
help='Maximum newswire posts in the right column')
|
help='Maximum newswire posts in the right column')
|
||||||
parser.add_argument('--maxFeedSize',
|
parser.add_argument('--maxFeedSize',
|
||||||
|
@ -3026,16 +3026,16 @@ if dateonly:
|
||||||
args.dateonly = dateonly
|
args.dateonly = dateonly
|
||||||
|
|
||||||
# set the maximum number of newswire posts per account or rss feed
|
# set the maximum number of newswire posts per account or rss feed
|
||||||
maxNewswirePostsPerSource = \
|
max_newswire_postsPerSource = \
|
||||||
getConfigParam(base_dir, 'maxNewswirePostsPerSource')
|
getConfigParam(base_dir, 'max_newswire_postsPerSource')
|
||||||
if maxNewswirePostsPerSource:
|
if max_newswire_postsPerSource:
|
||||||
args.maxNewswirePostsPerSource = int(maxNewswirePostsPerSource)
|
args.max_newswire_postsPerSource = int(max_newswire_postsPerSource)
|
||||||
|
|
||||||
# set the maximum number of newswire posts appearing in the right column
|
# set the maximum number of newswire posts appearing in the right column
|
||||||
maxNewswirePosts = \
|
max_newswire_posts = \
|
||||||
getConfigParam(base_dir, 'maxNewswirePosts')
|
getConfigParam(base_dir, 'max_newswire_posts')
|
||||||
if maxNewswirePosts:
|
if max_newswire_posts:
|
||||||
args.maxNewswirePosts = int(maxNewswirePosts)
|
args.max_newswire_posts = int(max_newswire_posts)
|
||||||
|
|
||||||
# set the maximum size of a newswire rss/atom feed in Kilobytes
|
# set the maximum size of a newswire rss/atom feed in Kilobytes
|
||||||
maxNewswireFeedSizeKb = \
|
maxNewswireFeedSizeKb = \
|
||||||
|
@ -3224,7 +3224,7 @@ if __name__ == "__main__":
|
||||||
args.verify_all_signatures,
|
args.verify_all_signatures,
|
||||||
args.send_threads_timeout_mins,
|
args.send_threads_timeout_mins,
|
||||||
args.dormant_months,
|
args.dormant_months,
|
||||||
args.maxNewswirePosts,
|
args.max_newswire_posts,
|
||||||
args.allowLocalNetworkAccess,
|
args.allowLocalNetworkAccess,
|
||||||
args.maxFeedItemSizeKb,
|
args.maxFeedItemSizeKb,
|
||||||
args.publishButtonAtTop,
|
args.publishButtonAtTop,
|
||||||
|
@ -3236,7 +3236,7 @@ if __name__ == "__main__":
|
||||||
args.maxNewsPosts,
|
args.maxNewsPosts,
|
||||||
args.maxMirroredArticles,
|
args.maxMirroredArticles,
|
||||||
args.maxNewswireFeedSizeKb,
|
args.maxNewswireFeedSizeKb,
|
||||||
args.maxNewswirePostsPerSource,
|
args.max_newswire_postsPerSource,
|
||||||
args.dateonly,
|
args.dateonly,
|
||||||
args.votingtime,
|
args.votingtime,
|
||||||
args.positivevoting,
|
args.positivevoting,
|
||||||
|
|
|
@ -796,11 +796,11 @@ def runNewswireDaemon(base_dir: str, httpd,
|
||||||
print('Updating newswire feeds')
|
print('Updating newswire feeds')
|
||||||
newNewswire = \
|
newNewswire = \
|
||||||
getDictFromNewswire(httpd.session, base_dir, domain,
|
getDictFromNewswire(httpd.session, base_dir, domain,
|
||||||
httpd.maxNewswirePostsPerSource,
|
httpd.max_newswire_postsPerSource,
|
||||||
httpd.maxNewswireFeedSizeKb,
|
httpd.maxNewswireFeedSizeKb,
|
||||||
httpd.maxTags,
|
httpd.maxTags,
|
||||||
httpd.maxFeedItemSizeKb,
|
httpd.maxFeedItemSizeKb,
|
||||||
httpd.maxNewswirePosts,
|
httpd.max_newswire_posts,
|
||||||
httpd.maxCategoriesFeedItemSizeKb,
|
httpd.maxCategoriesFeedItemSizeKb,
|
||||||
httpd.systemLanguage,
|
httpd.systemLanguage,
|
||||||
httpd.debug)
|
httpd.debug)
|
||||||
|
|
|
@ -1136,7 +1136,7 @@ def _addBlogsToNewswire(base_dir: str, domain: str, newswire: {},
|
||||||
def getDictFromNewswire(session, base_dir: str, domain: str,
|
def getDictFromNewswire(session, base_dir: str, domain: str,
|
||||||
maxPostsPerSource: int, maxFeedSizeKb: int,
|
maxPostsPerSource: int, maxFeedSizeKb: int,
|
||||||
maxTags: int, maxFeedItemSizeKb: int,
|
maxTags: int, maxFeedItemSizeKb: int,
|
||||||
maxNewswirePosts: int,
|
max_newswire_posts: int,
|
||||||
maxCategoriesFeedItemSizeKb: int,
|
maxCategoriesFeedItemSizeKb: int,
|
||||||
systemLanguage: str, debug: bool) -> {}:
|
systemLanguage: str, debug: bool) -> {}:
|
||||||
"""Gets rss feeds as a dictionary from newswire file
|
"""Gets rss feeds as a dictionary from newswire file
|
||||||
|
@ -1194,12 +1194,12 @@ def getDictFromNewswire(session, base_dir: str, domain: str,
|
||||||
|
|
||||||
# are there too many posts? If so then remove the oldest ones
|
# are there too many posts? If so then remove the oldest ones
|
||||||
noOfPosts = len(sortedResult.items())
|
noOfPosts = len(sortedResult.items())
|
||||||
if noOfPosts > maxNewswirePosts:
|
if noOfPosts > max_newswire_posts:
|
||||||
ctr = 0
|
ctr = 0
|
||||||
removals = []
|
removals = []
|
||||||
for dateStr, item in sortedResult.items():
|
for dateStr, item in sortedResult.items():
|
||||||
ctr += 1
|
ctr += 1
|
||||||
if ctr > maxNewswirePosts:
|
if ctr > max_newswire_posts:
|
||||||
removals.append(dateStr)
|
removals.append(dateStr)
|
||||||
for r in removals:
|
for r in removals:
|
||||||
sortedResult.pop(r)
|
sortedResult.pop(r)
|
||||||
|
|
16
tests.py
16
tests.py
|
@ -780,7 +780,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
max_newswire_posts = 20
|
||||||
dormant_months = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
|
@ -807,7 +807,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
broch_mode,
|
broch_mode,
|
||||||
verify_all_signatures,
|
verify_all_signatures,
|
||||||
send_threads_timeout_mins,
|
send_threads_timeout_mins,
|
||||||
dormant_months, maxNewswirePosts,
|
dormant_months, max_newswire_posts,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
2048, False, True, False, False, True, maxFollowers,
|
2048, False, True, False, False, True, maxFollowers,
|
||||||
0, 100, 1024, 5, False,
|
0, 100, 1024, 5, False,
|
||||||
|
@ -922,7 +922,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
max_newswire_posts = 20
|
||||||
dormant_months = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
|
@ -949,7 +949,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
broch_mode,
|
broch_mode,
|
||||||
verify_all_signatures,
|
verify_all_signatures,
|
||||||
send_threads_timeout_mins,
|
send_threads_timeout_mins,
|
||||||
dormant_months, maxNewswirePosts,
|
dormant_months, max_newswire_posts,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
2048, False, True, False, False, True, maxFollowers,
|
2048, False, True, False, False, True, maxFollowers,
|
||||||
0, 100, 1024, 5, False, 0,
|
0, 100, 1024, 5, False, 0,
|
||||||
|
@ -991,7 +991,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
max_newswire_posts = 20
|
||||||
dormant_months = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
|
@ -1019,7 +1019,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
broch_mode,
|
broch_mode,
|
||||||
verify_all_signatures,
|
verify_all_signatures,
|
||||||
send_threads_timeout_mins,
|
send_threads_timeout_mins,
|
||||||
dormant_months, maxNewswirePosts,
|
dormant_months, max_newswire_posts,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
2048, False, True, False, False, True, maxFollowers,
|
2048, False, True, False, False, True, maxFollowers,
|
||||||
0, 100, 1024, 5, False, 0,
|
0, 100, 1024, 5, False, 0,
|
||||||
|
@ -1063,7 +1063,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
onionDomain = None
|
onionDomain = None
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
max_newswire_posts = 20
|
||||||
dormant_months = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
|
@ -1091,7 +1091,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
broch_mode,
|
broch_mode,
|
||||||
verify_all_signatures,
|
verify_all_signatures,
|
||||||
send_threads_timeout_mins,
|
send_threads_timeout_mins,
|
||||||
dormant_months, maxNewswirePosts,
|
dormant_months, max_newswire_posts,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
2048, False, True, False, False, True, maxFollowers,
|
2048, False, True, False, False, True, maxFollowers,
|
||||||
0, 100, 1024, 5, False,
|
0, 100, 1024, 5, False,
|
||||||
|
|
Loading…
Reference in New Issue