View Single Post
Old 01-02-2022, 03:23 PM   #8
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 169
Karma: 1497966
Join Date: Jul 2021
Device: N/A
Calibre prior to 5.00 is working with python 2, after version 5.00 it's python 3, that's why it doesn't works. If you upgrade Calibre, it will work. There is plenty of new features, you should do it.
If you want to keep your old version try this code:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
    start_at = 80
    n = int(match.group(1))
    if n >= start_at:
        return str(n+1) + match.group(2)
    return match.group(0)
lomkiri is offline   Reply With Quote