Improve firefox bookmarks plugin: search by tags

Bug #429059 reported by Stanislav German-Evtushenko on 2009-09-13
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kupfer
Wishlist
Unassigned

Bug Description

It would be useful if kupfer search urls in firefox bookmarks by tags.

Hi, thanks for the idea.

I need your feedback on how you think tags should be used.

* Each bookmark item could have the tags in its name like "Gmail [tags: mail]"
* We could also have each tag as an object that you can enter and browse separately (like tracker tags)

Both suggestions can be implemented at the same time.

Kupfer's firefox plugin is in fact not upgraded for Firefox 3, it needs to be rewritten to parse Firefox' JSON bookmarks backup (which is going to be much more convenient than parsing HTML).

Changed in kupfer:
importance: Undecided → Wishlist
status: New → Confirmed

Here is a very simple patch you can try (tags are already parsed but not used). I don't think this solution works so well, it would be better to put the list of tags in the description and match them there, but you can try and see what you think.

I mean firefox bookmark's built-in tags (and also keyword). I've attached the screenshot.
Thank you, I'll try this patch as soon as I can.

Stanislav: Exactly. But how do you propose the tags are going to be used, displayed and matched in Kupfer?

Oh :) Sorry, I got.
I think it can be going just like URLs. It would be more useful then having each tag as an object.

I've tried this patch with c14

Exception in thread Thread-13:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.6/site-packages/kupfer/data.py", line 200, in rescan_source
    items = source.get_leaves(force_update=True)
  File "/usr/lib/python2.6/site-packages/kupfer/objects.py", line 805, in get_leaves
    self.cached_items = aslist(sort_func(self.get_items()))
  File "/usr/lib/python2.6/site-packages/kupfer/objects.py", line 152, in aslist
    seq = list(seq)
  File "/usr/lib/python2.6/site-packages/kupfer/plugin/firefox.py", line 30, in get_items
    title = u"%s%s" % (book["title"][:mlen], tagstr)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 119: unexpected end of data

Patching c15 wasn't going.

Oh, that's not good. Kupfer is mishandling strings there. The patch
should work successfully if you remove exactly '[:mlen]', leaving only
 title = u"%s%s" % (book["title"], tagstr)

The patch doesn't apply to c15, since firefox parsing was updated and
changed. It still is possible to implement the same thing there, the
problem is the interface.

In short, for Kupfer to match an item against a query (say query is
"python"), it has to contain that somewhere in its name. That's why
the simple prototype simply appends [tags: python, tag2] to the URL
name. However, it is not so pretty.

Ulrik

2009/9/20 Stanislav German-Evtushenko <email address hidden>:
> I've tried this patch with c14
>
> Exception in thread Thread-13:
> Traceback (most recent call last):
>  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
>    self.run()
>  File "/usr/lib/python2.6/threading.py", line 477, in run
>    self.__target(*self.__args, **self.__kwargs)
>  File "/usr/lib/python2.6/site-packages/kupfer/data.py", line 200, in rescan_source
>    items = source.get_leaves(force_update=True)
>  File "/usr/lib/python2.6/site-packages/kupfer/objects.py", line 805, in get_leaves
>    self.cached_items = aslist(sort_func(self.get_items()))
>  File "/usr/lib/python2.6/site-packages/kupfer/objects.py", line 152, in aslist
>    seq = list(seq)
>  File "/usr/lib/python2.6/site-packages/kupfer/plugin/firefox.py", line 30, in get_items
>    title = u"%s%s" % (book["title"][:mlen], tagstr)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 119: unexpected end of data
>
> Patching c15 wasn't going.
>
> --
> Improve firefox bookmarks plugin: search by tags
> https://bugs.launchpad.net/bugs/429059
> You received this bug notification because you are the registrant for
> kupfer.
>

"That's why the simple prototype simply appends [tags: python, tag2] to the URL name." - this feature can be optional (configurable) and could be implemented by this way for a time. What do you think?

In addition to tags would be great if kupfer matches urls itself while search bookmarks.

I've attached example how Vimperator matches bookmarks by urls and tags.

decoder,russian,tools,translation - are tags

Hello Ulrik,

Could you please adapt the patch to the lastest version so I can try it?

Have a nice day,
Stas

Patch that provide tags as subcatalog is commited: eb3c767d9790

https://github.com/engla/kupfer/commit/eb3c767d9790965e154e76cff80100c01f24ee61

Changed in kupfer:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers