From 1c982ccd51a55319f459d61f5a007364e734e2c0 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 25 Mar 2016 02:18:36 +0530 Subject: [PATCH] Show new record after add or update. Signed-off-by: Arun Prakash Jana --- buku | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/buku b/buku index ea26c28..e5ac424 100755 --- a/buku +++ b/buku @@ -252,7 +252,8 @@ def AddUpdateEntry(conn, cur, keywords, index): else: cur.execute('INSERT INTO bookmarks(id, URL, metadata, tags) VALUES (?, ?, ?, ?)', (int(addindex), url, meta, tags,)) conn.commit() - print("Added at index %d" % cur.lastrowid) + print("Added at index %d\n" % cur.lastrowid) + printdb(cur, str(cur.lastrowid)) except sqlite3.IntegrityError: for row in cur.execute("SELECT id from bookmarks where URL LIKE ?", (url,)): print("URL already exists at index %s" % row[0]) @@ -264,7 +265,8 @@ def AddUpdateEntry(conn, cur, keywords, index): cur.execute("UPDATE bookmarks SET URL = ?, metadata = ?, tags = ? WHERE id = ?", (url, meta, tags, int(index),)) conn.commit() if cur.rowcount == 1: - print("Updated index %d" % int(index)) + print("Updated index %d\n" % int(index)) + printdb(cur, int(index)) else: print("No matching index") except sqlite3.IntegrityError: