View Single Post
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,421
Karma: 85400180
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