apply changeset r8811 to trunk

git-svn-id: http://svn.osgeo.org/qgis/trunk@8817 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2008-07-19 18:03:45 +00:00
parent 92d74a6dd1
commit 9c3b2ca03d

View File

@ -51,13 +51,14 @@ void QgsPythonUtilsImpl::initPython(QgisInterface* interface)
mMainDict = PyModule_GetDict(mMainModule); // borrowed reference
runString("import sys"); // import sys module (for display / exception hooks)
runString("import traceback"); // for formatting stack traces
runString("import __main__"); // to access explicitly global variables
// expect that bindings are installed locally, so add the path to modules
// also add path to plugins
runString("sys.path = [\"" + pythonPath() + "\", \"" + homePluginsPath() + "\", \"" + pluginsPath() + "\"] + sys.path");
runString("import traceback"); // for formatting stack traces
runString("import __main__"); // to access explicitly global variables
// import SIP
if (!runString("from sip import wrapinstance, unwrapinstance",
QObject::tr("Couldn't load SIP module.") + "\n" + QObject::tr("Python support will be disabled.")))