Kovid,
I've been playing with this and with a bit of work I'm able to get my existing CLI interfaces to run using 'calibre-debug --run-plugin'. That's pretty cool.
However, while figuring out how to get at the config preferences my PI has stored in db.prefs.get/set_namespaced, I realized that calibre-debug doesn't have the '--with-library' option that calibredb does. I can relatively easily get the db for the library last used in the gui, but not a specified one.
If CLI plugins are meant to be able to access/update library db's, might it be better to make run_plugin a command under calibredb and pass the db in to cli_main?
I finally made myself a working src dir for calibre, so I can do the coding for this approach and submit it for your review, if you like.
|