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 11-02-2012, 07:59 AM   #346
sugarcandy243
Junior Member
sugarcandy243 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: B&N Nook
Updating calibre messed up generate cover plugin

I just updated calibre to the latest version (0.9.5) and now the generate cover plugin is not working. I have tried removing and installing it multiple times to no avail.
Every time I try to install it from the preferences->plugins option or manually, I get this error message:

calibre, version 0.9.5
ERROR: Install Plugin Failed: A problem occurred while installing this plugin. This plugin will now be uninstalled. Please post the error message in details below into the forum thread for this plugin and restart Calibre.

Traceback (most recent call last):
File "site-packages\calibre\gui2\dialogs\plugin_updater.py", line 734, in _install_clicked
File "site-packages\calibre\gui2\preferences\plugins.py", line 406, in check_for_add_to_toolbars
File "site-packages\calibre\customize\__init__.py", line 543, in load_actual_plugin
File "importlib\__init__.py", line 37, in import_module
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.generate_cover.action", line 17, in <module>
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.generate_cover.dialogs", line 29, in <module>
ImportError: cannot import name fontconfig

This is one of my absolute favorite plugins and it was working perfectly fine till I updated calibre! Any idea what's going wrong?
sugarcandy243 is offline   Reply With Quote
Old 11-02-2012, 08:03 AM   #347
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,749
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@kiwidude: The fontconfig module was removed from calibre (Indeed the whole font handling architecture has changed). Use fonts.scanner instead to locate fonts. Feel free to ask if you need more pointers.
kovidgoyal is online now   Reply With Quote
Advert
Old 11-02-2012, 10:44 AM   #348
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Kovid - aah, thanks for the steer. Though it seems there is a bug in the calibre FontFamilyModel class (which my plugin uses but it seems no calibre code does any more) as there is an error:
Code:
calibre, version 0.9.5
ERROR: Unhandled exception: <b>TypeError</b>:'tuple' object does not support item assignment

Traceback (most recent call last):
  File "calibre_plugins.generate_cover.action", line 50, in _generate_cover
  File "calibre_plugins.generate_cover.dialogs", line 1211, in __init__
  File "calibre_plugins.generate_cover.dialogs", line 854, in __init__
  File "calibre_plugins.generate_cover.dialogs", line 309, in __init__
  File "C:\Dev\Tools\eclipse\workspace\_Misc\trunk\src\calibre\gui2\widgets.py", line 363, in __init__
TypeError: 'tuple' object does not support item assignment
kiwidude is offline   Reply With Quote
Old 11-02-2012, 11:02 AM   #349
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Beta for next version

Ok, here is a version for people to try who have updated to calibre 0.9.5 and hence finding the plugin has stopped working. I will officially release it in a few hours assuming no issues...

Last edited by kiwidude; 11-03-2012 at 07:14 AM. Reason: Removed attachment as officially released
kiwidude is offline   Reply With Quote
Old 11-02-2012, 11:46 AM   #350
sugarcandy243
Junior Member
sugarcandy243 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: B&N Nook
Version 1.5.6 also shows error

Hi,
I downloaded the new version of the plugin and unfortunately I still get only an error message like this:

calibre, version 0.9.5
ERROR: Unhandled exception: <b>AttributeError</b>:'module' object has no attribute 'GenerateCoverAction'

Traceback (most recent call last):
File "site-packages\calibre\gui2\preferences\plugins.py", line 316, in add_plugin
File "site-packages\calibre\gui2\preferences\plugins.py", line 406, in check_for_add_to_toolbars
File "site-packages\calibre\customize\__init__.py", line 543, in load_actual_plugin
AttributeError: 'module' object has no attribute 'GenerateCoverAction'
sugarcandy243 is offline   Reply With Quote
Advert
Old 11-02-2012, 11:52 AM   #351
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@sugarcandy243 - did you remember to restart calibre after installing it?
kiwidude is offline   Reply With Quote
Old 11-02-2012, 11:58 AM   #352
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,749
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@kiwidude: Yeah, that class is obsolete use gui2.font_family_chooser instead. I didn't think any plugins would be using it, I forgot about generate cover.

I've spent the last two weeks learning all about the innards of font files to enable subsetting and the old architecture was inadequate, so I had to rewrite it wholesale.
kovidgoyal is online now   Reply With Quote
Old 11-02-2012, 12:14 PM   #353
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Kovid - interesting. It seems you have generally moved away from using using dropdowns of font names now? And instead using font dialogs either QFontDialog or your FontFamilyChooser.

Is this for any particular reason other than it fit your required functionality better? As in does it solve issues with crashes or provide a different set of fonts or whatever? If I can get away with the more minimal change to this plugin at this point (preserving the dialogs, and just "fixing" the FontFamilyModel class which I did for the attached version above) then it is less work, but if there are other reasons why I should instead switch to using the new dialogs... I can understand for doing conversions it is handy to see that if overriding a font for embedding it is useful to see all the variations like you do now, but that isn't quite necessary in the Generate Cover plugin.
kiwidude is offline   Reply With Quote
Old 11-02-2012, 12:21 PM   #354
sugarcandy243
Junior Member
sugarcandy243 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2012
Device: B&N Nook
Restart

@kiwidude yep, I restarted it after installation.

Update: I deleted the plugin, restarted my computer and installed it again.
It works now! Thank you so much

Last edited by sugarcandy243; 11-02-2012 at 12:26 PM.
sugarcandy243 is offline   Reply With Quote
Old 11-02-2012, 01:05 PM   #355
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,749
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The main reason was to fix the crashes. The old dropdown was crashing on a small percentage of windows computers (presumably because of a font Qt couldn't handle). The new dialog hopefully wont crash and even if it does it will only crash when the choose font button is clicked and not when the containing preference dialog is instantiated, making the crashes much less of an issue.

The additional functionality - seeing typefaces, the ability to add fonts and the ability to search (which I will add for the next release) are just gravy.

Incidentally, I dont use this plugin, but wouldn't you want to give your users the ability to select a particular typeface, not just a font family? As in bold/italic/whatever.
kovidgoyal is online now   Reply With Quote
Old 11-02-2012, 01:19 PM   #356
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,662
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by kiwidude View Post
@sugarcandy243 - did you remember to restart calibre after installing it?
Kiwidude, I got this while doing the install
Calibre portable on XP
Code:
calibre, version 0.9.5
ERROR: Unhandled exception: <b>AttributeError</b>:'module' object has no attribute 'GenerateCoverAction'

Traceback (most recent call last):
  File "site-packages\calibre\gui2\preferences\plugins.py", line 316, in add_plugin
  File "site-packages\calibre\gui2\preferences\plugins.py", line 406, in check_for_add_to_toolbars
  File "site-packages\calibre\customize\__init__.py", line 543, in load_actual_plugin
AttributeError: 'module' object has no attribute 'GenerateCoverAction'
I closed Calinre, checked the PI folder (the PI had todays timestamp)
I restarted and it functions
theducks is online now   Reply With Quote
Old 11-02-2012, 01:33 PM   #357
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Thanks for the info Kovid.

At the time I wrote this plugin it was more about getting it working as quickly as possible - which meant copying how calibre approached presenting the user with a font choice. I didn't want to go through my own pain curve of hitting issues that you presumably had solved over the years with calibre.

It is also a tradeoff. I am not a huge fan of popups off popups, which is what you get by having a font dialog window launched from a plugin window. And in this plugin where you have the preview of the cover image displayed it is more convenient (I think) to quickly stab the spin up/down boxes to make some text fit to your liking than repeatedly open and close font dialogs.

So given it has never crashed for me and I have a teeny fraction of the userbase that you have to support for the slim chance of it crashing for someone else using this plugin I can live with it as is for now and have a weekend off development instead
kiwidude is offline   Reply With Quote
Old 11-02-2012, 03:14 PM   #358
kiwidude
calibre/Sigil 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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@theducks / sugarcandy243 (and Kovid) - that error you see is a bug/flaw in calibre. It occurs when you have a plugin already placed on a toolbar that failed to load at calibre startup (as is the case with the official version of this plugin at the moment). When you try to install the new version of the plugin, it triggers code which is looking to see what toolbars the plugin already exists on if any.

In this case it knows where the Generate Cover plugin is supposed to appear on a toolbar and that in turn is triggering it to attempt to load the plugin. And because the plugin failed to load at calibre startup of course it can't load it, and that is the error you see.

As theducks found, it is just a case of clicking ok, closing calibre and starting it again and it will be fine. That error is just preventing you from seeing the next message which would normally tell you to restart calibre. Perhaps Kovid will add some extra logic in to catch this scenario, though it won't help anyone already on 0.9.5 and stuck at the moment.
kiwidude is offline   Reply With Quote
Old 11-02-2012, 04:06 PM   #359
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,662
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Thanks Kiwidude
theducks is online now   Reply With Quote
Old 11-02-2012, 08:52 PM   #360
orbonsj
Junior Member
orbonsj began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2011
Device: Kindle
problem with generate cover plug-in

I updated my Calibre to V 0.9.5, and lost the Generate Cover icon. When I tried to uninstall the plug-in and then re-install it, I got the error message:

calibre, version 0.9.5
ERROR: Install Plugin Failed: A problem occurred while installing this plugin. This plugin will now be uninstalled. Please post the error message in details below into the forum thread for this plugin and restart Calibre.

Traceback (most recent call last):
File "site-packages\calibre\gui2\dialogs\plugin_updater.py", line 734, in _install_clicked
File "site-packages\calibre\gui2\preferences\plugins.py", line 406, in check_for_add_to_toolbars
File "site-packages\calibre\customize\__init__.py", line 543, in load_actual_plugin
File "importlib\__init__.py", line 37, in import_module
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.generate_cover.action", line 17, in <module>
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.generate_cover.dialogs", line 29, in <module>
ImportError: cannot import name fontconfig

I then uninstalled Calibre with the Revo Uninstaller, and reinstalled the plug-ins that I use most. All but the Generate Cover did cleanly. I then got the same error message
orbonsj is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] User Category kiwidude Plugins 123 03-16-2024 11:59 PM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Open With kiwidude Plugins 402 03-16-2024 11:44 PM
[GUI Plugin] Goodreads Sync kiwidude Plugins 1713 03-16-2024 11:37 PM
[GUI Plugin] Clipboard Search kiwidude Plugins 24 03-16-2024 11:06 PM


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


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