mirror of https://gitlab.com/bashrc2/epicyon
Constructing the features timeline
parent
e5e3987699
commit
16f4e7a312
17
posts.py
17
posts.py
|
@ -2598,7 +2598,7 @@ def createBlogsTimeline(session, baseDir: str, nickname: str, domain: str,
|
||||||
def createFeaturesTimeline(session, baseDir: str, nickname: str, domain: str,
|
def createFeaturesTimeline(session, baseDir: str, nickname: str, domain: str,
|
||||||
port: int, httpPrefix: str, itemsPerPage: int,
|
port: int, httpPrefix: str, itemsPerPage: int,
|
||||||
headerOnly: bool, pageNumber=None) -> {}:
|
headerOnly: bool, pageNumber=None) -> {}:
|
||||||
return createBoxIndexed({}, session, baseDir, 'tlfeatures', 'news',
|
return createBoxIndexed({}, session, baseDir, 'tlfeatures', nickname,
|
||||||
domain, port, httpPrefix,
|
domain, port, httpPrefix,
|
||||||
itemsPerPage, headerOnly, True,
|
itemsPerPage, headerOnly, True,
|
||||||
0, False, 0, pageNumber)
|
0, False, 0, pageNumber)
|
||||||
|
@ -2946,12 +2946,14 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
# bookmarks and events timelines are like the inbox
|
# bookmarks and events timelines are like the inbox
|
||||||
# but have their own separate index
|
# but have their own separate index
|
||||||
indexBoxName = boxname
|
indexBoxName = boxname
|
||||||
|
timelineNickname = nickname
|
||||||
if boxname == "tlbookmarks":
|
if boxname == "tlbookmarks":
|
||||||
boxname = "bookmarks"
|
boxname = "bookmarks"
|
||||||
indexBoxName = boxname
|
indexBoxName = boxname
|
||||||
elif boxname == "tlfeatures":
|
elif boxname == "tlfeatures":
|
||||||
boxname = "tlblogs"
|
boxname = "tlblogs"
|
||||||
indexBoxName = boxname
|
indexBoxName = boxname
|
||||||
|
timelineNickname = 'news'
|
||||||
|
|
||||||
if port:
|
if port:
|
||||||
if port != 80 and port != 443:
|
if port != 80 and port != 443:
|
||||||
|
@ -2989,7 +2991,7 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
postsInBox = []
|
postsInBox = []
|
||||||
|
|
||||||
indexFilename = \
|
indexFilename = \
|
||||||
baseDir + '/accounts/' + nickname + '@' + domain + \
|
baseDir + '/accounts/' + timelineNickname + '@' + domain + \
|
||||||
'/' + indexBoxName + '.index'
|
'/' + indexBoxName + '.index'
|
||||||
postsCtr = 0
|
postsCtr = 0
|
||||||
if os.path.isfile(indexFilename):
|
if os.path.isfile(indexFilename):
|
||||||
|
@ -3073,6 +3075,17 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
if fullPostFilename:
|
if fullPostFilename:
|
||||||
addPostToTimeline(fullPostFilename, boxname,
|
addPostToTimeline(fullPostFilename, boxname,
|
||||||
postsInBox, boxActor)
|
postsInBox, boxActor)
|
||||||
|
else:
|
||||||
|
# if this is the features timeline
|
||||||
|
if timelineNickname != nickname:
|
||||||
|
fullPostFilename = \
|
||||||
|
locatePost(baseDir, timelineNickname,
|
||||||
|
domain, postUrl, False)
|
||||||
|
if fullPostFilename:
|
||||||
|
addPostToTimeline(fullPostFilename, boxname,
|
||||||
|
postsInBox, boxActor)
|
||||||
|
else:
|
||||||
|
print('WARN: unable to locate post ' + postUrl)
|
||||||
else:
|
else:
|
||||||
print('WARN: unable to locate post ' + postUrl)
|
print('WARN: unable to locate post ' + postUrl)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue