mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
no need to delete the contents of the specified directory
This commit is contained in:
parent
e3a9863f9f
commit
78b66ad54d
1 changed files with 3 additions and 4 deletions
|
|
@ -39,7 +39,7 @@ class HTMLOutput(OutputFormatPlugin):
|
|||
help=_('Template used for the generation of the html contents of the book instead of the default file')),
|
||||
|
||||
OptionRecommendation(name='extract_to',
|
||||
help=_('Extract the contents of the generated ZIP file to the directory of the generated ZIP file')
|
||||
help=_('Extract the contents of the generated ZIP file to the specified directory')
|
||||
),
|
||||
])
|
||||
|
||||
|
|
@ -193,9 +193,8 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
zfile.write(output_file, basename(output_file), zipfile.ZIP_DEFLATED)
|
||||
|
||||
if opts.extract_to:
|
||||
if os.path.exists(opts.extract_to):
|
||||
shutil.rmtree(opts.extract_to)
|
||||
os.makedirs(opts.extract_to)
|
||||
if not os.path.exists(opts.extract_to):
|
||||
os.makedirs(opts.extract_to)
|
||||
zfile.extractall(opts.extract_to)
|
||||
self.log('Zip file extracted to', opts.extract_to)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue