mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 19:33:41 +02:00
...
This commit is contained in:
parent
a0e85d7c4a
commit
d3de5875c6
1 changed files with 4 additions and 1 deletions
|
|
@ -229,7 +229,10 @@ def convert(self, oeb, output_path, input_plugin, opts, log):
|
|||
if opts.extract_to is not None:
|
||||
from calibre.utils.zipfile import ZipFile
|
||||
if os.path.exists(opts.extract_to):
|
||||
shutil.rmtree(opts.extract_to)
|
||||
if os.path.isdir(opts.extract_to):
|
||||
shutil.rmtree(opts.extract_to)
|
||||
else:
|
||||
os.remove(opts.extract_to)
|
||||
os.mkdir(opts.extract_to)
|
||||
with ZipFile(output_path) as zf:
|
||||
zf.extractall(path=opts.extract_to)
|
||||
|
|
|
|||
Loading…
Reference in a new issue