Snake case

main
Bob Mottram 2021-12-25 21:13:55 +00:00
parent 5aa2e2f7c3
commit 73a88716d6
4 changed files with 18 additions and 18 deletions

View File

@ -18477,7 +18477,7 @@ def runDaemon(content_license_url: str,
max_mentions: int = 10, max_emoji: int = 10,
secure_mode: bool = False,
proxy_type: str = None, max_replies: int = 64,
domainMaxPostsPerDay: int = 8640,
domain_max_posts_per_day: int = 8640,
accountMaxPostsPerDay: int = 864,
allowDeletion: bool = False,
debug: bool = False, unitTest: bool = False,
@ -18928,7 +18928,7 @@ def runDaemon(content_license_url: str,
port, proxy_type,
httpd.federationList,
max_replies,
domainMaxPostsPerDay,
domain_max_posts_per_day,
accountMaxPostsPerDay,
allowDeletion, debug,
max_mentions, max_emoji,

View File

@ -591,7 +591,7 @@ parser.add_argument('--filter', dest='filterStr', type=str, default=None,
'cause a message to be ignored')
parser.add_argument('--unfilter', dest='unfilterStr', type=str, default=None,
help='Remove a filter on a particular word or phrase')
parser.add_argument('--domainmax', dest='domainMaxPostsPerDay', type=int,
parser.add_argument('--domainmax', dest='domain_max_posts_per_day', type=int,
default=8640,
help='Maximum number of received posts ' +
'from a domain per day')
@ -3254,7 +3254,7 @@ if __name__ == "__main__":
federationList, args.max_mentions,
args.max_emoji, args.secure_mode,
proxy_type, args.max_replies,
args.domainMaxPostsPerDay,
args.domain_max_posts_per_day,
args.accountMaxPostsPerDay,
args.allowdeletion, debug, False,
args.instanceOnlySkillsSearch, [],

View File

@ -3683,7 +3683,7 @@ def runInboxQueueWatchdog(project_version: str, httpd) -> None:
def _inboxQuotaExceeded(queue: {}, queueFilename: str,
queueJson: {}, quotasDaily: {}, quotasPerMin: {},
domainMaxPostsPerDay: int,
domain_max_posts_per_day: int,
accountMaxPostsPerDay: int,
debug: bool) -> bool:
"""limit the number of posts which can arrive per domain per day
@ -3692,13 +3692,13 @@ def _inboxQuotaExceeded(queue: {}, queueFilename: str,
if not postDomain:
return False
if domainMaxPostsPerDay > 0:
if domain_max_posts_per_day > 0:
if quotasDaily['domains'].get(postDomain):
if quotasDaily['domains'][postDomain] > \
domainMaxPostsPerDay:
domain_max_posts_per_day:
print('Queue: Quota per day - Maximum posts for ' +
postDomain + ' reached (' +
str(domainMaxPostsPerDay) + ')')
str(domain_max_posts_per_day) + ')')
if len(queue) > 0:
try:
os.remove(queueFilename)
@ -3713,7 +3713,7 @@ def _inboxQuotaExceeded(queue: {}, queueFilename: str,
if quotasPerMin['domains'].get(postDomain):
domainMaxPostsPerMin = \
int(domainMaxPostsPerDay / (24 * 60))
int(domain_max_posts_per_day / (24 * 60))
if domainMaxPostsPerMin < 5:
domainMaxPostsPerMin = 5
if quotasPerMin['domains'][postDomain] > \
@ -3778,7 +3778,7 @@ def _inboxQuotaExceeded(queue: {}, queueFilename: str,
quotasPerMin['accounts'][postHandle] = 1
if debug:
if accountMaxPostsPerDay > 0 or domainMaxPostsPerDay > 0:
if accountMaxPostsPerDay > 0 or domain_max_posts_per_day > 0:
pprint(quotasDaily)
return False
@ -4068,7 +4068,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
onion_domain: str, i2p_domain: str,
port: int, proxy_type: str,
federationList: [], max_replies: int,
domainMaxPostsPerDay: int,
domain_max_posts_per_day: int,
accountMaxPostsPerDay: int,
allowDeletion: bool, debug: bool, max_mentions: int,
max_emoji: int, translate: {}, unitTest: bool,
@ -4205,7 +4205,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int,
if _inboxQuotaExceeded(queue, queueFilename,
queueJson, quotasDaily, quotasPerMin,
domainMaxPostsPerDay,
domain_max_posts_per_day,
accountMaxPostsPerDay, debug):
continue

View File

@ -694,7 +694,7 @@ def createServerAlice(path: str, domain: str, port: int,
proxy_type = None
password = 'alicepass'
max_replies = 64
domainMaxPostsPerDay = 1000
domain_max_posts_per_day = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
low_bandwidth = True
@ -817,7 +817,7 @@ def createServerAlice(path: str, domain: str, port: int,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
domain_max_posts_per_day, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)
@ -839,7 +839,7 @@ def createServerBob(path: str, domain: str, port: int,
client_to_server = False
password = 'bobpass'
max_replies = 64
domainMaxPostsPerDay = 1000
domain_max_posts_per_day = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
low_bandwidth = True
@ -959,7 +959,7 @@ def createServerBob(path: str, domain: str, port: int,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
domain_max_posts_per_day, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)
@ -1048,7 +1048,7 @@ def createServerGroup(path: str, domain: str, port: int,
proxy_type = None
password = 'testgrouppass'
max_replies = 64
domainMaxPostsPerDay = 1000
domain_max_posts_per_day = 1000
accountMaxPostsPerDay = 1000
allowDeletion = True
privateKeyPem, publicKeyPem, person, wfEndpoint = \
@ -1101,7 +1101,7 @@ def createServerGroup(path: str, domain: str, port: int,
onion_domain, i2p_domain, None, None, port, port,
http_prefix, federationList, max_mentions, max_emoji, False,
proxy_type, max_replies,
domainMaxPostsPerDay, accountMaxPostsPerDay,
domain_max_posts_per_day, accountMaxPostsPerDay,
allowDeletion, True, True, False, sendThreads,
False)