Pārlūkot izejas kodu

Extend PythonManager API with method returning if python error occurred

Jean-Christophe Fillion-Robin 13 gadi atpakaļ
vecāks
revīzija
3c61e086a9

+ 1 - 1
CMakeExternals/PythonQt.cmake

@@ -46,7 +46,7 @@ if(${add_project})
         message(FATAL_ERROR "error: Python is required to build ${PROJECT_NAME}")
       endif()
 
-      set(revision_tag 7e1e07f34b2420e420e2858e5ea9a49fe1e0d235)
+      set(revision_tag 5935f29978deed892a13ddef02cb14c205c6124d)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()

+ 6 - 0
Libs/Scripting/Python/Core/ctkAbstractPythonManager.cpp

@@ -122,6 +122,12 @@ bool ctkAbstractPythonManager::isPythonInitialized()const
 }
 
 //-----------------------------------------------------------------------------
+bool ctkAbstractPythonManager::pythonErrorOccured()const
+{
+  return PythonQt::self()->errorOccured();
+}
+
+//-----------------------------------------------------------------------------
 QStringList ctkAbstractPythonManager::pythonPaths()
 {
   return QStringList();

+ 4 - 0
Libs/Scripting/Python/Core/ctkAbstractPythonManager.h

@@ -85,6 +85,10 @@ public:
   /// \sa pythonInitialized
   bool isPythonInitialized()const;
 
+  /// Returns True if a python error occured.
+  /// \sa PythonQt::errorOccured()
+  bool pythonErrorOccured()const;
+
 Q_SIGNALS:
 
   /// This signal is emitted after python is pre-initialized. Observers can listen