diff --git a/README.md b/README.md index fbcb7a1..21a0d50 100644 --- a/README.md +++ b/README.md @@ -269,7 +269,7 @@ SYMBOLS: - --stag : search bookmarks by a tag, or list all tags alphabetically with usage count (if no arguments). - 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. + - URLs starting with `place:`, `file://` and `apt:` are ignored during import. - **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 a099fc1..0cc5ff5 100644 --- a/buku.1 +++ b/buku.1 @@ -73,7 +73,7 @@ Bookmarks with immutable titles are listed with '(L)' after the title. .PP .IP 9. 4 \fBImport\fR: - - URLs starting with `place:`, `file://` and `apt://` are ignored during import. + - URLs starting with `place:`, `file://` and `apt:` are ignored during import. .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 d1e3d5b..6480413 100755 --- a/buku.py +++ b/buku.py @@ -1897,7 +1897,7 @@ def is_bad_url(url): def is_nongeneric_url(url): '''Returns true for URLs which are non-http and non-generic''' - ignored_prefix = ['place:', 'file://', 'apt://'] + ignored_prefix = ['place:', 'file://', 'apt:'] for prefix in ignored_prefix: if url.startswith(prefix): diff --git a/tests/test_buku.py b/tests/test_buku.py index 9f19a88..7401bf5 100644 --- a/tests/test_buku.py +++ b/tests/test_buku.py @@ -466,3 +466,19 @@ def test_network_handler_with_url(url, exp_res): buku.myproxy = None res = buku.network_handler(url) assert res == exp_res + + +@pytest.mark.parametrize( + 'url, exp_res', + [ + ('http://example.com', False), + ('apt:package1,package2,package3', True), + ('apt://firefox', True), + ('file:///tmp/vim-markdown-preview.html', True), + ('place:sort=8&maxResults=10', True), + ] +) +def test_is_nongeneric_url(url, exp_res): + import buku + res = buku.is_nongeneric_url(url) + assert res == exp_res