mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-11 21:44:09 +01:00
commit
331dcc787d
2 changed files with 5 additions and 4 deletions
|
|
@ -70,9 +70,10 @@ def run(self, pmlfile):
|
|||
pmlz = zipfile.ZipFile(of.name, 'w')
|
||||
pmlz.write(pmlfile, os.path.basename(pmlfile))
|
||||
|
||||
pml_img = os.path.basename(pmlfile)[0] + '_img'
|
||||
img_dir = pml_img if os.path.exists(pml_img) else 'images' if \
|
||||
os.path.exists('images') else ''
|
||||
pml_img = os.path.splitext(pmlfile)[0] + '_img'
|
||||
i_img = os.path.join(os.path.dirname(pmlfile),'images')
|
||||
img_dir = pml_img if os.path.isdir(pml_img) else i_img if \
|
||||
os.path.isdir(i_img) else ''
|
||||
if img_dir:
|
||||
for image in glob.glob(os.path.join(img_dir, '*.png')):
|
||||
pmlz.write(image, os.path.join('images', (os.path.basename(image))))
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ def get_toc(self):
|
|||
if item.href in self.link_hrefs.keys():
|
||||
toc.append('* \\q="#%s"%s\\q\n' % (self.link_hrefs[item.href], item.title))
|
||||
else:
|
||||
self.oeb.warn('Ignoring toc item: %s not found in document.' % item)
|
||||
self.oeb_book.warn('Ignoring toc item: %s not found in document.' % item)
|
||||
return ''.join(toc)
|
||||
|
||||
def get_text(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue