diff options
Diffstat (limited to 'lib/web.py')
-rw-r--r-- | lib/web.py | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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: |