Skip to content
Snippets Groups Projects
Commit cf524b12 authored by valerio's avatar valerio
Browse files

Fixes to fileloader

It now passes the script name as first argument of sys.argv


git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2582 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 6d887741
Branches
Tags
No related merge requests found
......@@ -356,6 +356,7 @@ void FileLoader::RunScript(const QString& filename)
//TODO create class or function which can load any kind of files and execute scripts
pi.RunCommand("_sys_argv_backup=sys.argv");
pi.RunCommand("sys.argv=list()");
pi.RunCommand("sys.argv.append('"+QFileInfo(filename).fileName()+"')");
pi.RunCommand("_dir=os.getcwd()");
pi.RunCommand("os.chdir('"+QFileInfo(filename).absolutePath()+"')");
pi.RunCommand("execfile('"+QFileInfo(filename).fileName()+"')");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment