mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Enforce minimum indent for lit files
This commit is contained in:
parent
1a3c375a65
commit
ef0ec5bd71
@ -997,6 +997,8 @@ class HTMLConverter(object):
|
||||
indent = Span.unit_convert(str(tag_css['text-indent']), self.profile.dpi, pts=True)
|
||||
if not indent:
|
||||
indent = 0
|
||||
if hasattr(self, 'minimum_indent') and indent > 0 and indent < self.minimum_indent:
|
||||
indent = self.minimum_indent
|
||||
|
||||
else:
|
||||
indent = self.book.defaultTextStyle.attrs['parindent']
|
||||
|
@ -42,7 +42,8 @@ def generate_html(pathtolit, logger):
|
||||
logger.info(p.stdout.read())
|
||||
ret = p.wait()
|
||||
if ret != 0:
|
||||
shutil.rmtree(tdir)
|
||||
if os.path.exists(tdir) and os.path.isdir(tdir):
|
||||
shutil.rmtree(tdir)
|
||||
err = p.stderr.read()
|
||||
raise ConversionError, err
|
||||
return tdir
|
||||
@ -76,7 +77,8 @@ def process_file(path, options, logger=None):
|
||||
if not options.output:
|
||||
ext = '.lrs' if options.lrs else '.lrf'
|
||||
options.output = os.path.abspath(os.path.basename(os.path.splitext(path)[0]) + ext)
|
||||
options.output = os.path.abspath(os.path.expanduser(options.output))
|
||||
options.output = os.path.abspath(os.path.expanduser(options.output))
|
||||
options.minimum_indent = 100
|
||||
html_process_file(htmlfile, options, logger=logger)
|
||||
finally:
|
||||
shutil.rmtree(tdir)
|
||||
|
Loading…
x
Reference in New Issue
Block a user