forked from indymedia/epicyon
Simplify
parent
5357bc8223
commit
395ee53424
|
@ -39,25 +39,15 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str:
|
||||||
continue
|
continue
|
||||||
with open(tagsFilename, 'r') as tagsFile:
|
with open(tagsFilename, 'r') as tagsFile:
|
||||||
line = tagsFile.readline()
|
line = tagsFile.readline()
|
||||||
lineCtr = 1
|
|
||||||
tagCtr = 0
|
tagCtr = 0
|
||||||
maxLineCtr = 1
|
|
||||||
while line:
|
while line:
|
||||||
if ' ' not in line:
|
if ' ' not in line:
|
||||||
line = tagsFile.readline()
|
line = tagsFile.readline()
|
||||||
lineCtr += 1
|
break
|
||||||
# don't read too many lines
|
|
||||||
if lineCtr >= maxLineCtr:
|
|
||||||
break
|
|
||||||
continue
|
|
||||||
postDaysSinceEpochStr = line.split(' ')[0]
|
postDaysSinceEpochStr = line.split(' ')[0]
|
||||||
if not postDaysSinceEpochStr.isdigit():
|
if not postDaysSinceEpochStr.isdigit():
|
||||||
line = tagsFile.readline()
|
line = tagsFile.readline()
|
||||||
lineCtr += 1
|
break
|
||||||
# don't read too many lines
|
|
||||||
if lineCtr >= maxLineCtr:
|
|
||||||
break
|
|
||||||
continue
|
|
||||||
postDaysSinceEpoch = int(postDaysSinceEpochStr)
|
postDaysSinceEpoch = int(postDaysSinceEpochStr)
|
||||||
if postDaysSinceEpoch < daysSinceEpoch:
|
if postDaysSinceEpoch < daysSinceEpoch:
|
||||||
break
|
break
|
||||||
|
@ -67,10 +57,7 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str:
|
||||||
tagCtr += 1
|
tagCtr += 1
|
||||||
|
|
||||||
line = tagsFile.readline()
|
line = tagsFile.readline()
|
||||||
lineCtr += 1
|
break
|
||||||
# don't read too many lines
|
|
||||||
if lineCtr >= maxLineCtr:
|
|
||||||
break
|
|
||||||
|
|
||||||
if not tagSwarm:
|
if not tagSwarm:
|
||||||
return ''
|
return ''
|
||||||
|
|
Loading…
Reference in New Issue