mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
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:
parent
4e182fc45e
commit
5de2b259e2
@ -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:
|
||||
|
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user