Issues with bookmark package #55

Closed
eugenesvk opened this Issue Apr 25, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@eugenesvk

The bookmark package doesn't seem to be working for me on Windows 10 x64 with Keypirinha v2.5.4

Here is my manually edited config file where I tried to specify explicit path to the bookmarks file after realizing it's not being picked up by default.

[provider/Chrome]
bookmarks_files =
    C:\Users\Evgeny\AppData\Local\Google\Chrome\User Data\Default\
    C:\Users\Evgeny\AppData\Local\Google\Chrome\User Data\Default\Bookmarks

Then I rescan the catalog, notice that nothing changed, try to enter a name of a bookmark and see nothing in the results

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Apr 26, 2016

Member

If your Chrome bookmarks are stored in C:\Users\Evgeny\AppData\Local\Google\Chrome\User Data\Default\Bookmarks (assuming Evgeny is the current logged user), then the plugin should automatically find your bookmarks without having to modify the config file since it is the default search location. Are you positive it didn't find them by default? The path has the same format on my machine and Chrome bookmarks are found with no trouble. I hope Chrome didn't change their format, what version of Chrome do you have? I have 50.0 64bit.

Anyway, the path(s) in bookmarks_files should directly point to Bookmarks file(s) (i.e. not parent dir) so your config should be:

[provider/Chrome]
bookmarks_files = ${env:LOCALAPPDATA}\Google\Chrome\User Data\Default\Bookmarks

The ${env:LOCALAPPDATA} is optional and assumes the LOCALAPPDATA environment variable is available. But this allows you to be as portable as possible.

Member

polyvertex commented Apr 26, 2016

If your Chrome bookmarks are stored in C:\Users\Evgeny\AppData\Local\Google\Chrome\User Data\Default\Bookmarks (assuming Evgeny is the current logged user), then the plugin should automatically find your bookmarks without having to modify the config file since it is the default search location. Are you positive it didn't find them by default? The path has the same format on my machine and Chrome bookmarks are found with no trouble. I hope Chrome didn't change their format, what version of Chrome do you have? I have 50.0 64bit.

Anyway, the path(s) in bookmarks_files should directly point to Bookmarks file(s) (i.e. not parent dir) so your config should be:

[provider/Chrome]
bookmarks_files = ${env:LOCALAPPDATA}\Google\Chrome\User Data\Default\Bookmarks

The ${env:LOCALAPPDATA} is optional and assumes the LOCALAPPDATA environment variable is available. But this allows you to be as portable as possible.

@eugenesvk

This comment has been minimized.

Show comment
Hide comment
@eugenesvk

eugenesvk Apr 26, 2016

Are you positive it didn't find them by default?

Yes. I've bookmarked github.com with the name Github Repos and I have exactly zero results when I enter github in the search window (also tried to enter bookmarks github or bookmarks:github just in case)
That wasn't working before I've edited the bookmarks package settings file

I have Chrome 50.0.2661.87 m (64-bit) with default path (as you see above, I checked that the file is there and it has bookmarks in it). For example, the bookmark I'm trying to test looks like this in this file

               }, {
                  "date_added": "13090086735942026",
                  "id": "125014",
                  "name": "GitHub Repos",
                  "sync_transaction_version": "462",
                  "type": "url",
                  "url": "https://github.com/"
               }, {

Also tried your bookmarks_files = ${env:LOCALAPPDATA}\Google\Chrome\User Data\Default\Bookmarks (env var is set and visible in cmd), though nothing happened (which is expected as I've provided the exact path to the file)

Are you positive it didn't find them by default?

Yes. I've bookmarked github.com with the name Github Repos and I have exactly zero results when I enter github in the search window (also tried to enter bookmarks github or bookmarks:github just in case)
That wasn't working before I've edited the bookmarks package settings file

I have Chrome 50.0.2661.87 m (64-bit) with default path (as you see above, I checked that the file is there and it has bookmarks in it). For example, the bookmark I'm trying to test looks like this in this file

               }, {
                  "date_added": "13090086735942026",
                  "id": "125014",
                  "name": "GitHub Repos",
                  "sync_transaction_version": "462",
                  "type": "url",
                  "url": "https://github.com/"
               }, {

Also tried your bookmarks_files = ${env:LOCALAPPDATA}\Google\Chrome\User Data\Default\Bookmarks (env var is set and visible in cmd), though nothing happened (which is expected as I've provided the exact path to the file)

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Apr 26, 2016

Member

Pretty thorough reply! :)

Indeed, a github search would do it with the example bookmark you gave.
Also, the format of your extract of the Bookmarks file seems to be the expected one: the plugin checks for the type property and if it's url, then just grab the content of the url property. Pretty basic.

No warning/error message in Keypirinha's console I suppose?

Member

polyvertex commented Apr 26, 2016

Pretty thorough reply! :)

Indeed, a github search would do it with the example bookmark you gave.
Also, the format of your extract of the Bookmarks file seems to be the expected one: the plugin checks for the type property and if it's url, then just grab the content of the url property. Pretty basic.

No warning/error message in Keypirinha's console I suppose?

@eugenesvk

This comment has been minimized.

Show comment
Hide comment
@eugenesvk

eugenesvk Apr 26, 2016

Yeah, forgot to check the most important part — console :)
There is indeed an error (maybe it's worth adding an indicator showing the number of errors and number of warnings somewhere at the bottom of the search box just like you show number of items and number of packages?):

19:28:49.204 ** ERROR: Error from Bookmarks.Bookmarks.on_catalog: <class 'UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xe2 in position 15613: ordinal not in range(128)
Traceback (most recent call last):
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\bookmarks.py", line 59, in on_catalog
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\providers\chrome.py", line 43, in list_bookmarks
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\providers\chrome.py", line 78, in _read_bookmarks
  File "lib\json\__init__.py", line 265, in load
  File "lib\encodings\ascii.py", line 26, in decode

The bookmarks file is encoded is UTF-8. Not sure how to get to position 15613 to see what's tripping it as I only have line and column indicator in my text editor

Yeah, forgot to check the most important part — console :)
There is indeed an error (maybe it's worth adding an indicator showing the number of errors and number of warnings somewhere at the bottom of the search box just like you show number of items and number of packages?):

19:28:49.204 ** ERROR: Error from Bookmarks.Bookmarks.on_catalog: <class 'UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xe2 in position 15613: ordinal not in range(128)
Traceback (most recent call last):
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\bookmarks.py", line 59, in on_catalog
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\providers\chrome.py", line 43, in list_bookmarks
  File "C:\Apps\Utilities\KeyPirinha\default\Packages\Bookmarks.keypirinha-package\providers\chrome.py", line 78, in _read_bookmarks
  File "lib\json\__init__.py", line 265, in load
  File "lib\encodings\ascii.py", line 26, in decode

The bookmarks file is encoded is UTF-8. Not sure how to get to position 15613 to see what's tripping it as I only have line and column indicator in my text editor

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Apr 26, 2016

Member

No need to explore further. I'll probably make a hotfix for this in a few hours as I won't be able to work on KP in the next days. Thanks for the feedback.

maybe it's worth adding an indicator

It's also in my todo list... The list is about 700 lines long...

Member

polyvertex commented Apr 26, 2016

No need to explore further. I'll probably make a hotfix for this in a few hours as I won't be able to work on KP in the next days. Thanks for the feedback.

maybe it's worth adding an indicator

It's also in my todo list... The list is about 700 lines long...

@polyvertex polyvertex added the kind/bug label Apr 26, 2016

@eugenesvk

This comment has been minimized.

Show comment
Hide comment
@eugenesvk

eugenesvk Apr 26, 2016

hotfix for this in a few hours as

Thank you. Maybe also add an option to notify on updates on line 701 ;)

The list is about 700 lines long

The road to perfection is paved with many stepping stones :)

hotfix for this in a few hours as

Thank you. Maybe also add an option to notify on updates on line 701 ;)

The list is about 700 lines long

The road to perfection is paved with many stepping stones :)

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Apr 26, 2016

Member

Until perfection arises, app's twitter account may come handy

Member

polyvertex commented Apr 26, 2016

Until perfection arises, app's twitter account may come handy

@polyvertex

This comment has been minimized.

Show comment
Hide comment
@polyvertex

polyvertex Apr 26, 2016

Member

Hope 2.5.5 will upgrade your experience to perfection :)

Member

polyvertex commented Apr 26, 2016

Hope 2.5.5 will upgrade your experience to perfection :)

@polyvertex polyvertex closed this Apr 26, 2016

@eugenesvk

This comment has been minimized.

Show comment
Hide comment
@eugenesvk

eugenesvk Apr 26, 2016

One step closer :)
Thanks, it works

One step closer :)
Thanks, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment