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 05-15-2011, 12:57 PM   #1
byrnerat101
Junior Member
byrnerat101 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2011
Device: kindle3
Can't add plugins (Calibre 8.1 on Arch Linux)

Hi, I've been struggling to add plugins to Calibre for a while now. I have read the directions and followed them explicitly yet when I navigate to the folder that contains the zipped plugins, nothing appears. The plugins are unaltered, zipped as distributed, and I have tried multiple different plugins so I think its an issue with my install.

I have tried calibre-debug -g which outputs no errors whatsoever, I have opened the plugins to verify that __Init__.py and the required txt file are there and intact. I've verified that python2 import zipimport works as it should... I'm at my wits end here. I have found no errors whatsoever but the plugins still refuse to display. Any help would be greatly appreciated. Thanks!
byrnerat101 is offline   Reply With Quote
Old 05-15-2011, 01:00 PM   #2
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
In the dialog your are using to browse to the plugin try changing the filter to all files in the bottom of the dialog.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 05-15-2011, 01:04 PM   #3
byrnerat101
Junior Member
byrnerat101 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2011
Device: kindle3
I thought to try the same thing but strangely the only filter is Plugins. There is no option to change it to all files.
byrnerat101 is offline   Reply With Quote
Old 05-15-2011, 01:21 PM   #4
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What desktop are you using?

You can add a plugin by doing

calibre-customize -a /path/to/plugin.zip

on the command line.
kovidgoyal is offline   Reply With Quote
Old 05-15-2011, 01:45 PM   #5
byrnerat101
Junior Member
byrnerat101 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2011
Device: kindle3
I am using xfce4 with thunar as the desktop/file manager. Using calibre-customize worked like a charm though, thanks!

Let me know what other information I can provide as I'd love to get this working through the gui.
byrnerat101 is offline   Reply With Quote
Old 05-15-2011, 01:47 PM   #6
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,220
Karma: 1333994
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
If you install the plugin updater plugin (using calibre-customize) that would circumvent this issue for you - as plugins are chosen via a Calibre gui rather than from the file manager.
kiwidude is offline   Reply With Quote
Old 05-15-2011, 02:25 PM   #7
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not much I can do about that, calibre just uses a standard Qt function to open a file chooser dialog. You would have to get Qt to fix whatever the issue with xfce's native file chooser is.
kovidgoyal is offline   Reply With Quote
Old 07-10-2011, 08:44 AM   #8
dinky
Junior Member
dinky began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2011
Device: Android Nexus One Phone
It's not only in Thunar. I'm running version 0.7.44 in Ubuntu 11.04, and have the same problem... exactly, with the gnome file manager, nautilus. Will also need to install these plugins from the command line. Think there's something more than just QT going on here. Thanks.
dinky is offline   Reply With Quote
Old 12-25-2011, 09:57 PM   #9
katze_sonne
Junior Member
katze_sonne began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kindle 4 NT
Talking

Hey,

I'm experiencing the same problem. There's no chance to choose the plugin Zip-files with the Calibre-GUI. They're just not shown.

In my case: Archlinux, GNOME3 (with Nautilus file-manager)...

Anyway, thanks for letting us know the alternative commandline way to add plugins...

You can skip this next part, which is just showing two different workarounds
=====
After playing around a little bit with the python-scripts usr/lib/calibre/gui2/dialogs/plugins.py (that's the part of Calibre calling the File Chooser), I found a workaround (actually two ):

1) Change "all_files=False" (line 276) to "all_files=True" - and you'll at least have the possibility to choose "all files" in the file-chooser-dialog and select the "*.zip"-files. Of course, that isn't the nicest workaround.

2) I don't think that this is true:
Quote:
Not much I can do about that, calibre just uses a standard Qt function to open a file chooser dialog. You would have to get Qt to fix whatever the issue with xfce's native file chooser is.
Because if I change lines 275-277 from:
Code:
        path = choose_files(self, 'add a plugin dialog', _('Add plugin'),
                filters=[(_('Plugins') + ' (*.zip)', ['.zip'])], all_files=True,
                    select_only_single_file=True)
to:
Code:
        from PyQt4.Qt import QFileDialog
        path = QFileDialog.getOpenFileName(self, 'add a plugin dialog', _('Add plugin'),
                (_('Plugins') + ' (*.zip)'));
...it directly calls the QFileDialog instead of the calibre-function "choose_files" (which links to another function and so on) works like charm. It seems to show exactly the same behaviour as it is supposed to.

Therefore, I think that there seems to be a bug somewhere in the Calibre code, but not in the Qt function... However, my programming skills are yet to limited to find the real source of the problem

here you can go on reading
=====

Allright, I think I found the "ultimate" solution now. The error definitely seems to be in the code in lines 275-277 (I noticed it when comparing that code witht the one from the "add single books"-dialog, which also has an option to only add archives):
Just change this code:
Code:
        path = choose_files(self, 'add a plugin dialog', _('Add plugin'),
                filters=[(_('Plugins') + ' (*.zip)', ['.zip'])], all_files=True,
                    select_only_single_file=True)
to this:
Code:
        path = choose_files(self, 'add a plugin dialog', _('Add plugin'),
                filters=[(_('Plugins'), ['.zip'])], all_files=False,
                    select_only_single_file=True)
Would be great if that could be put into the next Calibre-Release (given that my guess was right ). for this great programme!!!

Regards,
katze_sonne

Last edited by katze_sonne; 12-25-2011 at 09:59 PM.
katze_sonne is offline   Reply With Quote
Old 12-25-2011, 10:56 PM   #10
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Your change is not a "correct" fix. What it does is not show the extension being added. The dialog is supposed to show the extension being added, and it works on Windows, OS X, KDE. Furthermore it is the correct was to use QFileDialog as per the official Qt documentation: http://developer.qt.nokia.com/doc/qt...iledialog.html

Only some GNOME themes have problems with it, the fix needs to happen in them. Not showing the extensions reduces usability of the dialog.
kovidgoyal is offline   Reply With Quote
Old 12-26-2011, 06:11 AM   #11
katze_sonne
Junior Member
katze_sonne began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kindle 4 NT
Hi,

thanks for your answer!

Quote:
The dialog is supposed to show the extension being added
I know - but that's also not the case in the "original" code, which was there before. Also in the add book dialog there are no file extensions shown... (and AFAIK it's the same syntax I used)

The "choose_files"-function is imported from the /gui2/__init__.py-script, I Think (line 615). There the Class FileDialog is used. It is defined in lines 528 and following. Actually I am not really sure about what this code:
Code:
extensions = ['*'+(i if i.startswith('.') else '.'+i) for i in
                        extensions]
                ftext += '%s (%s);;'%(text, ' '.join(extensions))
...does, but I think it extracts the file extension and hangs it at the end again, so that the QFileDialog is called the right way (so it can show the file extension, if you do not have the standard GNOME3-Theme)

Quote:
Not showing the extensions reduces usability of the dialog.
True, but in my opinion it's not a reason why importing file shouldn't work *at all*...

Quote:
Furthermore it is the correct was to use QFileDialog as per the official Qt documentation:
Sorry, what do you mean by this sentence? I've read over it severel times now, but I just don't get it... (and I had a look at the pyqt documentation)

katze_sonne
katze_sonne is offline   Reply With Quote
Old 12-26-2011, 11:04 AM   #12
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by katze_sonne View Post
True, but in my opinion it's not a reason why importing file shouldn't work *at all*...
It only doesn't work on GNOME. I am not going to reduce usability for 98% of calibre users to workaround a bug in the Qt GNOME theme.

Quote:

Sorry, what do you mean by this sentence? I've read over it severel times now, but I just don't get it... (and I had a look at the pyqt documentation)
Read the first two codes samples in the documentation for QFileDialog.
kovidgoyal is offline   Reply With Quote
Old 12-27-2011, 12:47 AM   #13
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: 24,768
Karma: 4369667
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I had a brainwave Code committed that should fix this, while still preserving usability.
kovidgoyal is offline   Reply With Quote
Old 12-30-2011, 06:18 AM   #14
katze_sonne
Junior Member
katze_sonne began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2011
Device: Kindle 4 NT
Quote:
I am not going to reduce usability for 98% of calibre users to workaround a bug in the Qt GNOME theme.
No, of course not I thougt it would still preserve this usability with file extensions.

...however, it's great to hear that the bug was fixed now after such a short time I've seen that there's an update for Calibre already and I'll install / try it as soon as it's available in the Archlinux repositories.

Oh, just seen that:
Quote:
Originally Posted by Calibre Website
Please do not use your distribution provided calibre package, as those are often buggy/outdated. Instead use the Binary install described below.
oops :-D though calibre seems to be stable here on arch and I'll see if the packets are kept up-to-date soon.

Thanks again,
katze_sonne

EDIT: I've just donated some money (not specifically for the bugfix, but for Calibre itself).

Last edited by katze_sonne; 12-30-2011 at 10:33 AM.
katze_sonne is offline   Reply With Quote
Old 02-21-2012, 05:12 AM   #15
grothauu
Junior Member
grothauu began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2011
Device: Kindle3
I tried to install a plugin with the dialog and it didn't work. Still the same problem. The zip files aren't shown in the dialog box. Ubuntu 11.4, Calibre 0.8.8. I m going to try the workaround now.
Uli
grothauu 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
Best Calibre plugins/tweaks baronrus Kobo Reader 2 05-24-2011 11:09 PM
Calibre und Kindle-Plugins hamlok Amazon Kindle 13 05-01-2011 04:14 AM
Calibre 0.7.32 - Plugins not working after installation? hakan42 Plugins 2 12-05-2010 02:24 PM
sigil Arch Linux wetterau Sigil 5 12-02-2010 12:59 PM
Installing Calibre in Arch Linux jatz Calibre 0 03-23-2010 01:41 PM


All times are GMT -4. The time now is 02:55 AM.


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