PyLint/PyLintExecDialog.py

changeset 85
6124794c3ffe
parent 82
5493d105d329
child 89
8acd446fb6e6
equal deleted inserted replaced
84:022f0bc87198 85:6124794c3ffe
5 5
6 """ 6 """
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 from __future__ import unicode_literals
11 try:
12 str = unicode
13 except NameError:
14 pass
15
16 import os 10 import os
17 11
18 from PyQt5.QtCore import QTimer, QProcess, Qt, pyqtSlot 12 from PyQt5.QtCore import QTimer, QProcess, Qt, pyqtSlot
19 from PyQt5.QtGui import QCursor, QTextCursor 13 from PyQt5.QtGui import QCursor, QTextCursor
20 from PyQt5.QtWidgets import QWidget, QHeaderView, QApplication, \ 14 from PyQt5.QtWidgets import (
21 QDialogButtonBox, QTreeWidgetItem 15 QWidget, QHeaderView, QApplication, QDialogButtonBox, QTreeWidgetItem
16 )
22 17
23 from E5Gui import E5MessageBox, E5FileDialog 18 from E5Gui import E5MessageBox, E5FileDialog
24 from E5Gui.E5Application import e5App 19 from E5Gui.E5Application import e5App
25 20
26 from .Ui_PyLintExecDialog import Ui_PyLintExecDialog 21 from .Ui_PyLintExecDialog import Ui_PyLintExecDialog
187 else: 182 else:
188 cursor = self.contents.textCursor() 183 cursor = self.contents.textCursor()
189 cursor.movePosition(QTextCursor.Start) 184 cursor.movePosition(QTextCursor.Start)
190 self.contents.setTextCursor(cursor) 185 self.contents.setTextCursor(cursor)
191 186
192 if self.process is not None and \ 187 if (
193 self.process.state() != QProcess.NotRunning: 188 self.process is not None and
189 self.process.state() != QProcess.NotRunning
190 ):
194 self.process.terminate() 191 self.process.terminate()
195 QTimer.singleShot(2000, self.process.kill) 192 QTimer.singleShot(2000, self.process.kill)
196 self.process.waitForFinished(3000) 193 self.process.waitForFinished(3000)
197 194
198 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True) 195 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(True)

eric ide

mercurial