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 08-14-2014, 10:59 AM   #106
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,891
Karma: 5704423
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo Touch, Kobo Glo
Kovid: That makes sense. All except releasing the betas as the stable distro version. As both version of PyQt are importable, reversing the imports should fix it in this environment without breaking the others. Except maybe an Arch Linux that was still running a 1.x version of calibre.

Valvar: I have attached a version that reverses the imports. Could you test it and tell us how it goes?
Attached Files
File Type: zip KePub Output.zip (25.7 KB, 35 views)
davidfor is online now   Reply With Quote
Old 08-14-2014, 11:03 AM   #107
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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to make the imports completely robust you can do this:

from calibre import numeric_version
if numeric_version > (1, 200, 0):
# PyQt5
else:
# PyQt4
kovidgoyal is offline   Reply With Quote
Old 08-14-2014, 11:18 AM   #108
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 2018502
Join Date: Jan 2013
Location: San Francisco Bay Area
Device: Kindle Paperwhite 2
[Conversion Output] KePub Output Plugin

I've uploaded a new version that fixes the indentation. Not sure why my editor's PEP8 linting didn't catch that (or if I just missed it).



@Valvar: Kovid's right, you'll have all sorts of problems with calibre on Arch until the beta isn't beta anymore *and* all plugins are updated to not import from PyQ54 (or at least, to import PyQt5 first and fail back to PyQt4). I would strongly suggest that you not use any distro-provided calibre package (Arch or others), even on Linux I only tested with Kovid's packages.



Alright, fine, I feel bad not making such an easy change, try this update to the plugin and let me know if it works better with your distro package. Someone not on the beta and/or using the official package also please try and let me know if it breaks.

BTW, I do expect this to break on distro packages for non-beta users. So I do need someone on a distro package not the beta to try this as well.
Attached Files
File Type: zip KePub Output.zip (26.6 KB, 47 views)

Last edited by jgoguen; 08-14-2014 at 11:42 AM.
jgoguen is offline   Reply With Quote
Old 08-15-2014, 03:01 AM   #109
Valvar
Junior Member
Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'Valvar knows the difference between 'who' and 'whom'
 
Posts: 5
Karma: 10096
Join Date: Dec 2012
Location: Sweden
Device: Kobo Aura HD
Quote:
Originally Posted by davidfor View Post
Kovid: That makes sense. All except releasing the betas as the stable distro version. As both version of PyQt are importable, reversing the imports should fix it in this environment without breaking the others. Except maybe an Arch Linux that was still running a 1.x version of calibre.

Valvar: I have attached a version that reverses the imports. Could you test it and tell us how it goes?
This version works great on 1.205! On 1.40 (I downgraded Calibre to test) it throws this:

Quote:
calibre, version 1.40.0
ERROR: Unhandled exception: <b>AttributeError</b>:'module' object has no attribute 'QCheckBox'

calibre 1.40 isfrozen: False is64bit: True
Linux-3.16.1-1-ARCH-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF')
('Linux', '3.16.1-1-ARCH', '#1 SMP PREEMPT Thu Aug 14 07:40:19 CEST 2014')
Python 2.7.8
Linux: ('', '', '')
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/actions/convert.py", line 156, in convert_ebook
self.do_convert(book_ids, bulk=bulk)
File "/usr/lib/calibre/calibre/gui2/actions/convert.py", line 173, in do_convert
self.gui.library_view.model().db, book_ids, out_format=prefs['output_format'])
File "/usr/lib/calibre/calibre/gui2/tools.py", line 41, in convert_single_ebook
d = SingleConfig(parent, db, book_id, None, out_format)
File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 151, in __init__
self.setup_pipeline()
File "/usr/lib/calibre/calibre/gui2/convert/single.py", line 215, in setup_pipeline
self.plumber.get_option_help, self.db, self.book_id)
File "calibre_plugins.koboconversion.conversion.kepub_o utput", line 56, in gui_configuration_widget
File "calibre_plugins.koboconversion.conversion.config" , line 32, in __init__
File "/usr/lib/calibre/calibre/gui2/convert/__init__.py", line 55, in __init__
self.setupUi(self)
File "calibre_plugins.koboconversion.conversion.config" , line 53, in setupUi
AttributeError: 'module' object has no attribute 'QCheckBox'
Quote:
Originally Posted by jgoguen View Post
I've uploaded a new version that fixes the indentation. Not sure why my editor's PEP8 linting didn't catch that (or if I just missed it).



@Valvar: Kovid's right, you'll have all sorts of problems with calibre on Arch until the beta isn't beta anymore *and* all plugins are updated to not import from PyQ54 (or at least, to import PyQt5 first and fail back to PyQt4). I would strongly suggest that you not use any distro-provided calibre package (Arch or others), even on Linux I only tested with Kovid's packages.



Alright, fine, I feel bad not making such an easy change, try this update to the plugin and let me know if it works better with your distro package. Someone not on the beta and/or using the official package also please try and let me know if it breaks.

BTW, I do expect this to break on distro packages for non-beta users. So I do need someone on a distro package not the beta to try this as well.
This version seems to work exactly like davidfor's version. It works great under 1.205, but throws the same error under 1.40.

Thanks for the effort made to fix the plugin even after you've moved on! It's much appreciated!

(And I'm also very surprised at the beta packages being used for Arch - I haven't enabled [testing], so it must be a maintainer who is a bit crazy).
Valvar is offline   Reply With Quote
Old 08-15-2014, 05:40 AM   #110
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: 26,325
Karma: 5382313
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I have added some code that causes imports of PyQt4 to fail in calibre 2.x with an ImportError, which should mean that the original plugin will work unmodified.

https://github.com/kovidgoyal/calibr...29830a8e03f630
kovidgoyal is offline   Reply With Quote
Old 08-15-2014, 09:16 AM   #111
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 2018502
Join Date: Jan 2013
Location: San Francisco Bay Area
Device: Kindle Paperwhite 2
Quote:
Originally Posted by Valvar View Post
This version works great on 1.205! On 1.40 (I downgraded Calibre to test) it throws this:
Like I expected. Kovid's changes should help though, remove the plugin you got from my last post and reinstall the official one.




Quote:
Originally Posted by Valvar View Post
(And I'm also very surprised at the beta packages being used for Arch - I haven't enabled [testing], so it must be a maintainer who is a bit crazy).
It's in [community], which is kinda like AUR except more official [community] is also, IIRC, enabled by default. Honestly though, the maintainer should have known better.
jgoguen is offline   Reply With Quote
Old 10-23-2014, 10:43 AM   #112
SeigneurAo
Connoisseur
SeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the end
 
SeigneurAo's Avatar
 
Posts: 62
Karma: 31414
Join Date: Sep 2012
Location: France
Device: Kobo Glo
Hello.

I know this plugin is discontinued, but I thought I'd ask and might be lucky enough to address my issue somehow.

Setup
OS: Win 7 64 bits
Software: Calibre 2.6.0
Plugins: KoboTouchExtended 2.2.20 & Kepub Output 2.2.12
Error: "ImportError:No module named PyQt4" (when trying to convert a book, to kepub, obviously)
Stacktrace below:
Quote:
calibre, version 2.6.0
ERREUR : Exception non gérée: <b>ImportError</b>:No module named PyQt4

calibre 2.6 [64bit] isfrozen: True is64bit: True
Windows-7-6.1.7601-SP1 Windows ('64bit', 'WindowsPE')
('Windows', '7', '6.1.7601')
Python 2.7.8
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Successfully initialized third party plugins: KoboTouchExtended && Fichier de sortie KePub
Traceback (most recent call last):
File "site-packages\calibre\gui2\actions\convert.py", line 156, in convert_ebook
File "site-packages\calibre\gui2\actions\convert.py", line 173, in do_convert
File "site-packages\calibre\gui2\tools.py", line 41, in convert_single_ebook
File "site-packages\calibre\gui2\convert\single.py", line 151, in __init__
File "site-packages\calibre\gui2\convert\single.py", line 215, in setup_pipeline
File "calibre_plugins.koboconversion.conversion.kepub_o utput", line 56, in gui_configuration_widget
File "calibre_plugins.koboconversion.conversion.config" , line 32, in __init__
File "site-packages\calibre\gui2\convert\__init__.py", line 62, in __init__
File "calibre_plugins.koboconversion.conversion.config" , line 41, in setupUi
ImportError: No module named PyQt4
My understanding is that there should be a 2.2.20 version around for Kepub Output also (I read it in this very thread, also it is advertised as such on the official website).
However, when I download the plugin, be it from said website of the first post of this thread, I still get a second instance of the plugin, still stating 2.2.12.
And trying to auto-update plugins doesn't seem to be any more helpful.

My question is: how could I get an actual 2.2.20 version? Will it solve the PyQt compatibility issue? If not, is it solvable at all?

Thanks in advance for your time, and whatever happens thanks for your wonderful work guys, both on Calibre and Kepub Output. It was good while it lasted
SeigneurAo is offline   Reply With Quote
Old 10-23-2014, 11:18 AM   #113
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 2018502
Join Date: Jan 2013
Location: San Francisco Bay Area
Device: Kindle Paperwhite 2
That's very strange indeed. I just downloaded the plugin from both this thread and from plugins.calibre-ebook.com and confirmed that both files are identical and provide version 2.2.20:

Code:
% shasum -a 256 220565.zip KePub\ Output.zip
6b94b634a8594ae0a70bb1c2da4a84f6a1f0f7e8342b793d3e68c07d12e1e284  220565.zip
6b94b634a8594ae0a70bb1c2da4a84f6a1f0f7e8342b793d3e68c07d12e1e284  KePub Output.zip
The first one is from plugins.calibre-ebook.com, the second is from the first post of this thread.

Could you please try removing all of the instances of KePub Output, then restart calibre, then install it using calibre? To do that, in case you don't know, click on Preferences, then under Advanced click on Plugins, then Get new plugins. Make sure that "Filter list of plugins" is set to Not installed, then enter KePub Output in the "Filter by name" text field. You should see one item in the list, and the Available column should read "2.2.20". Select it and click Install, then follow the prompts and restart calibre.
jgoguen is offline   Reply With Quote
Old 10-23-2014, 11:31 AM   #114
SeigneurAo
Connoisseur
SeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the end
 
SeigneurAo's Avatar
 
Posts: 62
Karma: 31414
Join Date: Sep 2012
Location: France
Device: Kobo Glo
Actually, I already tried to do just that but Calibre won't let me, on the grounds that it is an "integrated plugin". I can't delete, nor disable KePub Output, which is quite odd since the "Get new plugins" menu states it's not installed at all ô_Ô
Maybe I should reinstall Calibre fresh altogether?
SeigneurAo is offline   Reply With Quote
Old 10-23-2014, 11:46 AM   #115
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 2018502
Join Date: Jan 2013
Location: San Francisco Bay Area
Device: Kindle Paperwhite 2
Something is definitely strange, this is most definitely not an integrated plugin and I definitely haven't set that flag in the code

I think reinstalling might be overkill, since you'll not lose any of your settings or installed plugins. But let's try the nuclear option

Start by opening Preferences again, then click Miscellaneous, then click Open calibre configuration directory. Go back and shut down calibre. Then go back to the folder window that opened, go into the plugins folder, and delete anything that has "KePub" in the name. Restart calibre and try to install KePub Output again.
jgoguen is offline   Reply With Quote
Old 10-23-2014, 11:50 AM   #116
SeigneurAo
Connoisseur
SeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the end
 
SeigneurAo's Avatar
 
Posts: 62
Karma: 31414
Join Date: Sep 2012
Location: France
Device: Kobo Glo
Heh, great minds think alike or whatever.
I just finished testing, and it turned out reinstalling calibre didn't help indeed, but it did trigger my curiosity, since I didn't lose any data in the process (all my library still there, configuration was still the same and "user-installed" plugins also).

So I went into "C:\Users\XXX\AppData\Roaming\calibre\plugins" and deleted whatever was in there (only your 2 plugins anyway) and restarted Calibre. And voilà, could now install a fresh 2.2.20.
I still can't start to understand how it got stuck like that, but now it's solved.

Thanks for your prompt answer and help!
SeigneurAo is offline   Reply With Quote
Old 10-23-2014, 11:56 AM   #117
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 658
Karma: 2018502
Join Date: Jan 2013
Location: San Francisco Bay Area
Device: Kindle Paperwhite 2
There was a brief period where an error in applying translations caused both of my plugins' names to be translated where they shouldn't have been, which caused the plugins to appear twice or be un-upgradable for some people and required a manual removal to fix. It's possible you got caught by that problem.
jgoguen is offline   Reply With Quote
Old 10-23-2014, 12:05 PM   #118
SeigneurAo
Connoisseur
SeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the endSeigneurAo knows the complete value of PI to the end
 
SeigneurAo's Avatar
 
Posts: 62
Karma: 31414
Join Date: Sep 2012
Location: France
Device: Kobo Glo
Well, KePub Output certainly does appear as "Fichier de sortie KePub" for me. Might have something to do with the issue.
SeigneurAo 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
catalogue builder output columns are not in the same order in the output KWhytte Library Management 5 12-04-2012 03:03 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 03:24 AM
Plugin which uses net as input and output medve Development 0 12-04-2011 04:20 PM
Creat new Output plugin (LaTeX and/or txt2tags) Lebewesen Development 3 11-22-2011 12:10 PM
AZW Conversion Output Plugin tylau0 Plugins 59 08-14-2011 11:36 PM


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


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