Quote:
Originally Posted by kovidgoyal
Look under the tutorials section of the user manual, there is a tutorial on how to write plugins for calibre. If other people want to use your plugin, they can do so, the same way as you would use it - disable builtin and install your plugin.
|
I don't think this works for Device Drivers. I created a zip file called "nook_cm7.zip" that contains:
__init__.py (empty file)
driver.py, contains:
from calibre.devices import NOOK_COLOR
class NOOK_COLOR_CM7 (NOOK_COLOR):
name = 'Nook Device Interface with CM7'
gui_name = _('The Nook Color with CM7')
description = _('Communicate with Nook Color running CM7.')
I'm trying to load this into Calibre with:
Preferences->Advanced->Plugins->Load Plugin from File
and I get:
calibre, version 0.8.33
ERROR: Unhandled exception: <b>InvalidPlugin</b>:No plugin class found in C:/Maarten/Src/calibre/nook_cm7.zip:dummy1
Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 292, in add_plugin
File "site-packages\calibre\customize\ui.py", line 339, in add_plugin
File "site-packages\calibre\customize\ui.py", line 54, in load_plugin
File "site-packages\calibre\customize\zipplugin.py", line 177, in load
InvalidPlugin: No plugin class found in C:/Maarten/Src/calibre/nook_cm7.zip:dummy1
So, how do I write/test a Device Driver without setting up an entire development environment for Calibre?
[edit] OK, got it working. Apparently there's a naming convention for the zip file and the .py file inside. I used the Medion OYO driver plugin from
here as an example, and can now load my "driver".