Skip to content
Permalink
Browse files
Fixed console display hook (works only for single input)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12125 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 15, 2009
1 parent 92957c3 commit fb889e00ee8851ccfd48b8e8e08007a74f9c7f2d
Showing with 6 additions and 1 deletion.
  1. +1 −0 python/utils.py
  2. +5 −1 src/python/qgspythonutilsimpl.cpp
@@ -60,6 +60,7 @@ def initInterface(pointer):
# 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:
@@ -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 )

0 comments on commit fb889e0

Please sign in to comment.