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, 09: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,462
Karma: 5446712
Join Date: Jul 2011
Location: 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, 22 views)
davidfor is offline   Reply With Quote
Old 08-14-2014, 10: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: 25,931
Karma: 5036099
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 online now   Reply With Quote
Old 08-14-2014, 10: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: 649
Karma: 2018502
Join Date: Jan 2013
Location: New Brunswick, Canada
Device: Kobo Glo
[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, 28 views)

Last edited by jgoguen; 08-14-2014 at 10:42 AM.
jgoguen is offline   Reply With Quote
Old 08-15-2014, 02: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, 04: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: 25,931
Karma: 5036099
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 online now   Reply With Quote
Old 08-15-2014, 08: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: 649
Karma: 2018502
Join Date: Jan 2013
Location: New Brunswick, Canada
Device: Kobo Glo
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
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 02:03 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
Plugin which uses net as input and output medve Development 0 12-04-2011 03:20 PM
Creat new Output plugin (LaTeX and/or txt2tags) Lebewesen Development 3 11-22-2011 11:10 AM
AZW Conversion Output Plugin tylau0 Plugins 59 08-14-2011 10:36 PM


All times are GMT -4. The time now is 12:38 PM.


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