From 6572e57d9d39ac6c866f060bfdf60c56ea07210c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 6 Nov 2019 14:54:17 +0000 Subject: [PATCH] List index --- posts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/posts.py b/posts.py index aec13fbc..81470337 100644 --- a/posts.py +++ b/posts.py @@ -2297,11 +2297,9 @@ def archivePostsForPerson(httpPrefix: str,nickname: str,domain: str,baseDir: str publishedStr=content.split('"published":')[1] if '"' in publishedStr: publishedStr=publishedStr.split('"')[1] - print('publishedStr: '+publishedStr) - postsInBoxDict[secondsSinceEpoch]=postFilename - postsCtr+=1 - - return + if publishedStr.endswith('Z'): + postsInBoxDict[publishedStr]=postFilename + postsCtr+=1 noOfPosts=postsCtr if noOfPosts<=maxPostsInBox: @@ -2313,7 +2311,9 @@ def archivePostsForPerson(httpPrefix: str,nickname: str,domain: str,baseDir: str # directory containing cached html posts postCacheDir=boxDir.replace('/'+boxname,'/postcache') - for secondsSinceEpoch,postFilename in postsInBoxSorted.items(): + for publishedStr,postFilename in postsInBoxSorted.items(): + print('publishedStr: '+publishedStr) + break filePath=os.path.join(boxDir,postFilename) if not os.path.isfile(filePath): continue