Enable lyx2lyx to work with "file names with spaces".

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9954 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-05-19 08:43:52 +00:00
parent 5179c52e66
commit 65f9fc786e
4 changed files with 25 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2005-05-18 Angus Leeming <leeming@lyx.org>
* lyx2lyx (parse_options): Add the description of the '-f' option
back again.
2005-05-18 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* lyx_1_4.py (convert_breaks): Don't treat every token that starts
@ -5,7 +10,8 @@
2005-05-06 José Matos <jamatos@lyx.org>
* lyx_1_4.py (convert_breaks): put all paragraph parameters into a single line.
* lyx_1_4.py (convert_breaks): put all paragraph parameters into a
single line.
2005-05-04 José Matos <jamatos@lyx.org>
@ -257,7 +263,7 @@
* lyx_1_4.py (convert_frameless_box): Replace instead of adding
new code.
.
2004-04-14 José Matos <jamatos@lyx.org>
* error.py
@ -416,4 +422,3 @@
* lyxconvert_223.py:
* lyxconvert_224.py (convert_minipage): move funtion to its right place.
(convert_breaks): convert line and page break, at bottom and top.

View File

@ -32,6 +32,7 @@ Options:
-d, --debug level level=0..2 (O_ no debug information, 2_verbose)
default: level=1
-e, --err error_file name of the error file or else goes to stderr
-f, --from version initial version (optional)
-t, --to version final version (optional)
-o, --output name name of the output file or else goes to stdout
-q, --quiet same as --debug=0"""

View File

@ -1,3 +1,7 @@
2005-05-18 Angus Leeming <leeming@lyx.org>
* buffer.C (readFile): Quote all file names passed to lyx2lyx.
2005-05-12 Martin Vermeer <martin.vermeer@hut.fi>
* tabular.[hC]: added setCellInset to fix tabular paste.

View File

@ -638,9 +638,8 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
filename));
return false;
}
string command =
"python " + LibFileSearch("lyx2lyx", "lyx2lyx");
if (command.empty()) {
string const lyx2lyx = LibFileSearch("lyx2lyx", "lyx2lyx");
if (lyx2lyx.empty()) {
Alert::error(_("Conversion script not found"),
bformat(_("%1$s is from an earlier"
" version of LyX, but the"
@ -649,14 +648,18 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
filename));
return false;
}
command += " -t"
+ convert<string>(LYX_FORMAT)
+ " -o " + tmpfile + ' '
+ QuoteName(filename);
ostringstream command;
command << "python " << QuoteName(lyx2lyx)
<< " -t " << convert<string>(LYX_FORMAT)
<< " -o " << QuoteName(tmpfile) << ' '
<< QuoteName(filename);
string const command_str = command.str();
lyxerr[Debug::INFO] << "Running '"
<< command << '\''
<< command_str << '\''
<< endl;
cmd_ret const ret = RunCommand(command);
cmd_ret const ret = RunCommand(command_str);
if (ret.first != 0) {
Alert::error(_("Conversion script failed"),
bformat(_("%1$s is from an earlier version"