mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
ba88f72871
commit
f5321084ff
25
posts.py
25
posts.py
|
@ -2552,7 +2552,7 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
'/' + indexBoxName + '.index'
|
'/' + indexBoxName + '.index'
|
||||||
postsCtr = 0
|
postsCtr = 0
|
||||||
if os.path.isfile(indexFilename):
|
if os.path.isfile(indexFilename):
|
||||||
maxPostCtr = itemsPerPage*pageNumber
|
maxPostCtr = itemsPerPage * pageNumber
|
||||||
with open(indexFilename, 'r') as indexFile:
|
with open(indexFilename, 'r') as indexFile:
|
||||||
while postsCtr < maxPostCtr:
|
while postsCtr < maxPostCtr:
|
||||||
postFilename = indexFile.readline()
|
postFilename = indexFile.readline()
|
||||||
|
@ -2576,7 +2576,6 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
postUrl = \
|
postUrl = \
|
||||||
postFilename.replace('\n', '').replace('.json', '').strip()
|
postFilename.replace('\n', '').replace('.json', '').strip()
|
||||||
|
|
||||||
postAdded = False
|
|
||||||
# is the post cached in memory?
|
# is the post cached in memory?
|
||||||
if recentPostsCache.get('index'):
|
if recentPostsCache.get('index'):
|
||||||
if postUrl in recentPostsCache['index']:
|
if postUrl in recentPostsCache['index']:
|
||||||
|
@ -2585,18 +2584,18 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
addPostStringToTimeline(url,
|
addPostStringToTimeline(url,
|
||||||
boxname, postsInBox,
|
boxname, postsInBox,
|
||||||
boxActor)
|
boxActor)
|
||||||
postAdded = True
|
postsCtr += 1
|
||||||
|
continue
|
||||||
|
|
||||||
if not postAdded:
|
# read the post from file
|
||||||
# read the post from file
|
fullPostFilename = \
|
||||||
fullPostFilename = \
|
locatePost(baseDir, nickname,
|
||||||
locatePost(baseDir, nickname,
|
domain, postUrl, False)
|
||||||
domain, postUrl, False)
|
if fullPostFilename:
|
||||||
if fullPostFilename:
|
addPostToTimeline(fullPostFilename, boxname,
|
||||||
addPostToTimeline(fullPostFilename, boxname,
|
postsInBox, boxActor)
|
||||||
postsInBox, boxActor)
|
else:
|
||||||
else:
|
print('WARN: unable to locate post ' + postUrl)
|
||||||
print('WARN: unable to locate post ' + postUrl)
|
|
||||||
|
|
||||||
postsCtr += 1
|
postsCtr += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue