Handle hashtag case

main
Bob Mottram 2020-12-03 12:42:12 +00:00
parent 51fbacd691
commit b55df96f3a
1 changed files with 7 additions and 1 deletions

View File

@ -113,7 +113,13 @@ def setHashtagCategory(baseDir: str, hashtag: str, category: str) -> bool:
hashtagFilename = baseDir + '/tags/' + hashtag + '.txt'
if not os.path.isfile(hashtagFilename):
return False
hashtag = hashtag.title()
hashtagFilename = baseDir + '/tags/' + hashtag + '.txt'
if not os.path.isfile(hashtagFilename):
hashtag = hashtag.upper()
hashtagFilename = baseDir + '/tags/' + hashtag + '.txt'
if not os.path.isfile(hashtagFilename):
return False
categoryFilename = baseDir + '/tags/' + hashtag + '.category'
with open(categoryFilename, 'w+') as fp: