Snake case

main
Bob Mottram 2021-12-25 21:11:35 +00:00
parent 3c1c0f2feb
commit 5aa2e2f7c3
5 changed files with 27 additions and 27 deletions

View File

@ -534,7 +534,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domainFull,
postJsonObject,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
# record the vote
try:
@ -16652,7 +16652,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domainFull,
messageJson,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
return 1
else:
@ -16729,7 +16729,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domainFull,
messageJson,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
return 1
else:
@ -16879,7 +16879,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domain,
messageJson,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
return 1
else:
@ -16931,7 +16931,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domain,
messageJson,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
return 1
else:
@ -16990,7 +16990,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.http_prefix,
self.server.domain,
messageJson,
self.server.maxReplies,
self.server.max_replies,
self.server.debug)
return 1
else:
@ -18476,7 +18476,7 @@ def runDaemon(content_license_url: str,
fed_list: [] = [],
max_mentions: int = 10, max_emoji: int = 10,
secure_mode: bool = False,
proxy_type: str = None, maxReplies: int = 64,
proxy_type: str = None, max_replies: int = 64,
domainMaxPostsPerDay: int = 8640,
accountMaxPostsPerDay: int = 864,
allowDeletion: bool = False,
@ -18757,7 +18757,7 @@ def runDaemon(content_license_url: str,
httpd.lastLoginFailure = 0
httpd.loginFailureCount = {}
httpd.log_login_failures = log_login_failures
httpd.maxReplies = maxReplies
httpd.max_replies = max_replies
httpd.tokens = {}
httpd.tokensLookup = {}
loadTokens(base_dir, httpd.tokens, httpd.tokensLookup)
@ -18927,7 +18927,7 @@ def runDaemon(content_license_url: str,
domain, onion_domain, i2p_domain,
port, proxy_type,
httpd.federationList,
maxReplies,
max_replies,
domainMaxPostsPerDay,
accountMaxPostsPerDay,
allowDeletion, debug,

View File

@ -640,7 +640,7 @@ def _showLikesOnPost(postJsonObject: {}, maxLikes: int) -> None:
break
def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None:
def _showRepliesOnPost(postJsonObject: {}, max_replies: int) -> None:
"""Shows the replies on a post
"""
if not hasObjectDict(postJsonObject):
@ -659,7 +659,7 @@ def _showRepliesOnPost(postJsonObject: {}, maxReplies: int) -> None:
for item in objectReplies['items']:
print('' + str(item['url']))
ctr += 1
if ctr >= maxReplies:
if ctr >= max_replies:
break

View File

@ -556,7 +556,7 @@ parser.add_argument('--deny', dest='deny', type=str, default=None,
parser.add_argument("-c", "--client", type=str2bool, nargs='?',
const=True, default=False,
help="Use as an ActivityPub client")
parser.add_argument('--maxreplies', dest='maxReplies', type=int, default=64,
parser.add_argument('--maxreplies', dest='max_replies', type=int, default=64,
help='Maximum number of replies to a post')
parser.add_argument('--max_mentions', '--hellthread', dest='max_mentions',
type=int, default=10,
@ -3253,7 +3253,7 @@ if __name__ == "__main__":
port, proxy_port, http_prefix,
federationList, args.max_mentions,
args.max_emoji, args.secure_mode,
proxy_type, args.maxReplies,
proxy_type, args.max_replies,
args.domainMaxPostsPerDay,
args.accountMaxPostsPerDay,
args.allowdeletion, debug, False,

View File

@ -2105,7 +2105,7 @@ def _postAllowsComments(postFilename: str) -> bool:
def populateReplies(base_dir: str, http_prefix: str, domain: str,
messageJson: {}, maxReplies: int, debug: bool) -> bool:
messageJson: {}, max_replies: int, debug: bool) -> bool:
"""Updates the list of replies for a post on this domain if
a reply to it arrives
"""
@ -2155,7 +2155,7 @@ def populateReplies(base_dir: str, http_prefix: str, domain: str,
messageId = removeIdEnding(messageJson['id'])
if os.path.isfile(postRepliesFilename):
numLines = sum(1 for line in open(postRepliesFilename))
if numLines > maxReplies:
if numLines > max_replies:
return False
if messageId not in open(postRepliesFilename).read():
try:
@ -3185,7 +3185,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
port: int, proxy_type: str,
federationList: [], debug: bool,
queueFilename: str, destinationFilename: str,
maxReplies: int, allowDeletion: bool,
max_replies: int, allowDeletion: bool,
max_mentions: int, max_emoji: int, translate: {},
unitTest: bool,
yt_replace_domain: str,
@ -3446,7 +3446,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int,
# list of indexes to be updated
updateIndexList = ['inbox']
populateReplies(base_dir, http_prefix, domain, postJsonObject,
maxReplies, debug)
max_replies, debug)
_receiveQuestionVote(base_dir, nickname, domain,
http_prefix, handle, debug,
@ -4067,7 +4067,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
domain: str,
onion_domain: str, i2p_domain: str,
port: int, proxy_type: str,
federationList: [], maxReplies: int,
federationList: [], max_replies: int,
domainMaxPostsPerDay: int,
accountMaxPostsPerDay: int,
allowDeletion: bool, debug: bool, max_mentions: int,
@ -4500,7 +4500,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
federationList,
debug,
queueFilename, destination,
maxReplies, allowDeletion,
max_replies, allowDeletion,
max_mentions, max_emoji,
translate, unitTest,
yt_replace_domain,

View File

@ -693,7 +693,7 @@ def createServerAlice(path: str, domain: str, port: int,
http_prefix = 'http'
proxy_type = None
password = 'alicepass'
maxReplies = 64
max_replies = 64
domainMaxPostsPerDay = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
@ -816,7 +816,7 @@ def createServerAlice(path: str, domain: str, port: int,
"instance_id", False, path, domain,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, maxReplies,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)
@ -838,7 +838,7 @@ def createServerBob(path: str, domain: str, port: int,
proxy_type = None
client_to_server = False
password = 'bobpass'
maxReplies = 64
max_replies = 64
domainMaxPostsPerDay = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
@ -958,7 +958,7 @@ def createServerBob(path: str, domain: str, port: int,
"instance_id", False, path, domain,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, maxReplies,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)
@ -977,7 +977,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
http_prefix = 'http'
proxy_type = None
password = 'evepass'
maxReplies = 64
max_replies = 64
allowDeletion = True
privateKeyPem, publicKeyPem, person, wfEndpoint = \
createPerson(path, nickname, domain, port, http_prefix, True,
@ -1028,7 +1028,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [],
"instance_id", False, path, domain,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, maxReplies, allowDeletion, True, True, False,
proxy_type, max_replies, allowDeletion, True, True, False,
sendThreads, False)
@ -1047,7 +1047,7 @@ def createServerGroup(path: str, domain: str, port: int,
http_prefix = 'http'
proxy_type = None
password = 'testgrouppass'
maxReplies = 64
max_replies = 64
domainMaxPostsPerDay = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
@ -1100,7 +1100,7 @@ def createServerGroup(path: str, domain: str, port: int,
"instance_id", False, path, domain,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, maxReplies,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)