From 464084e50779a9435897126b73ce26f090f04a09 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 25 Dec 2021 19:42:14 +0000 Subject: [PATCH] Snake case --- daemon.py | 4 ++-- epicyon.py | 14 +++++++------- newsdaemon.py | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/daemon.py b/daemon.py index c77b6ca5e..2b30bf176 100644 --- a/daemon.py +++ b/daemon.py @@ -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 diff --git a/epicyon.py b/epicyon.py index 0610f5a4a..b25566b92 100644 --- a/epicyon.py +++ b/epicyon.py @@ -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, diff --git a/newsdaemon.py b/newsdaemon.py index 7c3fcf322..8dd55ec4f 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -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,