mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-19 12:43:35 +02:00
Re added (probably) right formating codes.
This commit is contained in:
@@ -6,11 +6,6 @@ from lxml import etree
|
||||
from ebook_converter.ebooks.oeb.base import rewrite_links, urlnormalize
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
|
||||
class RenameFiles(object): # {{{
|
||||
|
||||
'''
|
||||
|
||||
@@ -149,7 +149,7 @@ class RemoveFakeMargins(object):
|
||||
remove = set()
|
||||
for k, v in self.levels.items():
|
||||
num = len(v)
|
||||
self.log.debug('Found %s items of level: %s', num, k)
|
||||
self.log.debug('Found %d items of level: %s', num, k)
|
||||
level = int(k.split('_')[-1])
|
||||
tag = k.split('_')[0]
|
||||
if tag == 'p' and num < 25:
|
||||
|
||||
@@ -60,7 +60,7 @@ class RescaleImages(object):
|
||||
if scaled:
|
||||
new_width = max(1, new_width)
|
||||
new_height = max(1, new_height)
|
||||
self.log('Rescaling image from %sx%s to %sx%s %s', width,
|
||||
self.log('Rescaling image from %dx%d to %dx%d %s', width,
|
||||
height, new_width, new_height, item.href)
|
||||
try:
|
||||
img = img.resize((new_width, new_height))
|
||||
|
||||
@@ -22,9 +22,6 @@ from ebook_converter.css_selectors import Select, SelectorError
|
||||
from ebook_converter.utils import encoding as uenc
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
XPath = functools.partial(_XPath, namespaces=const.XPNSMAP)
|
||||
|
||||
SPLIT_POINT_ATTR = 'csp'
|
||||
@@ -128,7 +125,7 @@ class Split(object):
|
||||
page_breaks.add(elem)
|
||||
except SelectorError as err:
|
||||
self.log.warn('Ignoring page breaks specified with invalid '
|
||||
'CSS selector: %s (%s)', selector, err)
|
||||
'CSS selector: %r (%s)', selector, err)
|
||||
|
||||
for i, elem in enumerate(item.data.iter('*')):
|
||||
try:
|
||||
@@ -227,7 +224,7 @@ class FlowSplitter(object):
|
||||
for i, tree in enumerate(trees):
|
||||
size = len(tostring(tree.getroot()))
|
||||
if size > self.max_flow_size:
|
||||
self.log.info('\tFound large tree #%s', i)
|
||||
self.log.info('\tFound large tree #%d', i)
|
||||
lt_found = True
|
||||
self.split_trees = []
|
||||
self.split_to_size(tree)
|
||||
@@ -240,7 +237,7 @@ class FlowSplitter(object):
|
||||
|
||||
self.was_split = len(self.trees) > 1
|
||||
if self.was_split:
|
||||
self.log('\tSplit into %s parts', len(self.trees))
|
||||
self.log('\tSplit into %d parts', len(self.trees))
|
||||
self.commit()
|
||||
|
||||
def split_on_page_breaks(self, orig_tree):
|
||||
@@ -380,7 +377,7 @@ class FlowSplitter(object):
|
||||
continue
|
||||
elif size <= self.max_flow_size:
|
||||
self.split_trees.append(t)
|
||||
self.log.debug('\t\t\tCommitted sub-tree #%s (%s KB)',
|
||||
self.log.debug('\t\t\tCommitted sub-tree #%d (%d KB)',
|
||||
len(self.split_trees), size/1024.)
|
||||
else:
|
||||
self.log.debug('\t\t\tSplit tree still too large: %d KB',
|
||||
|
||||
@@ -67,7 +67,7 @@ class DetectStructure(object):
|
||||
self.oeb.toc = orig_toc
|
||||
else:
|
||||
self.oeb.auto_generated_toc = True
|
||||
self.log.info('Auto generated TOC with %s entries.',
|
||||
self.log.info('Auto generated TOC with %d entries.',
|
||||
self.oeb.toc.count())
|
||||
|
||||
if opts.toc_filter is not None:
|
||||
@@ -240,7 +240,7 @@ class DetectStructure(object):
|
||||
play_order=self.oeb.toc.next_play_order())
|
||||
num += 1
|
||||
except ValueError:
|
||||
self.oeb.log.critical('Failed to process link: %s',
|
||||
self.oeb.log.critical('Failed to process link: %r',
|
||||
href)
|
||||
# Most likely an incorrectly URL encoded link
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user