Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2011, 10:08 PM   #1
A0tmsk
Junior Member
A0tmsk began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2011
Device: sony
Trouble creating a plugin.

I just started working on a plugin for calibre using version 0.7.57 on linux and I am having trouble adding new plugins. I can add the ones I find in this forum, but that is all. Even the plugins Ive downloaded from the tutorial here do not work. What makes things stranger is that I can take one of the plugins from here that works, extract it, and rezip it, and it no longer works.

When I try to add a plugin in Preferences I get the following error:

Quote:
calibre, version 0.7.57
ERROR: Unhandled exception: <b>InvalidPlugin</b>:The plugin in u'/home/steve/Downloads/Quality Check.zip' is invalid. It does not contain a top-level __init__.py file

Traceback (most recent call last):
File "site-packages/calibre/gui2/preferences/plugins.py", line 283, in add_plugin
File "site-packages/calibre/customize/ui.py", line 362, in add_plugin
File "site-packages/calibre/customize/ui.py", line 55, in load_plugin
File "site-packages/calibre/customize/zipplugin.py", line 160, in load
File "site-packages/calibre/customize/zipplugin.py", line 255, in _locate_code
InvalidPlugin: The plugin in u'/home/steve/Downloads/Quality Check.zip' is invalid. It does not contain a top-level __init__.py file
I get that top-level __init__.py error no matter what I do.

Any ideas?

Last edited by A0tmsk; 04-26-2011 at 08:51 PM.
A0tmsk is offline   Reply With Quote
Old 04-25-2011, 11:55 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by A0tmsk View Post
I just started working on a plugin for calibre using version 0.7.57 on linux and I am having trouble adding new plugins. I can add the ones I find in this forum, but that is all. Even the plugins Ive downloaded from the tutorial here do not work.
I have never done a plugin but you are right the helloworld_plugin.zip that you can download from that page will not work as is because as the error states It does not contain a top-level __init__.py file. The __init__.py file has to be in the top level of the zipped file. It can not be inside a directory within the zipped file.

Once I extracted the hello world directory and just zipped the __init__.py file up by itself, renamed the zip file helloworld_plugin.zip it added to calibre fine and it worked as advertised.

Quote:
Originally Posted by A0tmsk View Post
What makes things stranger is that I can take one of the plugins from here that works, extract it, and rezip it, and it no longer works.
When you rezip it do not zip the contents of the plugin inside another directory. I'm guessing when you view your new zip that the top level is a directory and you have to click down one level to see the plugin files.

See attached image to see what you should see inside your zip file. The __init__.py file is at the top level and it works fine. When you are rezipping it you must be putting it inside a directory.

Good Luck.
Attached Thumbnails
Click image for larger version

Name:	Qualitycheck_structure.jpg
Views:	771
Size:	76.4 KB
ID:	70510  
DoctorOhh is offline   Reply With Quote
Advert
Old 04-26-2011, 12:19 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,795
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The example plugins linked to in the tutorial are now fixed.
kovidgoyal is offline   Reply With Quote
Reply

Tags
calibre plugin, calibre plugins

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM
Trouble creating catlog with new version 0.7.36 dreamsgate Library Management 19 01-02-2011 07:25 PM
Using a plugin jrmckins Plugins 3 12-12-2010 11:48 AM
Metadata downlad plugin trouble Daermond Plugins 7 10-28-2010 03:33 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM


All times are GMT -4. The time now is 06:07 AM.


MobileRead.com is a privately owned, operated and funded community.