+
+int const FORMAT = 2;
+
+
+bool layout2layout(string const & filename, string const & tempfile)
+{
+ string const script = LibFileSearch("scripts", "layout2layout.py");
+ if (script.empty()) {
+ lyxerr << "Could not find layout conversion "
+ "script layout2layout.py." << endl;
+ return false;
+ }
+
+ std::ostringstream command;
+ command << "python " << QuoteName(script)
+ << ' ' << QuoteName(filename)
+ << ' ' << QuoteName(tempfile);
+ string const command_str = command.str();
+
+ lyxerr[Debug::TCLASS] << "Running `" << command_str << '\'' << endl;
+
+ lyx::support::cmd_ret const ret =
+ lyx::support::RunCommand(command_str);
+ if (ret.first != 0) {
+ lyxerr << "Could not run layout conversion "
+ "script layout2layout.py." << endl;
+ return false;
+ }
+ return true;
+}
+
+} // namespace anon