mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
4b7011a82d
commit
55808e5f68
@ -113,7 +113,7 @@ class Split(object):
|
|||||||
for i, elem in enumerate(item.data.iter()):
|
for i, elem in enumerate(item.data.iter()):
|
||||||
try:
|
try:
|
||||||
elem.set('pb_order', str(i))
|
elem.set('pb_order', str(i))
|
||||||
except TypeError: # Cant set attributes on comment nodes etc.
|
except TypeError: # Cant set attributes on comment nodes etc.
|
||||||
continue
|
continue
|
||||||
|
|
||||||
page_breaks = list(page_breaks)
|
page_breaks = list(page_breaks)
|
||||||
@ -171,7 +171,6 @@ class Split(object):
|
|||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FlowSplitter(object):
|
class FlowSplitter(object):
|
||||||
'The actual splitting logic'
|
'The actual splitting logic'
|
||||||
|
|
||||||
@ -313,7 +312,6 @@ class FlowSplitter(object):
|
|||||||
split_point = root.xpath(path)[0]
|
split_point = root.xpath(path)[0]
|
||||||
split_point2 = root2.xpath(path)[0]
|
split_point2 = root2.xpath(path)[0]
|
||||||
|
|
||||||
|
|
||||||
def nix_element(elem, top=True):
|
def nix_element(elem, top=True):
|
||||||
# Remove elem unless top is False in which case replace elem by its
|
# Remove elem unless top is False in which case replace elem by its
|
||||||
# children
|
# children
|
||||||
@ -393,7 +391,6 @@ class FlowSplitter(object):
|
|||||||
buf = part
|
buf = part
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
def split_to_size(self, tree):
|
def split_to_size(self, tree):
|
||||||
self.log.debug('\t\tSplitting...')
|
self.log.debug('\t\tSplitting...')
|
||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
@ -440,7 +437,7 @@ class FlowSplitter(object):
|
|||||||
len(self.split_trees), size/1024.))
|
len(self.split_trees), size/1024.))
|
||||||
else:
|
else:
|
||||||
self.log.debug(
|
self.log.debug(
|
||||||
'\t\t\tSplit tree still too large: %d KB' % \
|
'\t\t\tSplit tree still too large: %d KB' %
|
||||||
(size/1024.))
|
(size/1024.))
|
||||||
self.split_to_size(t)
|
self.split_to_size(t)
|
||||||
|
|
||||||
@ -546,7 +543,6 @@ class FlowSplitter(object):
|
|||||||
for x in toc:
|
for x in toc:
|
||||||
fix_toc_entry(x)
|
fix_toc_entry(x)
|
||||||
|
|
||||||
|
|
||||||
if self.oeb.toc:
|
if self.oeb.toc:
|
||||||
fix_toc_entry(self.oeb.toc)
|
fix_toc_entry(self.oeb.toc)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user