The Kobo Desktop program will (when running under Wine on Linux) put all
of its data in the current working directory. This means that there
may be more than one Kobo.sqlite floating around by the user, which
leads to Obok showing an outdated list of books and the user being
confused by Obok cannot find the full list of books.
Solving this completely appears to be a bit too complicated, so this
patch is a best-effort improvement for the worst cases which can be
caused by this:
1. If the user deletes the files but Obok has already cached the path,
previously Obok would just error out rather than trying to search
for a new Kobo.sqlite path and updating the cache.
2. We search $HOME before searching /, which speeds up initial usage of
Obok in the common case (usually Kobo Desktop will be installed in
~/.wine/drive_c) and also ensures that we correctly preference the
current user's Kobo Desktop installation.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
According to calibre debug the ipconfig command returned some invalid utf-8 characters (I think is maybe an issue due to the Python2 switch-off as the 4.x version worked fine).
To solve this I've changed the external call and modified the regex to match both the output of "ipconfig" and that of "wmic".
THIS IS ON THE MASTER BRANCH. The Master branch will be Python 3.0 from now on. While Python 2.7 support will not be deliberately broken, all efforts should now focus on Python 3.0 compatibility.
I can see a lot of work has been done. There's more to do. I've bumped the version number of everything I came across to the next major number for Python 3.0 compatibility indication.
Thanks everyone. I hope to update here at least once a week until we have a stable 7.0 release for calibre 5.0