From d9b78f4e4d39b2a6bc97b2cec56212e1b11bc556 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Sun, 4 Oct 2020 21:06:30 -0500 Subject: [PATCH] clean doesn't need the path anymore --- src/index.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/index.py b/src/index.py index af972ed..05319cd 100644 --- a/src/index.py +++ b/src/index.py @@ -1,9 +1,6 @@ import datetime, os, re from bottle import error, route, run, static_file, template -# make article-to-html work with entries -# make index work with entries - later, they can be differentiated into features and weeklies with tags or title or whatever - def list_headlines(articles): head = count_lines('entries/raw/res/head.txt') result = [] @@ -17,7 +14,7 @@ def list_headlines(articles): b = [] b.append(path) - b.append(clean(text[head].replace('
',''), path)) + b.append(clean(text[head].replace('
',''))) result.append(b) return result @@ -61,7 +58,7 @@ def find_content(article, length, head, tail): content += line return content -def clean(result, path): +def clean(result): result = result.replace('
','') result = re.sub(r'', '', result) result = result.replace('','') @@ -70,7 +67,7 @@ def clean(result, path): return result def snip_article(article, path): - article = clean(article, path) + article = clean(article) limit = 300 result = article[0:min(len(article),limit)] result = result.rsplit(' ',1)[0]