summaryrefslogtreecommitdiff
path: root/lib/web.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/web.py')
-rw-r--r--lib/web.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/web.py b/lib/web.py
index 69522f8..bbad99d 100644
--- a/lib/web.py
+++ b/lib/web.py
@@ -1,11 +1,21 @@
from flask import Flask, render_template
-from .classes import r
+from .config import config
app = Flask(__name__)
@app.route("/")
def hello():
- lista = r.zrange('todo', 0, -1)
+ with open(config['path'], 'rb') as fout:
+ try:
+ lines = fout.readlines()
+ except:
+ lines = ''
+
+ if lines is not None:
+ lista = [x.strip() for i, x in enumerate(lines) if i > 0]
+ else:
+ lista = []
+
try:
return render_template("index.html", list_todo = lista, len_todo = len(lista))
except Exception as e: