forked from indymedia/epicyon
Handle hashtag case
parent
51fbacd691
commit
b55df96f3a
8
utils.py
8
utils.py
|
@ -113,7 +113,13 @@ def setHashtagCategory(baseDir: str, hashtag: str, category: str) -> bool:
|
||||||
|
|
||||||
hashtagFilename = baseDir + '/tags/' + hashtag + '.txt'
|
hashtagFilename = baseDir + '/tags/' + hashtag + '.txt'
|
||||||
if not os.path.isfile(hashtagFilename):
|
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'
|
categoryFilename = baseDir + '/tags/' + hashtag + '.category'
|
||||||
with open(categoryFilename, 'w+') as fp:
|
with open(categoryFilename, 'w+') as fp:
|
||||||
|
|
Loading…
Reference in New Issue