mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
...
This commit is contained in:
parent
b857a08d2a
commit
b32c1158b0
@ -7,7 +7,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, subprocess, shutil
|
import os, subprocess, shutil, tempfile
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
|
||||||
@ -70,10 +70,12 @@ def kindlegen(oeb, opts, input_plugin, output_path):
|
|||||||
opf = [x for x in os.listdir(tdir) if x.endswith('.opf')][0]
|
opf = [x for x in os.listdir(tdir) if x.endswith('.opf')][0]
|
||||||
refactor_opf(os.path.join(tdir, opf), is_periodical, oeb.toc)
|
refactor_opf(os.path.join(tdir, opf), is_periodical, oeb.toc)
|
||||||
try:
|
try:
|
||||||
if os.path.exists('/tmp/kindlegen'):
|
td = tempfile.gettempdir()
|
||||||
shutil.rmtree('/tmp/kindlegen')
|
kd = os.path.join(td, 'kindlegen')
|
||||||
shutil.copytree(tdir, '/tmp/kindlegen')
|
if os.path.exists(kd):
|
||||||
oeb.log('kindlegen intermediate output stored in: /tmp/kindlegen')
|
shutil.rmtree(kd)
|
||||||
|
shutil.copytree(tdir, kd)
|
||||||
|
oeb.log('kindlegen intermediate output stored in: %s'%kd)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user