Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-05-2022, 07:21 AM   #61
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 410
Karma: 145324
Join Date: Dec 2017
Device: Kobo
Okay, after some time, I just understood the compatibility of Qt.ItemFlag.
In fact, use the Qt.ItemFlags is a wrong usage, even in Qt5, the correcte usage and class is the 'simple' Qt.ItemFlag that actualy implemented.

Well,
All is done.
And congrat for the work kovidgoyal.
un_pogaz is offline   Reply With Quote
Old 01-05-2022, 11:54 AM   #62
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I was modifying some of the conversion options and managed to get an error message when I tried to open the output options.

calibre, version 5.99.2
ERROR: Unhandled exception: <b>AttributeError</b>:'QPrinter' object has no attribute 'pageSize'

Spoiler:
Code:
calibre 5.99.2 Portable embedded-python: True
Windows-10-10.0.22000 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.22000')
Python 3.10.1
Windows: ('10', '10.0.22000', '', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (10, 0, 2) && Annotations (1, 16, 0) && Calibre Power Search Plugin (2, 1, 1) && Count Pages (1, 11, 1) && Diaps Editing Toolbag (0, 3, 7) && EpubCheck (0, 2, 4) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && FanFicFare (4, 8, 0) && Fantastic Fiction (1, 5, 1) && Find Duplicates (1, 8, 10) && Goodreads (1, 5, 3) && Goodreads Sync (1, 15, 1) && Hyphenate This! (0, 1, 3) && Job Spy (1, 0, 190) && KePub Output (3, 5, 3) && Kindle hi-res covers (0, 5, 0) && KindleUnpack - The Plugin (0, 83, 0) && Kobo Books (1, 8, 3) && Kobo Utilities (2, 15, 0) && KoboTouchExtended (3, 5, 4) && Modify ePub (1, 6, 3) && Obok DeDRM (10, 0, 0) && Open With (1, 5, 13) && Quality Check (1, 11, 4) && Resize Cover (1, 1, 0) && ScrambleEbook (0, 4, 5) && SmartEject (2, 3, 0) && Smashwords Metadata (1, 0, 2)
Traceback (most recent call last):
  File "calibre\gui2\preferences\main.py", line 319, in show_plugin
  File "calibre\gui2\preferences\conversion.py", line 99, in genesis
  File "calibre\gui2\preferences\conversion.py", line 96, in widget_factory
  File "calibre\gui2\convert\pdf_output.py", line 36, in __init__
  File "calibre\gui2\widgets.py", line 1271, in initialize
AttributeError: 'QPrinter' object has no attribute 'pageSize'


This happened after I set the Conversion => Common options => Page setup => Output Profile => tablet and all 4 margins to 0.0pt.

After this, if I clicked on any of the 3 Conversion options, I got a rather messy popup. See attached image for that.
Attached Thumbnails
Click image for larger version

Name:	common_options.png
Views:	146
Size:	97.1 KB
ID:	191359  

Last edited by DNSB; 01-05-2022 at 12:01 PM.
DNSB is offline   Reply With Quote
Advert
Old 01-05-2022, 12:12 PM   #63
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@DNSB: Good catch. https://github.com/kovidgoyal/calibr...dc813a633f51ef
kovidgoyal is offline   Reply With Quote
Old 01-05-2022, 12:33 PM   #64
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,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Review Downloaded Metadata

I just tried to use Review Download Metadata (results of using Ctrl-d)
Win10 x64 5.99.2
Attached Files
File Type: txt Revviewdownload.txt (2.0 KB, 128 views)
theducks is online now   Reply With Quote
Old 01-05-2022, 02:36 PM   #65
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm trying to get a handle on what all of my options are, here. So a few questions:

1) If I want to use the handy-dandy-
Code:
from qt.core import yada
-built-in compatibility approach, then the minimum calibre version needed for my plugin will now become 5.13, right? Basing this on:
Quote:
Originally Posted by kovidgoyal View Post
Indeed, from calibre 5.13 onwards you can simply do all Qt related imports as

from qt.core import whatever

It works on qt 5 and qt 6. This is what is used in calibre source code itself.
2) My hope for my plugins was to drop support for PtQt4 completely and use my own try/except imports for PyQt5/6 in order to support calibre 2.0+. This seems fairly trivial in my testing and, in fact, seems to work just fine... on systems where calibre is using its own embedded Python/Qt/PyQt. However, this fails miserably on my Arch machine using the pacman-supplied calibre 5.33 because my system has both PyQt5 and PyQt6 installed at the same time. So the initial import of PyQt6 in my plugin does not fail like I need it to with Calibre 5.33 on that system. Any way around this? I don't want to have to tell my users that they need to uninstall PyQt6 on Arch to get things working.

No criticism/judgement, here. I'm just making sure I understand all my options before making a decision about what to do.

The easiest thing to do would be to forget everything that came before calibre 5.13. I just don't know if I'm ready to do that. I was hoping to support calibre 2.0+ on all systems. Even those with debundled python/qt that might have multiple PyQt versions installed like my Arch machine.

Last edited by DiapDealer; 01-05-2022 at 03:03 PM.
DiapDealer is offline   Reply With Quote
Advert
Old 01-05-2022, 03:06 PM   #66
Leseratte_10
Groupie
Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.Leseratte_10 ought to be getting tired of karma fortunes by now.
 
Posts: 181
Karma: 2010542
Join Date: Sep 2021
Device: PB Era, PB InkPad 3 Pro
Not sure how it works on Arch, but couldn't you just check the Calibre version, then import QT5 for <= 5.x, and QT6 for >= 6? Instead of using a try-catch-block to detect QT5 vs QT6? Surely there's some kind of Calibre API to get the Calibre version? (EDIT: Like described in the next post).

Or, do "from qt.core import yada" in a try-except-block, and if that fails, it's Calibre 5 or older and you can import QT5.

Last edited by Leseratte_10; 01-05-2022 at 03:22 PM.
Leseratte_10 is offline   Reply With Quote
Old 01-05-2022, 03:20 PM   #67
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 928
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by DiapDealer View Post
2) My hope for my plugins was to drop support for PtQt4 completely and use my own try/except imports for PyQt5/6 in order to support calibre 2.0+. This seems fairly trivial in my testing and, in fact, seems to work just fine... on systems where calibre is using its own embedded Python/Qt/PyQt. However, this fails miserably on my Arch machine using the pacman-supplied calibre 5.33 because my system has both PyQt5 and PyQt6 installed at the same time. So the initial import of PyQt6 in my plugin does not fail like I need it to with Calibre 5.33 on that system. Any way around this? I don't want to have to tell my users that they need to uninstall PyQt6 on Arch to get things working.

Maybe you could check for calibre version instead of Qt:

Code:
from calibre.constants import numeric_version
if numeric_version < (6, 0, 0):
   PyQt5 imports
else:
   PyQt6 imports
EDIT: @Leseratte_10 beated me. =)

Last edited by thiago.eec; 01-05-2022 at 03:23 PM.
thiago.eec is offline   Reply With Quote
Old 01-05-2022, 03:50 PM   #68
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
All seems doable, thanks for the ideas! I may opt for something along the lines of:

Code:
from calibre.constants import numeric_version
if numeric_version < (5, 13, 0):
   PyQt5 imports
else:
   from qt.conf import yada
That should allow me to support Calibre 2.0+, with the advantage of being (somewhat) prepared for calibre PyQt7.
DiapDealer is offline   Reply With Quote
Old 01-05-2022, 05:43 PM   #69
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Obviously meant "qt.core"
DiapDealer is offline   Reply With Quote
Old 01-05-2022, 08:47 PM   #70
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 516
Karma: 32106
Join Date: Feb 2012
Device: Onyx Boox Leaf
Dear Kovid,

I would like to report that the GUI texts are shown in low res or dpi (v5.99.2 on Windows 11)

nqk is offline   Reply With Quote
Old 01-05-2022, 10:12 PM   #71
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@DiapDealer: You just need to do

Code:
try:
    from qt.core import whatever
except ImportError:
    from PyQt5.Qt import whatever
kovidgoyal is offline   Reply With Quote
Old 01-05-2022, 10:13 PM   #72
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@nqk: DPI is now entirely controlled by Qt. You can check your env vars. See https://doc.qt.io/qt-6/portingguide.html#high-dpi
kovidgoyal is offline   Reply With Quote
Old 01-05-2022, 10:24 PM   #73
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,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by theducks View Post
I just tried to use Review Download Metadata (results of using Ctrl-d)
Win10 x64 5.99.2
https://github.com/kovidgoyal/calibr...34bc5982f91dca
kovidgoyal is offline   Reply With Quote
Old 01-06-2022, 06:58 AM   #74
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by nqk View Post
I would like to report that the GUI texts are shown in low res or dpi (v5.99.2 on Windows 11)
@nqk: IMHO, this is not a problem with low resolution, but with Segoe UI Light hinting in Windows 10/11 which makes the font look too delicate. Change the default font to Segoe UI Normal and you will see that everything looks perfectly sharp.
BeckyEbook is offline   Reply With Quote
Old 01-06-2022, 11:51 AM   #75
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 928
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Just noticed a bug on Configure Metadata Download dialog: checkboxes changes are not being saved. Other changes get saved.
This also happens configuring individual sources.
thiago.eec is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion for PI Devs BetterRed Plugins 11 09-27-2020 06:18 PM
Attn plugin devs: porting to python 3 kovidgoyal Plugins 129 06-16-2020 01:31 AM
Attention All Plugin Devs: Remove vestiges from python 2? KevinH Plugins 11 05-29-2020 03:16 PM
Plugin Devs: Should we include a License or COPYING file? KevinH Plugins 3 08-15-2017 01:09 PM
New Plugin Features in the upcoming Sigil 0.8.900 KevinH Plugins 6 09-14-2015 02:48 PM


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


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