Skip to content

Commit

Permalink
Fixed console display hook (works only for single input)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12125 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 15, 2009
1 parent 4e182fc commit 5de2b25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/utils.py
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion src/python/qgspythonutilsimpl.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 5de2b25

Please sign in to comment.