Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py

changeset 3746
0c1d19eb0ac6
parent 3656
441956d8fce5
child 4021
195a471c327b
diff -r 4c6f1782f530 -r 0c1d19eb0ac6 Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Thu Jul 31 16:53:43 2014 +0200
+++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Thu Jul 31 22:37:54 2014 +0200
@@ -96,6 +96,7 @@
         self.__forProject = False
         self.__data = {}
         self.__statistics = {}
+        self.__onlyFixes = {}
         
         self.on_loadDefaultButton_clicked()
     
@@ -366,14 +367,13 @@
             self.files.sort()
             self.check()
         
-    def check(self, codestring='', onlyFixes={}):
+    def check(self, codestring=''):
         """
         Public method to start a style check for one file.
         
         The results are reported to the __processResult slot.
         
         @keyparam codestring optional sourcestring (str)
-        @keyparam onlyFixes dict which violations should be fixed (dict)
         """
         if not self.files:
             self.checkProgressLabel.setPath("")
@@ -417,7 +417,7 @@
         
         errors = []
         self.__itms = []
-        for error, itm in onlyFixes.get(self.filename, []):
+        for error, itm in self.__onlyFixes.pop(self.filename, []):
             errors.append(error)
             self.__itms.append(itm)
         
@@ -453,7 +453,7 @@
             for itm, (lineno, position, text, ignored, fixed, autofixing) in \
                     zip(self.__itms, results):
                 self.__modifyFixedResultItem(itm, text, fixed)
-                self.__updateFixerStatistics(fixes)
+            self.__updateFixerStatistics(fixes)
         else:
             for lineno, position, text, ignored, fixed, autofixing in results:
                 if ignored:
@@ -813,7 +813,7 @@
                                   itm.data(0, self.messageRole))),
                 itm
             ))
-        ##!
+    
         # update the configuration values (3: fixCodes, 4: noFixCodes,
         # 5: fixIssues, 6: maxLineLength)
         self.__options[3] = self.fixIssuesEdit.text()
@@ -826,7 +826,8 @@
         self.progress = 0
         self.files.sort()
         self.cancelled = False
-        self.check(onlyFixes=fixesDict)
+        self.__onlyFixes = fixesDict
+        self.check()
     
     def __getSelectedFixableItems(self):
         """

eric ide

mercurial