Allow to run script in global environment

This commit is contained in:
wmayer
2012-06-29 13:57:22 +02:00
parent 53413e8af6
commit ff6c16e5d3
4 changed files with 110 additions and 88 deletions

View File

@@ -71,6 +71,7 @@ void MacroManager::OnChange(Base::Subject<const char*> &rCaller, const char * sR
this->recordGui = this->params->GetBool("RecordGui", true);
this->guiAsComment = this->params->GetBool("GuiAsComment", true);
this->scriptToPyConsole = this->params->GetBool("ScriptToPyConsole", true);
this->localEnv = this->params->GetBool("LocalEnvironment", true);
}
void MacroManager::open(MacroType eType,const char *sName)
@@ -228,7 +229,7 @@ void MacroManager::run(MacroType eType,const char *sName)
PythonRedirector std_out("stdout",pyout);
PythonRedirector std_err("stderr",pyerr);
//The given path name is expected to be Utf-8
Base::Interpreter().runFile(sName, true);
Base::Interpreter().runFile(sName, this->localEnv);
}
catch (const Base::SystemExitException&) {
Base::PyGILStateLocker lock;