Prepend to tags file

merge-requests/6/head
Bob Mottram 2019-12-12 17:47:16 +00:00
parent 8ef0a72489
commit 7eca0b33be
1 changed files with 7 additions and 4 deletions

View File

@ -94,10 +94,13 @@ def storeHashTags(baseDir: str,postJsonObject: {}) -> None:
tagsFile.close()
else:
if postUrl not in open(tagsFilename).read():
tagsFile=open(tagsFilename, "a+")
if tagsFile:
tagsFile.write(postUrl+'\n')
tagsFile.close()
try:
with open(tagsFilename, 'r+') as tagsFile:
content = tagsFile.read()
tagsFile.seek(0, 0)
tagsFile.write(postUrl+'\n'+content)
except:
pass
def inboxStorePostToHtmlCache(recentPostsCache: {},maxRecentPosts: int, \
translate: {}, \