Quote:
Originally Posted by kovidgoyal
Stick it in the the plugin zip file. If your extra modules don't contain any compiled code (files ending with .so) that is all you need to do. If they do, the you have to unzip the zip file into a temporary directory and add that to sys.path in your plugin code.
|
I've had a go at this, and the module still isn't found. I tried taking the try: clause out from around the import statements, and now when I try to add the plug-in to Calibre I get
ERROR: ERROR: Unhandled exception: <b>ImportError</b>:No module named Crypto.Cipher
Traceback (most recent call last):
File "site-packages/calibre/gui2/dialogs/config/__init__.py", line 531, in add_plugin
File "site-packages/calibre/customize/ui.py", line 271, in add_plugin
File "site-packages/calibre/customize/ui.py", line 67, in load_plugin
File "<string>", line 34, in <module>
ImportError: No module named Crypto.Cipher
Looking at ui.py, line 67, it seems to me that at this point it has only decompressed the _plugin file, and not the module that's also included in the zip file. If it does a similar ting later when trying to execute, that would explain why things are not working.
Perhaps I'll need to do what you suggested later, and include the module as a zipped file, and explicitly unzip to a temporary folder and add to sys.path?
Or should it be working, and I've just done something wrong in adding in the module to the zip file?
Thanks.