Snake case

merge-requests/22/merge
Bob Mottram 2021-12-25 19:42:14 +00:00
parent cbbe8812bd
commit 464084e507
3 changed files with 15 additions and 15 deletions

View File

@ -18439,7 +18439,7 @@ def runDaemon(content_license_url: str,
show_publish_as_icon: bool,
max_followers: int,
max_news_posts: int,
maxMirroredArticles: int,
max_mirrored_articles: int,
maxNewswireFeedSizeKb: int,
max_newswire_postsPerSource: int,
showPublishedDateOnly: bool,
@ -18647,7 +18647,7 @@ def runDaemon(content_license_url: str,
httpd.showPublishedDateOnly = showPublishedDateOnly
# maximum number of news articles to mirror
httpd.maxMirroredArticles = maxMirroredArticles
httpd.max_mirrored_articles = max_mirrored_articles
# maximum number of posts in the news timeline/outbox
httpd.max_news_posts = max_news_posts

View File

@ -204,8 +204,8 @@ parser.add_argument('--max_feed_item_size_kb',
default=2048,
help='Maximum size of an individual rss/atom ' +
'feed item in K')
parser.add_argument('--maxMirroredArticles',
dest='maxMirroredArticles', type=int,
parser.add_argument('--max_mirrored_articles',
dest='max_mirrored_articles', type=int,
default=100,
help='Maximum number of news articles to mirror.' +
' Set to zero for indefinite mirroring.')
@ -3043,10 +3043,10 @@ maxNewswireFeedSizeKb = \
if maxNewswireFeedSizeKb:
args.maxNewswireFeedSizeKb = int(maxNewswireFeedSizeKb)
maxMirroredArticles = \
getConfigParam(base_dir, 'maxMirroredArticles')
if maxMirroredArticles is not None:
args.maxMirroredArticles = int(maxMirroredArticles)
max_mirrored_articles = \
getConfigParam(base_dir, 'max_mirrored_articles')
if max_mirrored_articles is not None:
args.max_mirrored_articles = int(max_mirrored_articles)
max_news_posts = \
getConfigParam(base_dir, 'max_news_posts')
@ -3234,7 +3234,7 @@ if __name__ == "__main__":
args.show_publish_as_icon,
args.max_followers,
args.max_news_posts,
args.maxMirroredArticles,
args.max_mirrored_articles,
args.maxNewswireFeedSizeKb,
args.max_newswire_postsPerSource,
args.dateonly,

View File

@ -440,7 +440,7 @@ def _newswireHashtagProcessing(session, base_dir: str, postJsonObject: {},
def _createNewsMirror(base_dir: str, domain: str,
postIdNumber: str, url: str,
maxMirroredArticles: int) -> bool:
max_mirrored_articles: int) -> bool:
"""Creates a local mirror of a news article
"""
if '|' in url or '>' in url:
@ -457,7 +457,7 @@ def _createNewsMirror(base_dir: str, domain: str,
mirrorIndexFilename = base_dir + '/accounts/newsmirror.txt'
if maxMirroredArticles > 0 and noOfDirs > maxMirroredArticles:
if max_mirrored_articles > 0 and noOfDirs > max_mirrored_articles:
if not os.path.isfile(mirrorIndexFilename):
# no index for mirrors found
return True
@ -465,7 +465,7 @@ def _createNewsMirror(base_dir: str, domain: str,
with open(mirrorIndexFilename, 'r') as indexFile:
# remove the oldest directories
ctr = 0
while noOfDirs > maxMirroredArticles:
while noOfDirs > max_mirrored_articles:
ctr += 1
if ctr > 5000:
# escape valve
@ -542,7 +542,7 @@ def _convertRSStoActivityPub(base_dir: str, http_prefix: str,
personCache: {},
federationList: [],
sendThreads: [], postLog: [],
maxMirroredArticles: int,
max_mirrored_articles: int,
allow_local_network_access: bool,
systemLanguage: str,
low_bandwidth: bool,
@ -645,7 +645,7 @@ def _convertRSStoActivityPub(base_dir: str, http_prefix: str,
if mirrored:
if not _createNewsMirror(base_dir, domain, statusNumber,
url, maxMirroredArticles):
url, max_mirrored_articles):
continue
idStr = \
@ -833,7 +833,7 @@ def runNewswireDaemon(base_dir: str, httpd,
httpd.federationList,
httpd.sendThreads,
httpd.postLog,
httpd.maxMirroredArticles,
httpd.max_mirrored_articles,
httpd.allow_local_network_access,
httpd.systemLanguage,
httpd.low_bandwidth,