--- a/PyLint/PyLintExecDialog.py Sun Oct 13 18:33:34 2013 +0200 +++ b/PyLint/PyLintExecDialog.py Thu Oct 24 18:56:00 2013 +0200 @@ -54,7 +54,8 @@ self.refreshButton = self.buttonBox.addButton( self.trUtf8("Refresh"), QDialogButtonBox.ActionRole) - self.refreshButton.setToolTip(self.trUtf8("Press to refresh the result display")) + self.refreshButton.setToolTip(self.trUtf8( + "Press to refresh the result display")) self.refreshButton.setEnabled(False) self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) @@ -121,7 +122,8 @@ if "--output-format=parseable" in args: self.reportFile = None self.contents.hide() - self.process.readyReadStandardOutput.connect(self.__readParseStdout) + self.process.readyReadStandardOutput.connect( + self.__readParseStdout) self.parsedOutput = True else: self.process.readyReadStandardOutput.connect(self.__readStdout) @@ -144,7 +146,8 @@ self.process.start(program, args) procStarted = self.process.waitForStarted() if not procStarted: - E5MessageBox.critical(None, + E5MessageBox.critical( + self, self.trUtf8('Process Generation Error'), self.trUtf8( 'The process {0} could not be started. ' @@ -197,13 +200,16 @@ self.refreshButton.setEnabled(True) if self.parsedOutput: QApplication.processEvents() - self.messageList.sortItems(self.messageList.sortColumn(), - self.messageList.header().sortIndicatorOrder()) - self.messageList.header().resizeSections(QHeaderView.ResizeToContents) + self.messageList.sortItems( + self.messageList.sortColumn(), + self.messageList.header().sortIndicatorOrder()) + self.messageList.header().resizeSections( + QHeaderView.ResizeToContents) self.messageList.header().setStretchLastSection(True) else: if self.__scrollPosition != -1: - self.contents.verticalScrollBar().setValue(self.__scrollPosition) + self.contents.verticalScrollBar().setValue( + self.__scrollPosition) self.process = None @@ -213,7 +219,8 @@ self.saveButton.setEnabled(True) if self.noResults: - self.__createItem(self.trUtf8('No PyLint errors found.'), "", "", "") + self.__createItem( + self.trUtf8('No PyLint errors found.'), "", "", "") @pyqtSlot() def on_refreshButton_clicked(self): @@ -270,7 +277,8 @@ def __readParseStdout(self): """ - Private slot to handle the readyReadStandardOutput signal for parseable output. + Private slot to handle the readyReadStandardOutput signal for + parseable output. It reads the output of the process, formats it and inserts it into the message list pane. @@ -292,13 +300,13 @@ message = message.strip() if type_ and type_[0] in self.typeDict: if len(type_) == 1: - self.__createItem(fname, lineno, - self.typeDict[type_], message) + self.__createItem( + fname, lineno, self.typeDict[type_], message) else: - self.__createItem(fname, lineno, - "{0} {1}".format( - self.typeDict[type_[0]], type_[1:]), - message) + self.__createItem( + fname, lineno, "{0} {1}".format( + self.typeDict[type_[0]], type_[1:]), + message) self.noResults = False except ValueError: continue @@ -335,7 +343,8 @@ vm = e5App().getObject("ViewManager") vm.openSourceFile(fn, lineno) editor = vm.getOpenEditor(fn) - editor.toggleFlakesWarning(lineno, True, + editor.toggleFlakesWarning( + lineno, True, "{0} | {1}".format(itm.text(1), itm.text(2))) else: fn = os.path.join(self.pathname, itm.data(0, self.filenameRole)) @@ -345,7 +354,8 @@ for index in range(itm.childCount()): citm = itm.child(index) lineno = int(citm.text(0)) - editor.toggleFlakesWarning(lineno, True, + editor.toggleFlakesWarning( + lineno, True, "{0} | {1}".format(citm.text(1), citm.text(2))) def __writeReport(self): @@ -354,13 +364,15 @@ """ self.reportFile = self.reportFile if os.path.exists(self.reportFile): - res = E5MessageBox.warning(self, + res = E5MessageBox.warning( + self, self.trUtf8("PyLint Report"), self.trUtf8( - """<p>The PyLint report file <b>{0}</b> already exists.</p>""")\ - .format(self.reportFile), + """<p>The PyLint report file <b>{0}</b> already""" + """ exists.</p>""") + .format(self.reportFile), E5MessageBox.StandardButtons( - E5MessageBox.Cancel | \ + E5MessageBox.Cancel | E5MessageBox.Ignore), E5MessageBox.Cancel) if res == E5MessageBox.Cancel: @@ -373,10 +385,11 @@ f.write(self.buf.encode('utf-8')) f.close() except IOError as why: - E5MessageBox.critical(self, self.trUtf8('PyLint Report'), - self.trUtf8('<p>The PyLint report file <b>{0}</b> could not be written.' - '<br>Reason: {1}</p>') - .format(self.reportFile, str(why))) + E5MessageBox.critical( + self, self.trUtf8('PyLint Report'), + self.trUtf8('<p>The PyLint report file <b>{0}</b> could not' + ' be written.<br>Reason: {1}</p>') + .format(self.reportFile, str(why))) @pyqtSlot() def on_saveButton_clicked(self):