mirror of https://gitlab.com/bashrc2/epicyon
Missing parameter
parent
2f513407e4
commit
1b9989bcd3
|
@ -12962,6 +12962,9 @@ def runDaemon(maxNewswirePosts: int,
|
||||||
# maximum size of individual RSS feed items, in K
|
# maximum size of individual RSS feed items, in K
|
||||||
httpd.maxFeedItemSizeKb = maxFeedItemSizeKb
|
httpd.maxFeedItemSizeKb = maxFeedItemSizeKb
|
||||||
|
|
||||||
|
# maximum size of a hashtag category, in K
|
||||||
|
httpd.maxCategoriesFeedItemSizeKb = 256
|
||||||
|
|
||||||
if registration == 'open':
|
if registration == 'open':
|
||||||
httpd.registration = True
|
httpd.registration = True
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -717,7 +717,8 @@ def runNewswireDaemon(baseDir: str, httpd,
|
||||||
httpd.maxNewswireFeedSizeKb,
|
httpd.maxNewswireFeedSizeKb,
|
||||||
httpd.maxTags,
|
httpd.maxTags,
|
||||||
httpd.maxFeedItemSizeKb,
|
httpd.maxFeedItemSizeKb,
|
||||||
httpd.maxNewswirePosts)
|
httpd.maxNewswirePosts,
|
||||||
|
httpd.maxCategoriesFeedItemSizeKb)
|
||||||
|
|
||||||
if not httpd.newswire:
|
if not httpd.newswire:
|
||||||
if os.path.isfile(newswireStateFilename):
|
if os.path.isfile(newswireStateFilename):
|
||||||
|
|
18
newswire.py
18
newswire.py
|
@ -455,7 +455,8 @@ def atomFeedYTToDict(baseDir: str, domain: str, xmlStr: str,
|
||||||
def xmlStrToDict(baseDir: str, domain: str, xmlStr: str,
|
def xmlStrToDict(baseDir: str, domain: str, xmlStr: str,
|
||||||
moderated: bool, mirrored: bool,
|
moderated: bool, mirrored: bool,
|
||||||
maxPostsPerSource: int,
|
maxPostsPerSource: int,
|
||||||
maxFeedItemSizeKb: int) -> {}:
|
maxFeedItemSizeKb: int,
|
||||||
|
maxCategoriesFeedItemSizeKb: int) -> {}:
|
||||||
"""Converts an xml string to a dictionary
|
"""Converts an xml string to a dictionary
|
||||||
"""
|
"""
|
||||||
if '<yt:videoId>' in xmlStr and '<yt:channelId>' in xmlStr:
|
if '<yt:videoId>' in xmlStr and '<yt:channelId>' in xmlStr:
|
||||||
|
@ -466,7 +467,8 @@ def xmlStrToDict(baseDir: str, domain: str, xmlStr: str,
|
||||||
elif 'rss version="2.0"' in xmlStr:
|
elif 'rss version="2.0"' in xmlStr:
|
||||||
return xml2StrToDict(baseDir, domain,
|
return xml2StrToDict(baseDir, domain,
|
||||||
xmlStr, moderated, mirrored,
|
xmlStr, moderated, mirrored,
|
||||||
maxPostsPerSource, maxFeedItemSizeKb)
|
maxPostsPerSource, maxFeedItemSizeKb,
|
||||||
|
maxCategoriesFeedItemSizeKb)
|
||||||
elif 'xmlns="http://www.w3.org/2005/Atom"' in xmlStr:
|
elif 'xmlns="http://www.w3.org/2005/Atom"' in xmlStr:
|
||||||
return atomFeedToDict(baseDir, domain,
|
return atomFeedToDict(baseDir, domain,
|
||||||
xmlStr, moderated, mirrored,
|
xmlStr, moderated, mirrored,
|
||||||
|
@ -489,7 +491,8 @@ def YTchannelToAtomFeed(url: str) -> str:
|
||||||
def getRSS(baseDir: str, domain: str, session, url: str,
|
def getRSS(baseDir: str, domain: str, session, url: str,
|
||||||
moderated: bool, mirrored: bool,
|
moderated: bool, mirrored: bool,
|
||||||
maxPostsPerSource: int, maxFeedSizeKb: int,
|
maxPostsPerSource: int, maxFeedSizeKb: int,
|
||||||
maxFeedItemSizeKb: int) -> {}:
|
maxFeedItemSizeKb: int,
|
||||||
|
maxCategoriesFeedItemSizeKb: int) -> {}:
|
||||||
"""Returns an RSS url as a dict
|
"""Returns an RSS url as a dict
|
||||||
"""
|
"""
|
||||||
if not isinstance(url, str):
|
if not isinstance(url, str):
|
||||||
|
@ -519,7 +522,8 @@ def getRSS(baseDir: str, domain: str, session, url: str,
|
||||||
return xmlStrToDict(baseDir, domain, result.text,
|
return xmlStrToDict(baseDir, domain, result.text,
|
||||||
moderated, mirrored,
|
moderated, mirrored,
|
||||||
maxPostsPerSource,
|
maxPostsPerSource,
|
||||||
maxFeedItemSizeKb)
|
maxFeedItemSizeKb,
|
||||||
|
maxCategoriesFeedItemSizeKb)
|
||||||
else:
|
else:
|
||||||
print('WARN: feed is too large, ' +
|
print('WARN: feed is too large, ' +
|
||||||
'or contains invalid characters: ' + url)
|
'or contains invalid characters: ' + url)
|
||||||
|
@ -753,7 +757,8 @@ def addBlogsToNewswire(baseDir: str, domain: str, newswire: {},
|
||||||
def getDictFromNewswire(session, baseDir: str, domain: str,
|
def getDictFromNewswire(session, baseDir: str, domain: str,
|
||||||
maxPostsPerSource: int, maxFeedSizeKb: int,
|
maxPostsPerSource: int, maxFeedSizeKb: int,
|
||||||
maxTags: int, maxFeedItemSizeKb: int,
|
maxTags: int, maxFeedItemSizeKb: int,
|
||||||
maxNewswirePosts: int) -> {}:
|
maxNewswirePosts: int,
|
||||||
|
maxCategoriesFeedItemSizeKb: int) -> {}:
|
||||||
"""Gets rss feeds as a dictionary from newswire file
|
"""Gets rss feeds as a dictionary from newswire file
|
||||||
"""
|
"""
|
||||||
subscriptionsFilename = baseDir + '/accounts/newswire.txt'
|
subscriptionsFilename = baseDir + '/accounts/newswire.txt'
|
||||||
|
@ -793,7 +798,8 @@ def getDictFromNewswire(session, baseDir: str, domain: str,
|
||||||
itemsList = getRSS(baseDir, domain, session, url,
|
itemsList = getRSS(baseDir, domain, session, url,
|
||||||
moderated, mirrored,
|
moderated, mirrored,
|
||||||
maxPostsPerSource, maxFeedSizeKb,
|
maxPostsPerSource, maxFeedSizeKb,
|
||||||
maxFeedItemSizeKb)
|
maxFeedItemSizeKb,
|
||||||
|
maxCategoriesFeedItemSizeKb)
|
||||||
if itemsList:
|
if itemsList:
|
||||||
for dateStr, item in itemsList.items():
|
for dateStr, item in itemsList.items():
|
||||||
result[dateStr] = item
|
result[dateStr] = item
|
||||||
|
|
Loading…
Reference in New Issue