View Single Post
Old 01-01-2022, 12:51 PM   #21
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: 876
Karma: 3501146
Join Date: Jan 2017
Location: Poland
Device: Various
I hope it will be useful to someone, so please don't hit me.

Easy quick and dirty fix for many plugins that use functions from common_utils.py). Of course, the following advice only makes sense for beta users before the plugin maintainers release new versions.

1. Edit file common_utils.py
2. Remove (twice) QRegExpValidator, QRegExp from imports
3. Delete this fragment* (if it exists):

Spoiler:
Code:
class NumericLineEdit(QLineEdit):
    '''
    Allows a numeric value up to two decimal places, or an integer
    '''
    def __init__(self, *args):
        QLineEdit.__init__(self, *args)
        self.setValidator(QRegExpValidator(QRegExp(r'(^\d*\.[\d]{1,2}$)|(^[1-9]\d*[\.]$)'), self))

[*] I haven't found a single plugin that uses this code, so it won't be a big deal.

In this way, I managed to modify about 90% of the plugins that I use and now work normally in the beta version.

The remaining plugins require minor or major changes, especially if they are to be backward compatible with previous versions of Calibre.
BeckyEbook is offline   Reply With Quote