7 Module implementing a dialog to show the results of the PyLint run. |
7 Module implementing a dialog to show the results of the PyLint run. |
8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt5.QtCore import QTimer, QProcess, Qt, pyqtSlot |
12 from PyQt5.QtCore import pyqtSlot, Qt, QTimer, QProcess |
13 from PyQt5.QtGui import QCursor, QTextCursor |
13 from PyQt5.QtGui import QTextCursor |
14 from PyQt5.QtWidgets import ( |
14 from PyQt5.QtWidgets import ( |
15 QWidget, QHeaderView, QApplication, QDialogButtonBox, QTreeWidgetItem |
15 QWidget, QHeaderView, QApplication, QDialogButtonBox, QTreeWidgetItem |
16 ) |
16 ) |
17 |
17 |
18 from E5Gui import E5MessageBox, E5FileDialog |
18 from E5Gui import E5MessageBox, E5FileDialog |
19 from E5Gui.E5Application import e5App |
19 from E5Gui.E5Application import e5App |
|
20 try: |
|
21 from E5Gui.E5OverrideCursor import E5OverrideCursorProcess |
|
22 except ImportError: |
|
23 # workaround for eric6 < 20.11 |
|
24 E5OverrideCursorProcess = QProcess |
20 |
25 |
21 from .Ui_PyLintExecDialog import Ui_PyLintExecDialog |
26 from .Ui_PyLintExecDialog import Ui_PyLintExecDialog |
22 |
27 |
23 import Preferences |
28 import Preferences |
24 import Utilities |
29 import Utilities |
106 |
111 |
107 program = args[0] |
112 program = args[0] |
108 del args[0] |
113 del args[0] |
109 args.append(self.filename) |
114 args.append(self.filename) |
110 |
115 |
111 self.process = QProcess() |
116 self.process = E5OverrideCursorProcess() |
112 self.process.setWorkingDirectory(self.pathname) |
117 self.process.setWorkingDirectory(self.pathname) |
113 |
118 |
114 self.process.readyReadStandardError.connect(self.__readStderr) |
119 self.process.readyReadStandardError.connect(self.__readStderr) |
115 self.process.finished.connect(self.__finish) |
120 self.process.finished.connect(self.__finish) |
116 |
121 |
147 self.tr('Process Generation Error'), |
152 self.tr('Process Generation Error'), |
148 self.tr( |
153 self.tr( |
149 'The process {0} could not be started. ' |
154 'The process {0} could not be started. ' |
150 'Ensure, that it is in the search path.' |
155 'Ensure, that it is in the search path.' |
151 ).format(program)) |
156 ).format(program)) |
152 else: |
|
153 self.setCursor(QCursor(Qt.WaitCursor)) |
|
154 return procStarted |
157 return procStarted |
155 |
158 |
156 def on_buttonBox_clicked(self, button): |
159 def on_buttonBox_clicked(self, button): |
157 """ |
160 """ |
158 Private slot called by a button of the button box clicked. |
161 Private slot called by a button of the button box clicked. |
173 Private slot called when the process finished. |
176 Private slot called when the process finished. |
174 |
177 |
175 It is called when the process finished or |
178 It is called when the process finished or |
176 the user pressed the button. |
179 the user pressed the button. |
177 """ |
180 """ |
178 self.unsetCursor() |
|
179 |
|
180 if self.htmlOutput: |
181 if self.htmlOutput: |
181 self.contents.setHtml(self.buf) |
182 self.contents.setHtml(self.buf) |
182 else: |
183 else: |
183 cursor = self.contents.textCursor() |
184 cursor = self.contents.textCursor() |
184 cursor.movePosition(QTextCursor.Start) |
185 cursor.movePosition(QTextCursor.Start) |