Show error once
Show error string only once when deleting a non-existent record by index. E.g.: buku -d non_existent_id Fix indentation issue.
This commit is contained in:
parent
c5b39b8491
commit
4b4e5ffe37
6
buku.py
6
buku.py
@ -1362,6 +1362,12 @@ class BukuDb:
|
|||||||
else: # Remove a single entry
|
else: # Remove a single entry
|
||||||
try:
|
try:
|
||||||
if self.chatty:
|
if self.chatty:
|
||||||
|
self.cur.execute('SELECT COUNT(*) FROM bookmarks WHERE id = ? LIMIT 1', (index,))
|
||||||
|
count = self.cur.fetchone()
|
||||||
|
if (count[0] < 1):
|
||||||
|
logerr('No matching index %d', index)
|
||||||
|
return False
|
||||||
|
|
||||||
if self.print_rec(index) is True:
|
if self.print_rec(index) is True:
|
||||||
resp = input('Delete this bookmark? (y/n): ')
|
resp = input('Delete this bookmark? (y/n): ')
|
||||||
if resp != 'y':
|
if resp != 'y':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user