4 # |
4 # |
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 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
|
11 try: |
|
12 str = unicode |
|
13 except (NameError): |
|
14 pass |
9 |
15 |
10 import os |
16 import os |
11 |
17 |
12 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot |
18 from PyQt4.QtCore import QTimer, QProcess, Qt, pyqtSlot |
13 from PyQt4.QtGui import QWidget, QCursor, QHeaderView, QApplication, \ |
19 from PyQt4.QtGui import QWidget, QCursor, QHeaderView, QApplication, \ |
359 E5MessageBox.Cancel) |
365 E5MessageBox.Cancel) |
360 if res == E5MessageBox.Cancel: |
366 if res == E5MessageBox.Cancel: |
361 return |
367 return |
362 |
368 |
363 try: |
369 try: |
364 f = open(self.reportFile, 'w') |
370 import codecs |
365 f.write(self.buf) |
371 f = open(self.reportFile, 'wb') |
|
372 f.write(codecs.BOM_UTF8) |
|
373 f.write(self.buf.encode('utf-8')) |
366 f.close() |
374 f.close() |
367 except IOError as why: |
375 except IOError as why: |
368 E5MessageBox.critical(self, self.trUtf8('PyLint Report'), |
376 E5MessageBox.critical(self, self.trUtf8('PyLint Report'), |
369 self.trUtf8('<p>The PyLint report file <b>{0}</b> could not be written.' |
377 self.trUtf8('<p>The PyLint report file <b>{0}</b> could not be written.' |
370 '<br>Reason: {1}</p>') |
378 '<br>Reason: {1}</p>') |