From 0f04eb165022fd5b919d8c7d9ec5c8eb8659c972 Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Sat, 22 Mar 2014 13:01:12 +0100 Subject: [PATCH] derp --- tell.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tell.py b/tell.py index 4867a11..24fe43b 100755 --- a/tell.py +++ b/tell.py @@ -18,11 +18,13 @@ def tell_diskwr(): db = sqlite3.connect("tell.sqlite") c = db.cursor() for tr in tell_pending: - if tr == "del": + if tr[0] == "del": c.execute("DELETE FROM tell WHERE id = ?", (tr[1], )) - elif tr == "add": + elif tr[0] == "add": c.execute("INSERT INTO tell (nick, tellee, msg, time) VALUES (?,?,?,?)", tr[1]) tell_list.append((c.lastrowid, ) + tr[1]) # We actually insert the entry into the list here + else: + print("[Tell] Internal error: Unknown action type '%s'" % tr[0]) c.close() db.commit() db.close()