diff --git a/test.py b/test.py index 3a4806d..0896042 100644 --- a/test.py +++ b/test.py @@ -5,12 +5,13 @@ import zipfile from flask import Flask, render_template app = Flask(__name__) -@app.route("/") -def main(): - out = [] - data = ["title", - "authors", - "isbn"] +data = [] +attributes= ["title", + "authors", + "isbn"] + +def updateData(): + out = [] f = zipfile.ZipFile("library.tc") tree = ElementTree.parse(f.open("tellico.xml")) @@ -28,7 +29,13 @@ def main(): bookout["authors"] = "; ".join(authors) out.append(bookout.copy()) - return render_template("books.html", books = out, data = data) + return out.copy() + +@app.route("/") +def main(): + data = updateData(); + return render_template("main.html", books = data, attributes = attributes) + if __name__ == "__main__": app.run(debug=True, host='0.0.0.0')