-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mismatch of output basename for file and dir
1. one doc, -o /tmp/foo => /tmp/foo.doc 2. two docs, -o /tmp/ => /tmp/foo/doc1.doc, /tmp/foo/doc2.doc
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -959,11 +959,11 @@ class Convertor: | |
if not op.stdout: | ||
(outputfn, ext) = os.path.splitext(inputfn) | ||
if not op.output: | ||
outputfn = outputfn + os.extsep + outputfmt.extension | ||
outputfn = realpath(outputfn + os.extsep + outputfmt.extension) | ||
elif len(op.filenames) > 1: | ||
outputfn = op.output + os.extsep + outputfmt.extension | ||
else: | ||
outputfn = realpath(op.output, os.path.basename(outputfn) + os.extsep + outputfmt.extension) | ||
else: | ||
outputfn = realpath(outputfn + os.extsep + outputfmt.extension) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dagwieers
via email
Member
|
||
|
||
outputurl = unohelper.absolutize( self.cwd, unohelper.systemPathToFileUrl(outputfn) ) | ||
info(1, "Output file: %s" % outputfn) | ||
|
the outputfn will be always the basename of input file plus extension, you should change to outputfn = realpath(op.output + os.extsep + outputfmt.extension)