14 pass |
14 pass |
15 |
15 |
16 import os |
16 import os |
17 |
17 |
18 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo |
18 from PyQt5.QtCore import pyqtSlot, QProcess, QTimer, QFileInfo |
19 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton, \ |
19 from PyQt5.QtWidgets import ( |
20 QTextEdit, QLineEdit |
20 QDialog, QDialogButtonBox, QAbstractButton, QTextEdit, QLineEdit |
|
21 ) |
21 |
22 |
22 from E5Gui import E5MessageBox, E5FileDialog |
23 from E5Gui import E5MessageBox, E5FileDialog |
23 |
24 |
24 from .Ui_DjangoDialog import Ui_DjangoDialog |
25 from .Ui_DjangoDialog import Ui_DjangoDialog |
25 |
26 |
103 def __finish(self): |
104 def __finish(self): |
104 """ |
105 """ |
105 Private slot called when the process finished or the user pressed the |
106 Private slot called when the process finished or the user pressed the |
106 button. |
107 button. |
107 """ |
108 """ |
108 if self.proc is not None and \ |
109 if ( |
109 self.proc.state() != QProcess.NotRunning: |
110 self.proc is not None and |
|
111 self.proc.state() != QProcess.NotRunning |
|
112 ): |
110 self.proc.terminate() |
113 self.proc.terminate() |
111 QTimer.singleShot(2000, self.proc.kill) |
114 QTimer.singleShot(2000, self.proc.kill) |
112 self.proc.waitForFinished(3000) |
115 self.proc.waitForFinished(3000) |
113 |
116 |
114 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |
117 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) |