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() tagsFile.close()
else: else:
if postUrl not in open(tagsFilename).read(): if postUrl not in open(tagsFilename).read():
tagsFile=open(tagsFilename, "a+") try:
if tagsFile: with open(tagsFilename, 'r+') as tagsFile:
tagsFile.write(postUrl+'\n') content = tagsFile.read()
tagsFile.close() tagsFile.seek(0, 0)
tagsFile.write(postUrl+'\n'+content)
except:
pass
def inboxStorePostToHtmlCache(recentPostsCache: {},maxRecentPosts: int, \ def inboxStorePostToHtmlCache(recentPostsCache: {},maxRecentPosts: int, \
translate: {}, \ translate: {}, \