forked from indymedia/epicyon
Try different cases when setting title
parent
b55df96f3a
commit
c3ce17cb6b
17
utils.py
17
utils.py
|
@ -23,11 +23,18 @@ 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):
|
||||||
with open(categoryFilename, 'r') as fp:
|
categoryFilename = baseDir + '/tags/' + hashtag.title() + '.category'
|
||||||
categoryStr = fp.read()
|
if not os.path.isfile(categoryFilename):
|
||||||
if categoryStr:
|
categoryFilename = \
|
||||||
return categoryStr
|
baseDir + '/tags/' + hashtag.upper() + '.category'
|
||||||
|
if not os.path.isfile(categoryFilename):
|
||||||
|
return ''
|
||||||
|
|
||||||
|
with open(categoryFilename, 'r') as fp:
|
||||||
|
categoryStr = fp.read()
|
||||||
|
if categoryStr:
|
||||||
|
return categoryStr
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue