Closed jarun closed 3 years ago
can you fix the travis test @Aquan1412?
also can you made test case for this? if you can't just tell us
The tests should be fixed now. Regarding a new test case: I'm not sure how to do it properly. I could just copy "test_import_md()" and adjust that accordingly?
yes @Aquan1412
you can copy the test and change test method if it is different
if it is just parameter, use that pytest.mark.parametrize
see pytest documentation
Ok, I added the new test, and all the tests run successfully now, @rachmadaniHaryono
Windows 7 x64, Python 3.8.1
$ pip3 install buku
$ buku
Traceback (most recent call last):
File "c:\python\lib\site-packages\buku.py", line 43, in <module>
import readline
ModuleNotFoundError: No module named 'readline'
We probably need to handle ModuleNotFoundError
along with ImportError
. Please raise a PR.
@jarun, raise what? I am a mere user w/o prep who cares that tech serves people, not nerds only.
Hi guys, is there any possibility how to secure bukuserver from internet?
@sergeevabc
raise what? I am a mere user w/o prep who cares that tech serves people, not nerds only.
I don't care who you are and what you care. I don't have any free time to implement this and I don't have Windows.
@tom-i
Hi guys, is there any possibility how to secure bukuserver from internet?
No plans for now as far as I know. @rachmadaniHaryono anything in that line?
@jarun, thanks for being straightforward, your “don't care” attitude towards profane feedback is surely something broader audience should be aware of when choosing an everyday tool, recommending it to try, or even feeling an urge to donate.
Dear Windows users, I found a solution for “readline” issue on Stackoverflow: pip install pyreadline
Perhaps this so-called developer can grow a conscience and conditionally include it in the main package.
@sergeevabc
As I have a open project available you have the advantage of adding whatever comments you want hoping people would see the dev of the project in that light. Once again, I am least bothered.
The problem I have with is your attitude in the following line:
raise what?
I checked your account now. You know what a PR is. What do you mean raise what? Learn to respect the time and effort of others. I do this project spending my free time and I have the right to contribute to it or not to fix stuff that I do not use - like Python 3.8 or Windows.
When I politely requested you to raise a PR the intention was to get it fixed for you as soon as possible, You have Windows, you have Python 3.8. I also explained what you need to do. If you do not have the time you could have just mentioned that.
Also, go and use profanity to litter your own projects, not mine.
[part removed]
i want to comment about second comment from sergeevabc but second last comment from jarun already fixed answer that
i think we can add the fix from sergeevabc on next release by adding pyreadline package for windows installation
as i also don't have window dev, i hope someone can test it if i create pr for it (maybe tommorow)
i'm quite confused with error text because i thought ModuleNotFoundError should be catched when the program catch ImportError even if pyreadline is not installed it should be error on pyreadline import line not readline import line
example run on python3.6
>>> try:
>>> print('hello')
>>> raise ModuleNotFoundError
>>> except ImportError:
>>> print('error')
>>>
hello
error
ModuleNotFoundError is only on 3.6, so if we want to catch that, we have to increase python version requirement
(e: while first part is true, there maybe a way to handle both on python 3.5, and 3.6+)
Hi guys, is there any possibility how to secure bukuserver from internet?
No plans for now as far as I know. @rachmadaniHaryono anything in that line?
because the reverse proxy feature is already added, imo it should be login feature. with this only people with the password can change your bookmark if you host it.
related package https://github.com/maxcountryman/flask-login
ping @tom-i
@rachmadaniHaryono thx man, I'm going to try that ;)
task for this wiki section
https://github.com/jarun/buku/wiki/Buku-as-a-library
How to backup or restore the saved bookmarks? Normally I thought that
buku -w
Would be reading and saving from a file. But now it seems that it most likely saves to the database?
Any way to easily backup or restore the bookmarks?
not sure if it is the answer but there is user who use git to backup buku everytime buku command invoked
You can also store the actual database file in a synced cloud storage directory and have a symlink to the file at the location buku
looks for.
This is just an idea. Think of a wiki. A wiki consists of a set of nodes, every node with an id, a title and a content, and in the content you may found references to others ids. Think of a Zettelkasten. It consists of a set of nodes (zettel, cards), every node with an id, maybe a title, a content with references to others ids, and a link to an external source (a book). I wonder whether buku could be used like those ones. The description could hold references to other entries. And maybe the link could be any URI (e.g. a book or specification URN). I wonder whether there is an unique ID for every entry that could be referenced in the description, or any other field.
The url is the unique thing and tags relate the bookmarks.
How about is the url is slightly modified? The "link" from one entry to the other would be missing. Tags relate bookmarks, but they do not point other specific entries.
other specific entries
Can you please elaborate?
The point is to create a "brain" of bookmark entries linked among them, where every bookmark entry has a description and internal links to other bookmark entries. A bookmark entry may have tags, but its tags do not work as pointers to other named bookmark entries (they would refer to every entry that has that tag). Is my point clearer? Anyway it is just an idea.
I think it will make the solution over-complicated. We have extensive search facilities already and I am of the opinion that the types of search is more than adequate to find a bookmark.
@rachmadaniHaryono what do you think?
for buku itself imo kinda hard due to terminal user interface
for bukuserver it may have work by creating custom text-to-html, which will link any matching text to another entry (e.g. reddit r/subreddit
text)
Does bukuserver have a Grid View? Or even something like Windows' File Explorer List View?
The concept of an offline bookmark manager is one that I love because most alternatives are webapps intent on using your data and/or being a social platform, but I need an alternative because the list-based approach used by browsers to manage bookmarks doesn't show enough bookmarks at once, making managing difficult.
@rachmadaniHaryono do you have any plans for a grid-based view?
grid based view
while it is possible, i'm not good enough in html to hack flask admin that. i may try but i will not promise anything
but i will love if bukuserver can what shiori does https://github.com/go-shiori/shiori
Windows' File Explorer List View
https://i.stack.imgur.com/BW7xN.png
i kinda confused with this because i have no idea how does each item will look like
doesn't show enough bookmarks at once, making managing difficult.
increase bookmarks per page config here https://github.com/jarun/buku/tree/master/bukuserver#configuration
but i will love if bukuserver can what shiori does https://github.com/go-shiori/shiori
Yeah it'd be nice. I tried shiori but it just offers nothing when it comes to actual management.
Windows' File Explorer List View
https://i.stack.imgur.com/BW7xN.png
i kinda confused with this because i have no idea how does each item will look like
Wdym? You mean you're not sure how to implement the max length of each column list? You can truncate it to a variable limit. e.g. a limit of 20 (or any chosen number) characters per item, then after that you just get ellipsis.
Wdym? You mean you're not sure how to implement the max length of each column list? You can truncate it to a variable limit.
e.g. a limit of 20 (or any chosen number) characters per item, then after that you just get ellipsis.
so just url (or shortened one or click/hover to see full url) on single line. that maybe simple enough
so just url (or shortened one or click/hover to see full url) on single line. that maybe simple enough
Title, then URL displayed on hover
Any idea on using different database-files? Found a feature in the list, which supports it internall, but not for usage. Planned to add that?
OK, found it in the operational notes. It was not mentioned in the output of --help. This is intended (because of "Manual usage is prone to issues arising from human error.")?
Yes, it is intended. Use at your own risk.
Yes, it is intended. Use at your own risk.
I think -d switch to delete the whole database is rather a risk to destroy the data than -db to use a different database-file.
I use bookmark folders extensively on firefox (rarely tags) and use the "Add parent folder names as tags" option when importing automatically from firefox. I am interested in preserving my folder tree structure and have it reflected in the sequence of comma separated tags. I therefore removed sorted()
in the parse_tags
function. buku line 3687: unique_tags = set(orig_tags)
Is there any side effects from doing this?
Thanks for the great work!
Is there any side effects from doing this?
I am not sure. Never tested it this way. If your search results are fine maybe it works.
Thanks for your reply. Actually my solution doesn't work as set() does not preserve the insertion order from the orig_tags
list. Instead, I am now directly returning the orig_tags
list (wrapped with delimiter). My search results seem to work fine. I suppose I could run into issues if I use subfolders which have the same name as their parents.... but I just won't
You can have this modification in your fork. At this stage of the project I do not expect too many changes so it shouldn't be difficult to merge at a later point.
@jarun i want to update this page https://github.com/jarun/buku/wiki/Buku-as-a-library
buku
is developed as a powerful python library for bookmark management. All functionality are available through carefully designed APIs. main()
is a good usage example. It's also possible to use a custom database file in multi-user scenarios. Check out the documentation for the following APIs which accept an optional argument as database.
>>> import buku
>>> buku.BukuDb.initdb(dbfile=None)
>>> buku.BukuCrypt.encrypt_file(iterations, dbfile=None)
>>> buku.BukuCrypt.decrypt_file(iterations, dbfile=None)
NOTE: This flexibility is not exposed in the program.
An example to use buku as library
>>> import buku
>>> buku.__version__
'4.4'
>>> bdb = buku.BukuDb(dbfile='temp.db')
>>> bdb.get_rec_all()
[]
>>> bdb.add_rec(url='https://example.com', title_in='example title', tags_in='tag1', desc='example desc')
1
>>> bdb.get_rec_all()
[(1, 'https://example.com', 'example title', ',tag1,', 'example desc', 0)]
>>> # id, url, title, tags, description, flags
>>> bdb.add_rec(url='https://example.com/1.jpg')
1
>>> bdb.get_rec_all()
[(1, 'https://example.com', 'example title', ',tag1,', 'example desc', 0),
(2, 'https://example.com/1.jpg', None, ',', '', 0)]
>>> # Note: if record don't have tags, it will return ',' (comma character)
The bukuserver has several wrapper web APIs. Feel free to update if you need them.
changes
Sure thing!
On fedora 33, copying a link in a search (c #id) throws this error: Failed to locate suitable clipboard utility I was thinking maybe it's a Wayland issue? When I right-click on the link in terminal I am able to copy.
The reason I want to copy is to be able to open in a browser other than Firefox (or the browsers listed in the Python webbrowser controller). Perhaps this is too much of a pipe dream, but I would like to choose a different browser with one letter. For example: O 5 f Open index 5 in firefox O 5 c Open index 5 in chrome
You may have to install wl-copy
. See function copy_to_clipboard()
for a list of supported copiers.
Switching browsers on the fly is not supported.
Thanks! That worked. I had also installed buku from fedora dnf and the code was older. I looked at the file in /usr/bin/buku and the "wl-copy" info was not there yet. So I downloaded the latest from the buku github repository and replaced the buku file. And I installed wl-clipboard from the fedora's package manager. Now copy works. Thanks.
Continued from #268.
Notes
The list below is a growing one. While suggesting new features please consider contributing to
Buku
. The code is intentionally kept simple and easy to understand with comments. We'll be happy to assist any new contributor. We need your help!Some of the fresh-baked features may not have been released yet. Grab the master branch for those.
Identified tasks
--preserve
to ignore specific fields during auto-update [see issue #327]exportdb()
API (@rachmadaniHaryono)importdb()
] (thanks @ckolumbus)-n
with-p
(thanks @jpdasma)--export
HTML <meta> Tag
a
andb
but notc
andd
) (thanks @SaltyCatFish)googler
/ddgr
- omniprompt keyO
profiles.ini
(see #212, thanks @alex-bender)--format
in search results (ref, thanks @mosegontar)importdb()
]