add escape sequence when executing as Python string
This commit is contained in:
@@ -457,10 +457,8 @@ void CmdMeshImport::activated(int)
|
||||
QStringList fn = Gui::FileDialog::getOpenFileNames(Gui::getMainWindow(),
|
||||
QObject::tr("Import mesh"), QString(), filter.join(QLatin1String(";;")));
|
||||
for (QStringList::Iterator it = fn.begin(); it != fn.end(); ++it) {
|
||||
QFileInfo fi;
|
||||
fi.setFile(*it);
|
||||
|
||||
std::string unicodepath = Base::Tools::escapedUnicodeFromUtf8((*it).toUtf8().data());
|
||||
unicodepath = Base::Tools::escapeEncodeFilename(unicodepath);
|
||||
openCommand("Import Mesh");
|
||||
doCommand(Doc,"import Mesh");
|
||||
doCommand(Doc,"Mesh.insert(u\"%s\")",
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObjectGroup.h>
|
||||
#include <App/DocumentObserver.h>
|
||||
@@ -1012,6 +1013,8 @@ void CmdPartImport::activated(int iMsg)
|
||||
Gui::WaitCursor wc;
|
||||
App::Document* pDoc = getDocument();
|
||||
if (!pDoc) return; // no document
|
||||
|
||||
fn = Base::Tools::escapeEncodeFilename(fn);
|
||||
openCommand("Import Part");
|
||||
if (select == filter[1] ||
|
||||
select == filter[3]) {
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/Matrix.h>
|
||||
#include <Base/Tools.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
@@ -81,9 +82,7 @@ void CmdPointsImport::activated(int iMsg)
|
||||
return;
|
||||
|
||||
if (!fn.isEmpty()) {
|
||||
QFileInfo fi;
|
||||
fi.setFile(fn);
|
||||
|
||||
fn = Base::Tools::escapeEncodeFilename(fn);
|
||||
Gui::Document* doc = getActiveGuiDocument();
|
||||
openCommand("Import points");
|
||||
addModule(Command::App, "Points");
|
||||
@@ -131,6 +130,7 @@ void CmdPointsExport::activated(int iMsg)
|
||||
break;
|
||||
|
||||
if (!fn.isEmpty()) {
|
||||
fn = Base::Tools::escapeEncodeFilename(fn);
|
||||
doCommand(Command::Doc, "Points.export([App.ActiveDocument.%s], \"%s\")",
|
||||
(*it)->getNameInDocument(), fn.toUtf8().data());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user