ProjectFlask/FlaskCommandDialog.py

changeset 32
80fc8deac8fe
parent 16
dd3f6bfb85f7
child 60
02243723ac17
diff -r e614add95516 -r 80fc8deac8fe ProjectFlask/FlaskCommandDialog.py
--- a/ProjectFlask/FlaskCommandDialog.py	Tue Nov 24 20:17:20 2020 +0100
+++ b/ProjectFlask/FlaskCommandDialog.py	Wed Nov 25 19:39:04 2020 +0100
@@ -62,6 +62,7 @@
         @return flag indicating a successful start
         @rtype bool
         """
+        self.__normal = False
         workdir, env = self.__project.prepareRuntimeEnvironment()
         if env is not None:
             flaskCommand = self.__project.getFlaskCommand()
@@ -126,7 +127,7 @@
         @param exitStatus exit status of the process
         @type QProcess.ExitStatus
         """
-        normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0)
+        self.__normal = (exitStatus == QProcess.NormalExit) and (exitCode == 0)
         self.__cancelProcess()
         
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
@@ -135,9 +136,9 @@
         self.buttonBox.button(QDialogButtonBox.Close).setFocus(
             Qt.OtherFocusReason)
         
-        if normal and self.__successMessage:
+        if self.__normal and self.__successMessage:
             self.outputEdit.insertPlainText(self.__successMessage)
-        elif not normal and self.__errorMessage:
+        elif not self.__normal and self.__errorMessage:
             self.outputEdit.insertPlainText(self.__errorMessage)
     
     @pyqtSlot()
@@ -167,3 +168,12 @@
             self.close()
         elif button is self.buttonBox.button(QDialogButtonBox.Cancel):
             self.__cancelProcess()
+    
+    def normalExit(self):
+        """
+        Public method to test, if the process ended without errors.
+        
+        @return flag indicating a normal process exit
+        @rtype bool
+        """
+        return self.__normal

eric ide

mercurial