summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorroot <root@turin.home>2022-02-03 18:12:15 +0000
committerroot <root@turin.home>2022-02-03 18:12:15 +0000
commit57f8aeeed6b5cd00910ceba5bc6bef4cbeb32b57 (patch)
treea77e063be0393aa12e3390a176ccedbae5e4625f /main.py
parentc35f2c11bf87629dc457f62bde6b2c2e83c431fa (diff)
Changes from previous commit, fixing differently.
Diffstat (limited to 'main.py')
-rw-r--r--main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.py b/main.py
index 22cdbbf..f6bbb23 100644
--- a/main.py
+++ b/main.py
@@ -75,10 +75,13 @@ def export_choice():
def export(opt):
# Defensive handling of input
if opt in ["temperature", "weather", "history", "schedule"]:
- data = db.exec("select * from {}".format(opt))
+ con = sqlite3.connect(self.dbfile)
+ cur = con.cursor()
+ data = cur.exec("select * from {}".format(opt))
o = ""
for i in data:
o += str(a) + "\n"
+ con.close()
return o
else:
return render_template(