Small changes for debugging
This commit is contained in:
parent
8efebfd666
commit
996e61a8a0
1 changed files with 5 additions and 12 deletions
17
main.py
17
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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()
|
||||
|
||||
|
||||
|
|
Reference in a new issue