Skip to content

Commit f19d711

Browse files
committed
Missed a file
1 parent e491600 commit f19d711

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Core/Application/Application.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include <Core/Services/ServiceDB.h>
4747
#include <Core/Services/ServiceManager.h>
4848
#include <Core/Python/PythonInterpreter.h>
49+
#include <Core/Application/Preferences/Preferences.h>
4950

5051
using namespace SCIRun::Core;
5152
using namespace SCIRun::Core::Logging;
@@ -160,13 +161,18 @@ namespace
160161
{
161162
#ifdef BUILD_WITH_PYTHON
162163

164+
//TODO: obviously will need a better way to communicate the user-entered script string.
163165
class HardCodedPythonTestCommand : public ParameterizedCommand
164166
{
165167
public:
166168
virtual bool execute() override
167169
{
168-
PythonInterpreter::Instance().run_string("import SCIRunPythonAPI; from SCIRunPythonAPI import *");
169-
PythonInterpreter::Instance().run_string("scirun_set_module_state(scirun_module_ids()[-1], \"FileTypeName\", \"Matlab Matrix (*.mat)\") if scirun_module_ids()[-1].startswith('ReadMatrix') else 'not ReadMatrix'");
170+
auto script = Preferences::Instance().postModuleAddScript_temporarySolution.val();
171+
if (!script.empty())
172+
{
173+
PythonInterpreter::Instance().run_string("import SCIRunPythonAPI; from SCIRunPythonAPI import *");
174+
PythonInterpreter::Instance().run_string(script);
175+
}
170176
return true;
171177
}
172178
};

0 commit comments

Comments
 (0)