Skip to content

Commit

Permalink
Make sure iface is available when executing dropped python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 20, 2017
1 parent fc10b77 commit 695cf6b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -5554,6 +5554,7 @@ void QgisApp::runScript( const QString &filePath )

mPythonUtils->runString(
QString( "import sys\n"
"from qgis.utils import iface\n"
"exec(open(\"%1\".replace(\"\\\\\", \"/\").encode(sys.getfilesystemencoding())).read())\n" ).arg( filePath )
, tr( "Failed to run Python script:" ), false );
#endif
Expand Down

0 comments on commit 695cf6b

Please sign in to comment.