From 2da2a331c26e0416d3726c36540dca25f14854f1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 12 Dec 2019 19:18:29 +0000 Subject: [PATCH] Tidying --- inbox.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inbox.py b/inbox.py index a58297497..58ef4ecfe 100644 --- a/inbox.py +++ b/inbox.py @@ -87,10 +87,11 @@ def storeHashTags(baseDir: str,nickname: str,postJsonObject: {}) -> None: tagName=tag['name'].replace('#','').strip() tagsFilename=tagsDir+'/'+tagName+'.txt' postUrl=postJsonObject['id'].replace('/activity','').replace('/','#') + tagline=nickname+' '+postUrl+'\n' if not os.path.isfile(tagsFilename): tagsFile=open(tagsFilename, "w+") if tagsFile: - tagsFile.write(nickname+' '+postUrl+'\n') + tagsFile.write(tagline) tagsFile.close() else: if postUrl not in open(tagsFilename).read(): @@ -98,7 +99,7 @@ def storeHashTags(baseDir: str,nickname: str,postJsonObject: {}) -> None: with open(tagsFilename, 'r+') as tagsFile: content = tagsFile.read() tagsFile.seek(0, 0) - tagsFile.write(nickname+' '+postUrl+'\n'+content) + tagsFile.write(tagline+content) except Exception as e: print('WARN: Failed to write entry to tags file '+ \ tagsFilename+' '+str(e))