Snake case

merge-requests/30/head
Bob Mottram 2021-12-25 18:47:04 +00:00
parent 2277bd8975
commit 0a5889c531
6 changed files with 33 additions and 33 deletions

View File

@ -7159,7 +7159,7 @@ class PubServer(BaseHTTPRequestHandler):
EnigmaPubKey,
PGPpubKey, PGPfingerprint,
emailAddress,
self.server.dormantMonths,
self.server.dormant_months,
backToPath,
lockedAccount,
movedTo, alsoKnownAs,
@ -9705,7 +9705,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.textModeBanner,
@ -9821,7 +9821,7 @@ class PubServer(BaseHTTPRequestHandler):
showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
allowLocalNetworkAccess,
self.server.textModeBanner,
@ -11823,7 +11823,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.textModeBanner,
@ -11944,7 +11944,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.textModeBanner,
@ -12064,7 +12064,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.textModeBanner,
@ -12200,7 +12200,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.showPublishedDateOnly,
self.server.newswire,
self.server.themeName,
self.server.dormantMonths,
self.server.dormant_months,
self.server.peertubeInstances,
self.server.allowLocalNetworkAccess,
self.server.textModeBanner,
@ -18414,7 +18414,7 @@ def runDaemon(content_license_url: str,
broch_mode: bool,
verify_all_signatures: bool,
send_threads_timeout_mins: int,
dormantMonths: int,
dormant_months: int,
maxNewswirePosts: int,
allowLocalNetworkAccess: bool,
maxFeedItemSizeKb: int,
@ -18671,7 +18671,7 @@ def runDaemon(content_license_url: str,
# how many months does a followed account need to be unseen
# for it to be considered dormant?
httpd.dormantMonths = dormantMonths
httpd.dormant_months = dormant_months
# maximum number of likes to display on a post
httpd.max_like_count = max_like_count

View File

@ -176,8 +176,8 @@ parser.add_argument('--postsPerSource',
dest='maxNewswirePostsPerSource', type=int,
default=4,
help='Maximum newswire posts per feed or account')
parser.add_argument('--dormantMonths',
dest='dormantMonths', type=int,
parser.add_argument('--dormant_months',
dest='dormant_months', type=int,
default=3,
help='How many months does a followed account need to ' +
'be unseen for before being considered dormant')
@ -3063,10 +3063,10 @@ maxFeedItemSizeKb = \
if maxFeedItemSizeKb is not None:
args.maxFeedItemSizeKb = int(maxFeedItemSizeKb)
dormantMonths = \
getConfigParam(base_dir, 'dormantMonths')
if dormantMonths is not None:
args.dormantMonths = int(dormantMonths)
dormant_months = \
getConfigParam(base_dir, 'dormant_months')
if dormant_months is not None:
args.dormant_months = int(dormant_months)
send_threads_timeout_mins = \
getConfigParam(base_dir, 'send_threads_timeout_mins')
@ -3223,7 +3223,7 @@ if __name__ == "__main__":
args.broch_mode,
args.verify_all_signatures,
args.send_threads_timeout_mins,
args.dormantMonths,
args.dormant_months,
args.maxNewswirePosts,
args.allowLocalNetworkAccess,
args.maxFeedItemSizeKb,

View File

@ -781,7 +781,7 @@ def createServerAlice(path: str, domain: str, port: int,
i2pDomain = None
allowLocalNetworkAccess = True
maxNewswirePosts = 20
dormantMonths = 3
dormant_months = 3
send_threads_timeout_mins = 30
maxFollowers = 10
verify_all_signatures = True
@ -807,7 +807,7 @@ def createServerAlice(path: str, domain: str, port: int,
broch_mode,
verify_all_signatures,
send_threads_timeout_mins,
dormantMonths, maxNewswirePosts,
dormant_months, maxNewswirePosts,
allowLocalNetworkAccess,
2048, False, True, False, False, True, maxFollowers,
0, 100, 1024, 5, False,
@ -923,7 +923,7 @@ def createServerBob(path: str, domain: str, port: int,
i2pDomain = None
allowLocalNetworkAccess = True
maxNewswirePosts = 20
dormantMonths = 3
dormant_months = 3
send_threads_timeout_mins = 30
maxFollowers = 10
verify_all_signatures = True
@ -949,7 +949,7 @@ def createServerBob(path: str, domain: str, port: int,
broch_mode,
verify_all_signatures,
send_threads_timeout_mins,
dormantMonths, maxNewswirePosts,
dormant_months, maxNewswirePosts,
allowLocalNetworkAccess,
2048, False, True, False, False, True, maxFollowers,
0, 100, 1024, 5, False, 0,
@ -992,7 +992,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
i2pDomain = None
allowLocalNetworkAccess = True
maxNewswirePosts = 20
dormantMonths = 3
dormant_months = 3
send_threads_timeout_mins = 30
maxFollowers = 10
verify_all_signatures = True
@ -1019,7 +1019,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
broch_mode,
verify_all_signatures,
send_threads_timeout_mins,
dormantMonths, maxNewswirePosts,
dormant_months, maxNewswirePosts,
allowLocalNetworkAccess,
2048, False, True, False, False, True, maxFollowers,
0, 100, 1024, 5, False, 0,
@ -1064,7 +1064,7 @@ def createServerGroup(path: str, domain: str, port: int,
i2pDomain = None
allowLocalNetworkAccess = True
maxNewswirePosts = 20
dormantMonths = 3
dormant_months = 3
send_threads_timeout_mins = 30
maxFollowers = 10
verify_all_signatures = True
@ -1091,7 +1091,7 @@ def createServerGroup(path: str, domain: str, port: int,
broch_mode,
verify_all_signatures,
send_threads_timeout_mins,
dormantMonths, maxNewswirePosts,
dormant_months, maxNewswirePosts,
allowLocalNetworkAccess,
2048, False, True, False, False, True, maxFollowers,
0, 100, 1024, 5, False,

View File

@ -253,7 +253,7 @@ def getFullDomain(domain: str, port: int) -> 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
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
timeDiffMonths = \
int((currDaysSinceEpoch - daysSinceEpoch) / 30)
if timeDiffMonths >= dormantMonths:
if timeDiffMonths >= dormant_months:
return True
return False

View File

@ -53,7 +53,7 @@ def htmlPersonOptions(defaultTimeline: str,
PGPpubKey: str,
PGPfingerprint: str,
emailAddress: str,
dormantMonths: int,
dormant_months: int,
backToPath: str,
lockedAccount: bool,
movedTo: str,
@ -94,7 +94,7 @@ def htmlPersonOptions(defaultTimeline: str,
followStr = 'Leave'
dormant = \
isDormant(base_dir, nickname, domain, optionsActor,
dormantMonths)
dormant_months)
optionsNickname = getNicknameFromActor(optionsActor)
optionsDomainFull = getFullDomain(optionsDomain, optionsPort)

View File

@ -550,7 +550,7 @@ def htmlProfile(signingPrivateKeyPem: str,
yt_replace_domain: str,
twitterReplacementDomain: str,
showPublishedDateOnly: bool,
newswire: {}, theme: str, dormantMonths: int,
newswire: {}, theme: str, dormant_months: int,
peertubeInstances: [],
allowLocalNetworkAccess: bool,
textModeBanner: str,
@ -976,7 +976,7 @@ def htmlProfile(signingPrivateKeyPem: str,
cachedWebfingers, personCache, extraJson,
projectVersion, ["unfollow"], selected,
usersPath, pageNumber, maxItemsPerPage,
dormantMonths, debug,
dormant_months, debug,
signingPrivateKeyPem)
if selected == 'followers':
profileStr += \
@ -986,7 +986,7 @@ def htmlProfile(signingPrivateKeyPem: str,
cachedWebfingers, personCache, extraJson,
projectVersion, ["block"],
selected, usersPath, pageNumber,
maxItemsPerPage, dormantMonths, debug,
maxItemsPerPage, dormant_months, debug,
signingPrivateKeyPem)
if not isGroup:
if selected == 'roles':
@ -1099,7 +1099,7 @@ def _htmlProfileFollowing(translate: {}, base_dir: str, http_prefix: str,
feedName: str, actor: str,
pageNumber: int,
maxItemsPerPage: int,
dormantMonths: int, debug: bool,
dormant_months: int, debug: bool,
signingPrivateKeyPem: str) -> str:
"""Shows following on the profile screen
"""
@ -1124,7 +1124,7 @@ def _htmlProfileFollowing(translate: {}, base_dir: str, http_prefix: str,
if authorized and feedName == 'following':
dormant = \
isDormant(base_dir, nickname, domain, followingActor,
dormantMonths)
dormant_months)
profileStr += \
_individualFollowAsHtml(signingPrivateKeyPem,