From a9f4cd502ae41271f1a20381149794be2f3d800f Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 20 Jul 2017 10:14:37 +0530 Subject: [PATCH] Honor --tacit: import folder names as tags if True --- README.md | 1 + buku.1 | 1 + buku.py | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f68afc..30d081a 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ SYMBOLS: - Search results are indexed serially. This index is different from actual database index of a bookmark record which is shown within `[]` after the title. - **Import**: - URLs starting with `place:`, `file://` and `apt:` are ignored during import. + - Folder names are automatically imported as tags if --tacit is used. - **Encryption** is optional and manual. AES256 algorithm is used. To use encryption, the database file should be unlocked (-k) before using `buku` and locked (-l) afterwards. Between these 2 operations, the database file lies unencrypted on the disk, and NOT in memory. Also, note that the database file is *unencrypted on creation*. - **Editor** support: - A single bookmark can be edited before adding. The editor can be set using the environment variable *EDITOR* or by explicitly specifying the editor. The latter takes preference. If -a is used along with -w, the details are populated in the editor template. diff --git a/buku.1 b/buku.1 index 0cc5ff5..6c7e998 100644 --- a/buku.1 +++ b/buku.1 @@ -74,6 +74,7 @@ Bookmarks with immutable titles are listed with '(L)' after the title. .IP 9. 4 \fBImport\fR: - URLs starting with `place:`, `file://` and `apt:` are ignored during import. + - Folder names are automatically imported as tags if --tacit is used. .PP .IP 10. 4 \fBEncryption\fR is optional and manual. AES256 algorithm is used. To use encryption, the database file should be unlocked (-k) before using \fBbuku\fR and locked (-l) afterwards. Between these 2 operations, the database file lies unencrypted on the disk, and NOT in memory. Also, note that the database file is \fBunencrypted on creation\fR. diff --git a/buku.py b/buku.py index cd23187..2863f66 100755 --- a/buku.py +++ b/buku.py @@ -1606,6 +1606,8 @@ class BukuDb: Google Chrome and IE exported html :param filepath: path to file to import + :param tacit: no questions asked if True + folder names are automatically imported as tags if True :return: True on success, False on failure ''' @@ -1651,7 +1653,10 @@ class BukuDb: logerr(e) return False - resp = input('Add imported folders names as tags? (y/n): ') + if not tacit: + resp = input('Add imported folders names as tags? (y/n): ') + else: + resp = 'y' for tag in soup.findAll('a'): # Extract comment from
tag