Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2020, 01:45 PM   #1
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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 also shows up in the plugins section of Preferences.

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
steinarb is offline   Reply With Quote
Old 09-30-2020, 02:37 PM   #2
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
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
DaltonST is offline   Reply With Quote
Advert
Old 10-01-2020, 11:25 AM   #3
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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?
steinarb is offline   Reply With Quote
Old 10-01-2020, 11:38 AM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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".
eschwartz is offline   Reply With Quote
Old 10-01-2020, 02:06 PM   #5
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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!
steinarb is offline   Reply With Quote
Advert
Old 10-01-2020, 02:17 PM   #6
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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.
steinarb is offline   Reply With Quote
Old 10-01-2020, 02:36 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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"
eschwartz is offline   Reply With Quote
Old 10-01-2020, 02:47 PM   #8
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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!
steinarb is offline   Reply With Quote
Old 10-01-2020, 02:55 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by steinarb View Post
Unfortunately no command line interface. Perhaps it should have had?

That would have made it simpler.
They're optional but very handy sometimes.
https://manual.calibre-ebook.com/plu...lugin.cli_main

Quote:
Originally Posted by steinarb View Post
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.
Yeah, if things import from calibre_plugins.<name>.config or something then it will try to load them via the plugin infra, not relative to the current unpacked directory.

But using python-modernize could help to do much of the grunt work of porting!

Quote:
Originally Posted by steinarb View Post
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!
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.
eschwartz is offline   Reply With Quote
Old 10-01-2020, 03:14 PM   #10
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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)
steinarb is offline   Reply With Quote
Old 10-01-2020, 03:18 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,280
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by steinarb View Post
(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)
The real fun unless you want to fork your plugin is going to be having the plugin work with both Python 2 and Python 3.
DNSB is offline   Reply With Quote
Old 10-03-2020, 07:49 AM   #12
steinarb
Enthusiast
steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.steinarb is no e-book dilettante.
 
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!
steinarb is offline   Reply With Quote
Old 10-03-2020, 08:55 AM   #13
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,495
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by steinarb View Post
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).
You should probably update the minimum_calibre_version in your plugin's __init__.py file.
jhowell is offline   Reply With Quote
Old 10-03-2020, 11:30 AM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,866
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by steinarb View Post
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!
But there are people who cannot run Calibre 5 but can run 4.23. What about them?
JSWolf is offline   Reply With Quote
Old 10-03-2020, 04:56 PM   #15
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,280
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
But there are people who cannot run Calibre 5 but can run 4.23. What about them?
Leave the old Python 2 version available for them would seem to be the simplest solution.
DNSB is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 05:09 AM.


MobileRead.com is a privately owned, operated and funded community.