From 996e61a8a0eb16a6f905722a849fc118d4c1efad Mon Sep 17 00:00:00 2001 From: Ione 15 Date: Thu, 28 Mar 2024 00:26:32 +0100 Subject: [PATCH] Small changes for debugging --- main.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index c9cfca2..e56597e 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,3 @@ -Ion-Todo-Planner -Copyright (C) 2024 Ione 15 - -This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License along with this program. If not, see . - import sqlite3 from datetime import datetime import time @@ -14,6 +5,7 @@ import tkinter as tk con = sqlite3.connect("todo.db") cur = con.cursor() +tasklist = {} def get_time(): @@ -44,7 +36,7 @@ def add_item_dialog(): def add_item(entry, input_field): item = entry.get() - print("a") + print("added " + item) if item: listbox.insert(tk.END, item) cur.execute("INSERT INTO todo(\"ID\",\"TODO\",\"CREATION_DATE\",\"DUE_DATE\",\"PRIO\",\"IMP\") VALUES (NULL, " @@ -57,6 +49,7 @@ def remove_item(): selected_index = listbox.curselection() if selected_index: listbox.delete(selected_index) + print(selected_index) def update_list(): @@ -75,9 +68,9 @@ def update_list(): if int(importance[i]) == 0: importance[i] = 1 print("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1)) + print("Priority of Task ID " + str(i+1) + " Set to: " + str(importance[i])) cur.execute("UPDATE todo SET IMP = %s WHERE ID = %s" % (int(importance[i]), i + 1)) - print(i) - listbox.insert(tk.END, res[i][1]) + listbox.insert(tk.END, str(res[i][0])+":"+ res[i][1]) con.commit()