forked from indymedia/epicyon
Blog posts going into the newswire may not always be local.
They may be whatever federated to each users blog timeline.main
parent
77dc42c343
commit
2d7e6f4f43
10
newswire.py
10
newswire.py
|
@ -241,9 +241,9 @@ def isTrustedByNewswire(baseDir: str, nickname: str) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def addLocalBlogsToNewswire(baseDir: str, newswire: {},
|
def addBlogsToNewswire(baseDir: str, newswire: {},
|
||||||
maxBlogsPerAccount: int) -> None:
|
maxBlogsPerAccount: int) -> None:
|
||||||
"""Adds blogs from this instance into the newswire
|
"""Adds blogs from each user account into the newswire
|
||||||
"""
|
"""
|
||||||
# go through each account
|
# go through each account
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
for subdir, dirs, files in os.walk(baseDir + '/accounts'):
|
||||||
|
@ -292,8 +292,8 @@ def getDictFromNewswire(session, baseDir: str) -> {}:
|
||||||
for dateStr, item in itemsList.items():
|
for dateStr, item in itemsList.items():
|
||||||
result[dateStr] = item
|
result[dateStr] = item
|
||||||
|
|
||||||
# add local content
|
# add blogs from each user account
|
||||||
addLocalBlogsToNewswire(baseDir, result, 5)
|
addBlogsToNewswire(baseDir, result, 5)
|
||||||
|
|
||||||
# sort into chronological order, latest first
|
# sort into chronological order, latest first
|
||||||
sortedResult = OrderedDict(sorted(result.items(), reverse=True))
|
sortedResult = OrderedDict(sorted(result.items(), reverse=True))
|
||||||
|
|
Loading…
Reference in New Issue