Honor --tacit: import folder names as tags if True

This commit is contained in:
Arun Prakash Jana 2017-07-20 10:14:37 +05:30
parent 55e0eb5767
commit a9f4cd502a
No known key found for this signature in database
GPG Key ID: A75979F35C080412
3 changed files with 8 additions and 1 deletions

View File

@ -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. - 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**: - **Import**:
- URLs starting with `place:`, `file://` and `apt:` are ignored during 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*. - **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: - **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. - 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.

1
buku.1
View File

@ -74,6 +74,7 @@ Bookmarks with immutable titles are listed with '(L)' after the title.
.IP 9. 4 .IP 9. 4
\fBImport\fR: \fBImport\fR:
- URLs starting with `place:`, `file://` and `apt:` are ignored during import. - URLs starting with `place:`, `file://` and `apt:` are ignored during import.
- Folder names are automatically imported as tags if --tacit is used.
.PP .PP
.IP 10. 4 .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. \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.

View File

@ -1606,6 +1606,8 @@ class BukuDb:
Google Chrome and IE exported html Google Chrome and IE exported html
:param filepath: path to file to import :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 :return: True on success, False on failure
''' '''
@ -1651,7 +1653,10 @@ class BukuDb:
logerr(e) logerr(e)
return False 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'): for tag in soup.findAll('a'):
# Extract comment from <dd> tag # Extract comment from <dd> tag