|
|
@ -46,14 +46,15 @@ def find_content(article, length, head, tail):
|
|
|
|
content = ""
|
|
|
|
content = ""
|
|
|
|
with open('entries/feature/' + article) as f:
|
|
|
|
with open('entries/feature/' + article) as f:
|
|
|
|
for pos, line in enumerate(f):
|
|
|
|
for pos, line in enumerate(f):
|
|
|
|
if pos > head and pos < length - tail:
|
|
|
|
if pos > head + 1 and pos < length - tail:
|
|
|
|
content += line
|
|
|
|
content += line
|
|
|
|
return content
|
|
|
|
return content
|
|
|
|
|
|
|
|
|
|
|
|
def snip_article(article):
|
|
|
|
def snip_article(article):
|
|
|
|
limit = 300
|
|
|
|
limit = 300
|
|
|
|
cut = article[0:min(len(article),limit)]
|
|
|
|
result = article[0:min(len(article),limit)]
|
|
|
|
result = cut.rsplit(' ',1)[0]
|
|
|
|
result = result.replace('<br>','')
|
|
|
|
|
|
|
|
result = result.rsplit(' ',1)[0]
|
|
|
|
return result + " ... "
|
|
|
|
return result + " ... "
|
|
|
|
|
|
|
|
|
|
|
|
def sort_files(files):
|
|
|
|
def sort_files(files):
|
|
|
|