View Single Post
Old 01-20-2012, 01:36 PM   #3
hakan42
Zealot
hakan42 is on a distinguished road
 
hakan42's Avatar
 
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
Quote:
Originally Posted by kovidgoyal View Post
Look at customize/ui.py to see how the various types of plugins are loaded in calibre. It should contain all the code you need to define your plugins.
Thanks for your pointer, in the meantime I managed to create a new plugin type and add them to the "Plugins" menu. I also extracted a bit of code from database2.py and coverted it into a plugin. This class, I can instantiate with

Code:
from calibre.library.pathnames.byauthor.strategy import PathnameByAuthor
foo = PathnameByAuthor(self)
Two other plugins I wrote which conform to the API just defined, I can install into calibre via "calibre-customize -a <filename>.zip". The plugins contain the "plugin-import-name_<foo>.txt" file and __init__.py .

The part which I did not understand yet is how I would initialize such a class of which I might only know the plugin-import-name.
hakan42 is offline   Reply With Quote