Quote:
Originally Posted by kovidgoyal
If you know how to program it should not be hard to wite a script that uses the check book infrastructure to auto-fix correctable errors and run it via calibre-debug
Something as simple as
Code:
from calibre.ebooks.oeb.polish.check.main import run_checks, fix_errors
from calibre.ebooks.oeb.polish.container import get_container
import sys
filepath = sys.argv[-1]
container = get_container(filepath, tweak_mode=True)
errors = run_checks(container)
if errors:
print ('Found errors, trying to fix them')
if fix_errors(container, errors):
container.commit()
|
Thanks eschwartz, thanks kovidgoyal!
It is very useful information for me! I'm familiar with python, but not familiar with Calibre yet. Can you help me, or give me a link, that can explain, how to run this script in Calibre? Such a quick start to scripting.
Thanks again,
Georgy