mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
2277bd8975
commit
0a5889c531
18
daemon.py
18
daemon.py
|
@ -7159,7 +7159,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
EnigmaPubKey,
|
EnigmaPubKey,
|
||||||
PGPpubKey, PGPfingerprint,
|
PGPpubKey, PGPfingerprint,
|
||||||
emailAddress,
|
emailAddress,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
backToPath,
|
backToPath,
|
||||||
lockedAccount,
|
lockedAccount,
|
||||||
movedTo, alsoKnownAs,
|
movedTo, alsoKnownAs,
|
||||||
|
@ -9705,7 +9705,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.allowLocalNetworkAccess,
|
self.server.allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -9821,7 +9821,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
showPublishedDateOnly,
|
showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -11823,7 +11823,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.allowLocalNetworkAccess,
|
self.server.allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -11944,7 +11944,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.allowLocalNetworkAccess,
|
self.server.allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -12064,7 +12064,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.allowLocalNetworkAccess,
|
self.server.allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -12200,7 +12200,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.showPublishedDateOnly,
|
self.server.showPublishedDateOnly,
|
||||||
self.server.newswire,
|
self.server.newswire,
|
||||||
self.server.themeName,
|
self.server.themeName,
|
||||||
self.server.dormantMonths,
|
self.server.dormant_months,
|
||||||
self.server.peertubeInstances,
|
self.server.peertubeInstances,
|
||||||
self.server.allowLocalNetworkAccess,
|
self.server.allowLocalNetworkAccess,
|
||||||
self.server.textModeBanner,
|
self.server.textModeBanner,
|
||||||
|
@ -18414,7 +18414,7 @@ def runDaemon(content_license_url: str,
|
||||||
broch_mode: bool,
|
broch_mode: bool,
|
||||||
verify_all_signatures: bool,
|
verify_all_signatures: bool,
|
||||||
send_threads_timeout_mins: int,
|
send_threads_timeout_mins: int,
|
||||||
dormantMonths: int,
|
dormant_months: int,
|
||||||
maxNewswirePosts: int,
|
maxNewswirePosts: int,
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
maxFeedItemSizeKb: int,
|
maxFeedItemSizeKb: int,
|
||||||
|
@ -18671,7 +18671,7 @@ def runDaemon(content_license_url: str,
|
||||||
|
|
||||||
# how many months does a followed account need to be unseen
|
# how many months does a followed account need to be unseen
|
||||||
# for it to be considered dormant?
|
# for it to be considered dormant?
|
||||||
httpd.dormantMonths = dormantMonths
|
httpd.dormant_months = dormant_months
|
||||||
|
|
||||||
# maximum number of likes to display on a post
|
# maximum number of likes to display on a post
|
||||||
httpd.max_like_count = max_like_count
|
httpd.max_like_count = max_like_count
|
||||||
|
|
14
epicyon.py
14
epicyon.py
|
@ -176,8 +176,8 @@ parser.add_argument('--postsPerSource',
|
||||||
dest='maxNewswirePostsPerSource', type=int,
|
dest='maxNewswirePostsPerSource', 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('--dormantMonths',
|
parser.add_argument('--dormant_months',
|
||||||
dest='dormantMonths', type=int,
|
dest='dormant_months', type=int,
|
||||||
default=3,
|
default=3,
|
||||||
help='How many months does a followed account need to ' +
|
help='How many months does a followed account need to ' +
|
||||||
'be unseen for before being considered dormant')
|
'be unseen for before being considered dormant')
|
||||||
|
@ -3063,10 +3063,10 @@ maxFeedItemSizeKb = \
|
||||||
if maxFeedItemSizeKb is not None:
|
if maxFeedItemSizeKb is not None:
|
||||||
args.maxFeedItemSizeKb = int(maxFeedItemSizeKb)
|
args.maxFeedItemSizeKb = int(maxFeedItemSizeKb)
|
||||||
|
|
||||||
dormantMonths = \
|
dormant_months = \
|
||||||
getConfigParam(base_dir, 'dormantMonths')
|
getConfigParam(base_dir, 'dormant_months')
|
||||||
if dormantMonths is not None:
|
if dormant_months is not None:
|
||||||
args.dormantMonths = int(dormantMonths)
|
args.dormant_months = int(dormant_months)
|
||||||
|
|
||||||
send_threads_timeout_mins = \
|
send_threads_timeout_mins = \
|
||||||
getConfigParam(base_dir, 'send_threads_timeout_mins')
|
getConfigParam(base_dir, 'send_threads_timeout_mins')
|
||||||
|
@ -3223,7 +3223,7 @@ if __name__ == "__main__":
|
||||||
args.broch_mode,
|
args.broch_mode,
|
||||||
args.verify_all_signatures,
|
args.verify_all_signatures,
|
||||||
args.send_threads_timeout_mins,
|
args.send_threads_timeout_mins,
|
||||||
args.dormantMonths,
|
args.dormant_months,
|
||||||
args.maxNewswirePosts,
|
args.maxNewswirePosts,
|
||||||
args.allowLocalNetworkAccess,
|
args.allowLocalNetworkAccess,
|
||||||
args.maxFeedItemSizeKb,
|
args.maxFeedItemSizeKb,
|
||||||
|
|
16
tests.py
16
tests.py
|
@ -781,7 +781,7 @@ def createServerAlice(path: str, domain: str, port: int,
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
maxNewswirePosts = 20
|
||||||
dormantMonths = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
verify_all_signatures = True
|
verify_all_signatures = True
|
||||||
|
@ -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,
|
||||||
dormantMonths, maxNewswirePosts,
|
dormant_months, maxNewswirePosts,
|
||||||
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,
|
||||||
|
@ -923,7 +923,7 @@ def createServerBob(path: str, domain: str, port: int,
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
maxNewswirePosts = 20
|
||||||
dormantMonths = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
verify_all_signatures = True
|
verify_all_signatures = True
|
||||||
|
@ -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,
|
||||||
dormantMonths, maxNewswirePosts,
|
dormant_months, maxNewswirePosts,
|
||||||
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,
|
||||||
|
@ -992,7 +992,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
maxNewswirePosts = 20
|
||||||
dormantMonths = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
verify_all_signatures = True
|
verify_all_signatures = True
|
||||||
|
@ -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,
|
||||||
dormantMonths, maxNewswirePosts,
|
dormant_months, maxNewswirePosts,
|
||||||
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,
|
||||||
|
@ -1064,7 +1064,7 @@ def createServerGroup(path: str, domain: str, port: int,
|
||||||
i2pDomain = None
|
i2pDomain = None
|
||||||
allowLocalNetworkAccess = True
|
allowLocalNetworkAccess = True
|
||||||
maxNewswirePosts = 20
|
maxNewswirePosts = 20
|
||||||
dormantMonths = 3
|
dormant_months = 3
|
||||||
send_threads_timeout_mins = 30
|
send_threads_timeout_mins = 30
|
||||||
maxFollowers = 10
|
maxFollowers = 10
|
||||||
verify_all_signatures = True
|
verify_all_signatures = True
|
||||||
|
@ -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,
|
||||||
dormantMonths, maxNewswirePosts,
|
dormant_months, maxNewswirePosts,
|
||||||
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,
|
||||||
|
|
4
utils.py
4
utils.py
|
@ -253,7 +253,7 @@ def getFullDomain(domain: str, port: int) -> str:
|
||||||
|
|
||||||
|
|
||||||
def isDormant(base_dir: str, nickname: str, domain: str, actor: str,
|
def isDormant(base_dir: str, nickname: str, domain: str, actor: str,
|
||||||
dormantMonths: int) -> bool:
|
dormant_months: int) -> bool:
|
||||||
"""Is the given followed actor dormant, from the standpoint
|
"""Is the given followed actor dormant, from the standpoint
|
||||||
of the given account
|
of the given account
|
||||||
"""
|
"""
|
||||||
|
@ -277,7 +277,7 @@ def isDormant(base_dir: str, nickname: str, domain: str, actor: str,
|
||||||
currDaysSinceEpoch = (currTime - datetime.datetime(1970, 1, 1)).days
|
currDaysSinceEpoch = (currTime - datetime.datetime(1970, 1, 1)).days
|
||||||
timeDiffMonths = \
|
timeDiffMonths = \
|
||||||
int((currDaysSinceEpoch - daysSinceEpoch) / 30)
|
int((currDaysSinceEpoch - daysSinceEpoch) / 30)
|
||||||
if timeDiffMonths >= dormantMonths:
|
if timeDiffMonths >= dormant_months:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
PGPpubKey: str,
|
PGPpubKey: str,
|
||||||
PGPfingerprint: str,
|
PGPfingerprint: str,
|
||||||
emailAddress: str,
|
emailAddress: str,
|
||||||
dormantMonths: int,
|
dormant_months: int,
|
||||||
backToPath: str,
|
backToPath: str,
|
||||||
lockedAccount: bool,
|
lockedAccount: bool,
|
||||||
movedTo: str,
|
movedTo: str,
|
||||||
|
@ -94,7 +94,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
followStr = 'Leave'
|
followStr = 'Leave'
|
||||||
dormant = \
|
dormant = \
|
||||||
isDormant(base_dir, nickname, domain, optionsActor,
|
isDormant(base_dir, nickname, domain, optionsActor,
|
||||||
dormantMonths)
|
dormant_months)
|
||||||
|
|
||||||
optionsNickname = getNicknameFromActor(optionsActor)
|
optionsNickname = getNicknameFromActor(optionsActor)
|
||||||
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
|
||||||
|
|
|
@ -550,7 +550,7 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
yt_replace_domain: str,
|
yt_replace_domain: str,
|
||||||
twitterReplacementDomain: str,
|
twitterReplacementDomain: str,
|
||||||
showPublishedDateOnly: bool,
|
showPublishedDateOnly: bool,
|
||||||
newswire: {}, theme: str, dormantMonths: int,
|
newswire: {}, theme: str, dormant_months: int,
|
||||||
peertubeInstances: [],
|
peertubeInstances: [],
|
||||||
allowLocalNetworkAccess: bool,
|
allowLocalNetworkAccess: bool,
|
||||||
textModeBanner: str,
|
textModeBanner: str,
|
||||||
|
@ -976,7 +976,7 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
cachedWebfingers, personCache, extraJson,
|
cachedWebfingers, personCache, extraJson,
|
||||||
projectVersion, ["unfollow"], selected,
|
projectVersion, ["unfollow"], selected,
|
||||||
usersPath, pageNumber, maxItemsPerPage,
|
usersPath, pageNumber, maxItemsPerPage,
|
||||||
dormantMonths, debug,
|
dormant_months, debug,
|
||||||
signingPrivateKeyPem)
|
signingPrivateKeyPem)
|
||||||
if selected == 'followers':
|
if selected == 'followers':
|
||||||
profileStr += \
|
profileStr += \
|
||||||
|
@ -986,7 +986,7 @@ def htmlProfile(signingPrivateKeyPem: str,
|
||||||
cachedWebfingers, personCache, extraJson,
|
cachedWebfingers, personCache, extraJson,
|
||||||
projectVersion, ["block"],
|
projectVersion, ["block"],
|
||||||
selected, usersPath, pageNumber,
|
selected, usersPath, pageNumber,
|
||||||
maxItemsPerPage, dormantMonths, debug,
|
maxItemsPerPage, dormant_months, debug,
|
||||||
signingPrivateKeyPem)
|
signingPrivateKeyPem)
|
||||||
if not isGroup:
|
if not isGroup:
|
||||||
if selected == 'roles':
|
if selected == 'roles':
|
||||||
|
@ -1099,7 +1099,7 @@ def _htmlProfileFollowing(translate: {}, base_dir: str, http_prefix: str,
|
||||||
feedName: str, actor: str,
|
feedName: str, actor: str,
|
||||||
pageNumber: int,
|
pageNumber: int,
|
||||||
maxItemsPerPage: int,
|
maxItemsPerPage: int,
|
||||||
dormantMonths: int, debug: bool,
|
dormant_months: int, debug: bool,
|
||||||
signingPrivateKeyPem: str) -> str:
|
signingPrivateKeyPem: str) -> str:
|
||||||
"""Shows following on the profile screen
|
"""Shows following on the profile screen
|
||||||
"""
|
"""
|
||||||
|
@ -1124,7 +1124,7 @@ def _htmlProfileFollowing(translate: {}, base_dir: str, http_prefix: str,
|
||||||
if authorized and feedName == 'following':
|
if authorized and feedName == 'following':
|
||||||
dormant = \
|
dormant = \
|
||||||
isDormant(base_dir, nickname, domain, followingActor,
|
isDormant(base_dir, nickname, domain, followingActor,
|
||||||
dormantMonths)
|
dormant_months)
|
||||||
|
|
||||||
profileStr += \
|
profileStr += \
|
||||||
_individualFollowAsHtml(signingPrivateKeyPem,
|
_individualFollowAsHtml(signingPrivateKeyPem,
|
||||||
|
|
Loading…
Reference in New Issue