09-30-2020, 01:45 PM | #1 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
The opds-reader plugin disappeared after upgrade to calibre 5
I'm the author of the opds-reader calibre plugin.
After upgrading to calibre 5, the plugin disappeared from the UI. I've run "calibre-debug -g" and calibre finds the plugin and reports no errors on the plugin: Code:
sb@mccoy:~/git/opds-reader/calibre_plugin$ calibre-debug -g calibre 5.0.1 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', 'SP0', 'Multiprocessor Free') Interface language: en_GB Successfully initialized third party plugins: OPDS Client (1, 0, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 118.41774744027302 x 118.22545454545454 Using calibre Qt style: True [0.00] Starting up... [0.27] Showing splash screen... [17.28] splash screen shown [17.28] Initializing db... [21.27] db initialized [21.27] Constructing main UI... Failed to load recipe from: 'Aftenposten.no_1002.recipe' Failed to load recipe from: 'nrk.no_1000.recipe' [49.64] main UI initialized... [49.64] Hiding splash screen Starting QuickView The plugin does not show up in the "Toolbars and menus" section where I would at the plugin's toolbutton to the main menu bar. What could be missing and/or need to be updated? I've looked at the plugin documentation and compared to what I have in the plugin code and as far as I can tell, the plugin still confirms to a GUI plugin. Is the problem that I haven't packed up the plugin in a zip file, but instead run the plugin from the git clone? Thanks! - Steinar |
09-30-2020, 02:37 PM | #2 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
Your 5 year old plugin is not Python 3.8 compatible.
Example: The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error. Code:
""model.py: This is a QAbstractTableModel that holds a list of Metadata objects created from books in an OPDS feed""" __author__ = "Steinar Bang" __copyright__ = "Steinar Bang, 2015" __credits__ = ["Steinar Bang"] __license__ = "GPL v3" import datetime from PyQt5.Qt import Qt, QAbstractTableModel, QCoreApplication from calibre.ebooks.metadata.book.base import Metadata from calibre.gui2 import error_dialog from calibre.web.feeds import feedparser import urlparse import urllib2 import json import re DaltonST |
Advert | |
|
10-01-2020, 11:25 AM | #3 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
Thanks!
So the problem is in the imports? Is there a list of the stuff that has changed? |
10-01-2020, 11:38 AM | #4 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
https://www.mobileread.com/forums/sh...d.php?t=325721 offers guidance to plugin devs. It's a pinned thread in this subforum, even.
Google will probably find you additional references to "port from python2 to python3". |
10-01-2020, 02:06 PM | #5 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
Thanks!
I've seen that post by Kovid Goyal, and I am already working from what google searches about upgrading from python 2 to python 3 turn up. What I'm primarily looking for (and google searches as yet haven't turned up), is a way to diagnose what's wrong with my plugin. A way to load it that would output all error messages such as e.g. "import not found" or similar. "calibre-debug -g" outputs a lot of stuff, but nothing about what's wrong with my plugin. Thanks again! |
Advert | |
|
10-01-2020, 02:17 PM | #6 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
"calible-debug <py-file>" on the files of the plugin seems to give some error messages.
I'll go with that for now. |
10-01-2020, 02:36 PM | #7 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Does the plugin provide a command-line interface? You could run it with calibre-debug -r "Plugin Name"
|
10-01-2020, 02:47 PM | #8 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
Unfortunately no command line interface. Perhaps it should have had?
That would have made it simpler. But anyway the plugin is up again. I started with "calibre-debug main.py" and then working my way through the error messages (wrong imports and "print" without parantheses). I was confused for a while when "calibre-debug main.py" started reporting errors in other .py files in the plugin and continued to report the errors even after I had fixed them. But then I found that re-running "calibre-customize -b ." made the fixed code be picked up by main.py. And after I had fixed all errors the plugin reappeared in calibre. It is so much easier to work with error messages instead of staring at code I haven't touched for 5 years to try to figure out what's going on...:-) Thanks! |
10-01-2020, 02:55 PM | #9 | ||
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
https://manual.calibre-ebook.com/plu...lugin.cli_main Quote:
But using python-modernize could help to do much of the grunt work of porting! I don't know why calibre-debug -g isn't exposing error messages already... it does if __init__.py fails to load, or if you get interface buttons and clicking on them raises errors, it seems weird if something going wrong in between those points is causing errors to get eaten instead of logged. |
||
10-01-2020, 03:14 PM | #10 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
(well the plugin was back showing up, but it wasn't actually working again. But now I'm getting error messages and that I can work with)
|
10-01-2020, 03:18 PM | #11 |
Bibliophagist
Posts: 35,489
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
10-03-2020, 07:49 AM | #12 |
Enthusiast
Posts: 27
Karma: 53696
Join Date: Nov 2012
Device: Sony PRS T-1
|
FYI the opds-reader plugin now works on calibre 5.01 https://github.com/steinarb/opds-reader/issues/10
Note: I have made no efforts at making opds-reader still work with python 2 and calibre 4.x (with python 2 EOL'd the only way is forward). Thanks all, for your assistance! |
10-03-2020, 08:55 AM | #13 |
Grand Sorcerer
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
|
10-03-2020, 11:30 AM | #14 | |
Resident Curmudgeon
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
10-03-2020, 04:56 PM | #15 |
Bibliophagist
Posts: 35,489
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
COPS : Calibre OPDS WordPress Plugin | PetrusV | Related Tools | 9 | 12-28-2020 08:22 AM |
ios reader plugin for calibre | emsteel123 | Plugins | 3 | 07-08-2016 07:54 AM |
New Cloud Storage + OPDS Plugin needs testers | QuietThyme | Development | 15 | 12-08-2015 05:13 AM |
Moon+ reader & multipile Calibre OPDS feeds ? | g8dhe | Android Devices | 0 | 10-08-2012 09:23 AM |
Reader Library disappeared after upgrade | nikev | Sony Reader | 0 | 12-19-2009 11:33 PM |