Fixed console display hook (works only for single input)

git-svn-id: http://svn.osgeo.org/qgis/trunk@12125 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2009-11-15 17:45:45 +00:00
parent 4e182fc45e
commit 5de2b259e2
2 changed files with 6 additions and 1 deletions

View File

@ -60,6 +60,7 @@ console_output = None
# hook for python console so all output will be redirected
# and then shown in console
def console_displayhook(obj):
global console_output
console_output = obj
class QgisOutputCatcher:

View File

@ -301,7 +301,11 @@ bool QgsPythonUtilsImpl::getError( QString& errorClassName, QString& errorText )
QString QgsPythonUtilsImpl::getResult()
{
return getVariableFromMain( "qgis.utils.console_output" );
QString res;
evalString( "qgis.utils.console_output", res );
// clear output
runString("qgis.utils.console_output = None");
return res;
}
QString QgsPythonUtilsImpl::PyObjectToQString( PyObject* obj )