6 """ |
6 """ |
7 Module implementing a dialog showing the output of a pip command. |
7 Module implementing a dialog showing the output of a pip command. |
8 """ |
8 """ |
9 |
9 |
10 |
10 |
11 from PyQt5.QtCore import pyqtSlot, Qt, QCoreApplication, QTimer, \ |
11 from PyQt5.QtCore import ( |
12 QProcess |
12 pyqtSlot, Qt, QCoreApplication, QTimer, QProcess |
|
13 ) |
13 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton |
14 from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton |
14 |
15 |
15 from E5Gui import E5MessageBox |
16 from E5Gui import E5MessageBox |
16 |
17 |
17 from .Ui_PipDialog import Ui_PipDialog |
18 from .Ui_PipDialog import Ui_PipDialog |
52 @param e close event |
53 @param e close event |
53 @type QCloseEvent |
54 @type QCloseEvent |
54 """ |
55 """ |
55 self.__processQueue = [] |
56 self.__processQueue = [] |
56 |
57 |
57 if self.proc is not None and \ |
58 if ( |
58 self.proc.state() != QProcess.NotRunning: |
59 self.proc is not None and |
|
60 self.proc.state() != QProcess.NotRunning |
|
61 ): |
59 self.proc.terminate() |
62 self.proc.terminate() |
60 QTimer.singleShot(2000, self.proc.kill) |
63 QTimer.singleShot(2000, self.proc.kill) |
61 self.proc.waitForFinished(3000) |
64 self.proc.waitForFinished(3000) |
62 |
65 |
63 self.proc = None |
66 self.proc = None |
67 def __finish(self): |
70 def __finish(self): |
68 """ |
71 """ |
69 Private slot called when the process finished or the user pressed |
72 Private slot called when the process finished or the user pressed |
70 the button. |
73 the button. |
71 """ |
74 """ |
72 if self.proc is not None and \ |
75 if ( |
73 self.proc.state() != QProcess.NotRunning: |
76 self.proc is not None and |
|
77 self.proc.state() != QProcess.NotRunning |
|
78 ): |
74 self.proc.terminate() |
79 self.proc.terminate() |
75 QTimer.singleShot(2000, self.proc.kill) |
80 QTimer.singleShot(2000, self.proc.kill) |
76 self.proc.waitForFinished(3000) |
81 self.proc.waitForFinished(3000) |
77 |
82 |
78 self.proc = None |
83 self.proc = None |