View Single Post
Old 11-27-2010, 06:43 PM   #11
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
look at the patch accompanying the commit. Specifically the patch to plugins.rst and __init__.py

Basically you just have to create the InterfaceActionBase and InterfaceAction subclasses and have the load_actual_plugin method of your InterfaceActionBase subclass return the InterfaceAction subclass
Kovid, do you have an example py you could post, just like the HelloWorld one?

I'm going through trial and error here and going in circles a bit. It was blowing up on my imports being defined at the top (giving errors like "ImportError: cannot import name error_dialog"). So I moved those into my InterfaceAction subclass and now get this error:
Code:
Failed to initialize plugin...
Traceback (most recent call last):
  File "D:\CalibreDev\latest\calibre\src\calibre\customize\ui.py", line 518, in initialize_plugins
  File "D:\CalibreDev\latest\calibre\src\calibre\customize\ui.py", line 83, in load_plugin
  File "<string>", line 8, in <module>
  File "D:\CalibreDev\latest\calibre\src\calibre\gui2\actions\__init__.py", line 12, in <module>
ImportError: cannot import name Dispatcher
kiwidude is offline   Reply With Quote