From 554f86ea4c6b17c33a3dc086aa42c7717eed67a2 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 21 Apr 2018 06:33:26 +0530 Subject: [PATCH] Show results before deleting them --- buku.1 | 6 +++--- buku.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/buku.1 b/buku.1 index 01248fb..5dcf978 100644 --- a/buku.1 +++ b/buku.1 @@ -344,14 +344,14 @@ If defined, will be used as the editor to edit bookmarks with option --write. .TP .BI https_proxy If defined, will be used to access http and https resources through the configured proxy. Supported format: - +.br http[s]://[username:password@]proxyhost:proxyport/ .TP .BI "GUI integration" .B buku -can be integrated in a GUI environment with simple tweaks. Refer to: +can be integrated in a GUI environment with simple tweaks. Please refer to: .br -.I https://github.com/jarun/Buku#gui-integration +.I https://github.com/jarun/Buku/wiki/System-integration .SH COLORS \fBbuku\fR allows you to customize the color scheme via a five-letter string, reminiscent of BSD \fBLSCOLORS\fR. The five letters represent the colors of .IP - 2 diff --git a/buku.py b/buku.py index 2a1b6c6..f7d4b07 100755 --- a/buku.py +++ b/buku.py @@ -1365,6 +1365,12 @@ class BukuDb: return self.cleardb() try: + if self.chatty: + if self.print_rec(0, low, high, True) is True: + resp = input('Delete these bookmarks? (y/n): ') + if resp != 'y': + return False + query = 'DELETE from bookmarks where id BETWEEN ? AND ?' self.cur.execute(query, (low, high)) print('Index %d-%d: %d deleted' % (low, high, self.cur.rowcount)) @@ -1386,6 +1392,12 @@ class BukuDb: return self.cleardb() else: # Remove a single entry try: + if self.chatty: + if self.print_rec(index) is True: + resp = input('Delete this bookmark? (y/n): ') + if resp != 'y': + return False + query = 'DELETE FROM bookmarks WHERE id = ?' self.cur.execute(query, (index,)) if self.cur.rowcount == 1: