mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove unneeded exclusion
This commit is contained in:
parent
024b9cc0fd
commit
25ed9a53f9
@ -53,7 +53,6 @@ unfixable = ['PIE794', 'ISC001']
|
|||||||
"src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501']
|
"src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501']
|
||||||
"src/calibre/ebooks/metadata/sources/*" = ['UP']
|
"src/calibre/ebooks/metadata/sources/*" = ['UP']
|
||||||
"src/calibre/ebooks/metadata/sources/base.py" = ['RET501']
|
"src/calibre/ebooks/metadata/sources/base.py" = ['RET501']
|
||||||
"src/calibre/ebooks/pdf/reflow.py" = ['E114']
|
|
||||||
"src/calibre/gui2/store/stores/*" = ['UP']
|
"src/calibre/gui2/store/stores/*" = ['UP']
|
||||||
"src/qt/*.py" = ['I', 'E302']
|
"src/qt/*.py" = ['I', 'E302']
|
||||||
"src/qt/*.pyi" = ['I']
|
"src/qt/*.pyi" = ['I']
|
||||||
|
@ -236,7 +236,7 @@ class Text(Element):
|
|||||||
# Or assume any gap = a space?
|
# Or assume any gap = a space?
|
||||||
if (self.top <= other.top and self.bottom >= other.bottom) \
|
if (self.top <= other.top and self.bottom >= other.bottom) \
|
||||||
and abs(other.left - self.right) < 2.0:
|
and abs(other.left - self.right) < 2.0:
|
||||||
# and abs(other.left - self.right) < self.average_character_width / 3.0:
|
# and abs(other.left - self.right) < self.average_character_width / 3.0:
|
||||||
has_gap = 0
|
has_gap = 0
|
||||||
else: # Insert n spaces to fill gap. Use TAB? Columns?
|
else: # Insert n spaces to fill gap. Use TAB? Columns?
|
||||||
if other.left < self.right:
|
if other.left < self.right:
|
||||||
@ -782,7 +782,7 @@ class Page:
|
|||||||
or text.top > self.height \
|
or text.top > self.height \
|
||||||
or text.left > self.left+self.width \
|
or text.left > self.left+self.width \
|
||||||
or text.left < self.left:
|
or text.left < self.left:
|
||||||
# and re.match(r'href=', text.raw) is None:
|
# and re.match(r'href=', text.raw) is None:
|
||||||
self.texts.remove(text)
|
self.texts.remove(text)
|
||||||
elif (self.opts.pdf_header_skip <= 0 or text.top >= self.opts.pdf_header_skip) \
|
elif (self.opts.pdf_header_skip <= 0 or text.top >= self.opts.pdf_header_skip) \
|
||||||
and (self.opts.pdf_footer_skip <= 0 or text.top <= self.opts.pdf_footer_skip):
|
and (self.opts.pdf_footer_skip <= 0 or text.top <= self.opts.pdf_footer_skip):
|
||||||
@ -960,19 +960,19 @@ class Page:
|
|||||||
and lmargin >= rmargin - rmargin*CENTER_FACTOR \
|
and lmargin >= rmargin - rmargin*CENTER_FACTOR \
|
||||||
and lmargin <= rmargin + rmargin*CENTER_FACTOR \
|
and lmargin <= rmargin + rmargin*CENTER_FACTOR \
|
||||||
and '"float:right"' not in t.raw:
|
and '"float:right"' not in t.raw:
|
||||||
# and t.left + t.width + t.left >= self.width + l_offset - t.average_character_width \
|
# and t.left + t.width + t.left >= self.width + l_offset - t.average_character_width \
|
||||||
# and t.left + t.width + t.left <= self.width + l_offset + t.average_character_width:
|
# and t.left + t.width + t.left <= self.width + l_offset + t.average_character_width:
|
||||||
t.align = 'C'
|
t.align = 'C'
|
||||||
# Right aligned if left > FACTOR% of right
|
# Right aligned if left > FACTOR% of right
|
||||||
elif lmargin > indent_max \
|
elif lmargin > indent_max \
|
||||||
and lmargin > rmargin*RIGHT_FACTOR:
|
and lmargin > rmargin*RIGHT_FACTOR:
|
||||||
# and t.right >= self.width - t.average_character_width:
|
# and t.right >= self.width - t.average_character_width:
|
||||||
# What about right-aligned but indented on right?
|
# What about right-aligned but indented on right?
|
||||||
# What about indented rather than right-aligned?
|
# What about indented rather than right-aligned?
|
||||||
t.align = 'R'
|
t.align = 'R'
|
||||||
if not self.contents:
|
if not self.contents:
|
||||||
# We can get <a href=...Chapter... Should this check be done?
|
# We can get <a href=...Chapter... Should this check be done?
|
||||||
# if 'href=' not in t.raw:
|
# if 'href=' not in t.raw:
|
||||||
# Check for Roman numerals as the only thing on a line
|
# Check for Roman numerals as the only thing on a line
|
||||||
if re.match(r'^\s*[iIxXvV]+\s*$', t.text_as_string) is not None:
|
if re.match(r'^\s*[iIxXvV]+\s*$', t.text_as_string) is not None:
|
||||||
t.tag = 'h3'
|
t.tag = 'h3'
|
||||||
@ -1082,7 +1082,7 @@ class Page:
|
|||||||
if last_frag is not None \
|
if last_frag is not None \
|
||||||
and stats.para_space > 0 \
|
and stats.para_space > 0 \
|
||||||
and frag.bottom - last_frag.bottom > stats.para_space*SECTION_FACTOR:
|
and frag.bottom - last_frag.bottom > stats.para_space*SECTION_FACTOR:
|
||||||
# and frag.top - last_frag.bottom > frag.height + stats.line_space + (stats.line_space*LINE_FACTOR):
|
# and frag.top - last_frag.bottom > frag.height + stats.line_space + (stats.line_space*LINE_FACTOR):
|
||||||
frag.blank_line_before = 1
|
frag.blank_line_before = 1
|
||||||
last_frag = frag
|
last_frag = frag
|
||||||
tind += 1
|
tind += 1
|
||||||
@ -1752,7 +1752,7 @@ class PDFDocument:
|
|||||||
bcount = 0
|
bcount = 0
|
||||||
for b in self.bottoms:
|
for b in self.bottoms:
|
||||||
if bcount < self.bottoms[b]:
|
if bcount < self.bottoms[b]:
|
||||||
# and b > self.stats.bottom*0.9:
|
# and b > self.stats.bottom*0.9:
|
||||||
bcount = self.bottoms[b]
|
bcount = self.bottoms[b]
|
||||||
if b > self.stats.bottom:
|
if b > self.stats.bottom:
|
||||||
self.stats.bottom = b
|
self.stats.bottom = b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user