forked from indymedia/epicyon
Try different cases when setting title
parent
b55df96f3a
commit
c3ce17cb6b
9
utils.py
9
utils.py
|
@ -23,7 +23,14 @@ def getHashtagCategory(baseDir: str, hashtag: str) -> str:
|
||||||
"""Returns the category for the hashtag
|
"""Returns the category for the hashtag
|
||||||
"""
|
"""
|
||||||
categoryFilename = baseDir + '/tags/' + hashtag + '.category'
|
categoryFilename = baseDir + '/tags/' + hashtag + '.category'
|
||||||
if os.path.isfile(categoryFilename):
|
if not os.path.isfile(categoryFilename):
|
||||||
|
categoryFilename = baseDir + '/tags/' + hashtag.title() + '.category'
|
||||||
|
if not os.path.isfile(categoryFilename):
|
||||||
|
categoryFilename = \
|
||||||
|
baseDir + '/tags/' + hashtag.upper() + '.category'
|
||||||
|
if not os.path.isfile(categoryFilename):
|
||||||
|
return ''
|
||||||
|
|
||||||
with open(categoryFilename, 'r') as fp:
|
with open(categoryFilename, 'r') as fp:
|
||||||
categoryStr = fp.read()
|
categoryStr = fp.read()
|
||||||
if categoryStr:
|
if categoryStr:
|
||||||
|
|
Loading…
Reference in New Issue