Fixed issues in the syntax check dialog and the PEP-8 checker dialog. 5_3_x

Wed, 06 Nov 2013 19:43:32 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 06 Nov 2013 19:43:32 +0100
branch
5_3_x
changeset 3063
2da2fa1ce1ff
parent 3052
216b1d41f58d
child 3072
68f54a5e0c6b

Fixed issues in the syntax check dialog and the PEP-8 checker dialog.

Plugins/CheckerPlugins/Pep8/Pep8Dialog.py file | annotate | diff | comparison | revisions
Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py	Tue Oct 29 12:37:42 2013 +0100
+++ b/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py	Wed Nov 06 19:43:32 2013 +0100
@@ -215,6 +215,7 @@
         QApplication.processEvents()
         
         self.__resetStatistics()
+        self.__clearErrors()
         
         if save:
             self.__fileOrFileList = fn
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Tue Oct 29 12:37:42 2013 +0100
+++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py	Wed Nov 06 19:43:32 2013 +0100
@@ -142,6 +142,8 @@
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         QApplication.processEvents()
         
+        self.__clearErrors()
+        
         if isinstance(fn, list):
             files = fn
         elif os.path.isdir(fn):
@@ -365,10 +367,28 @@
         """
         vm = e5App().getObject("ViewManager")
         
+        selectedIndexes = []
         for index in range(self.resultList.topLevelItemCount()):
+            if self.resultList.topLevelItem(index).isSelected():
+                selectedIndexes.append(index)
+        if len(selectedIndexes) == 0:
+            selectedIndexes = list(range(self.resultList.topLevelItemCount()))
+        for index in selectedIndexes:
             itm = self.resultList.topLevelItem(index)
             fn = Utilities.normabspath(itm.data(0, self.filenameRole))
             vm.openSourceFile(fn, 1)
+            editor = vm.getOpenEditor(fn)
+            editor.clearSyntaxError()
+            editor.clearFlakesWarnings()
+            for cindex in range(itm.childCount()):
+                citm = itm.child(cindex)
+                lineno = citm.data(0, self.lineRole)
+                index = citm.data(0, self.indexRole)
+                error = citm.data(0, self.errorRole)
+                if citm.data(0, self.warningRole):
+                    editor.toggleFlakesWarning(lineno, True, error)
+                else:
+                    editor.toggleSyntaxError(lineno, index, True, error, show=True)
         
         # go through the list again to clear syntax error and
         # py3flakes warning markers for files, that are ok

eric ide

mercurial