diff options
| author | root <root@turin.home> | 2022-02-03 18:12:15 +0000 |
|---|---|---|
| committer | root <root@turin.home> | 2022-02-03 18:12:15 +0000 |
| commit | 57f8aeeed6b5cd00910ceba5bc6bef4cbeb32b57 (patch) | |
| tree | a77e063be0393aa12e3390a176ccedbae5e4625f | |
| parent | c35f2c11bf87629dc457f62bde6b2c2e83c431fa (diff) | |
Changes from previous commit, fixing differently.
| -rw-r--r-- | main.py | 5 | ||||
| -rw-r--r-- | sql.py | 4 |
2 files changed, 6 insertions, 3 deletions
@@ -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( @@ -19,9 +19,9 @@ class db: con = sqlite3.connect(self.dbfile) cur = con.cursor() if param == None: - o = cur.execute(cmd) + cur.execute(cmd) else: - o = cur.execute(cmd, param) + cur.execute(cmd, param) con.commit() con.close() return o |
