346 if "BuiltinsChecker" not in self.__data: |
346 if "BuiltinsChecker" not in self.__data: |
347 self.__data["BuiltinsChecker"] = { |
347 self.__data["BuiltinsChecker"] = { |
348 "str": ["unicode", ], |
348 "str": ["unicode", ], |
349 "chr": ["unichr", ], |
349 "chr": ["unichr", ], |
350 } |
350 } |
|
351 if "CommentedCodeChecker" not in self.__data: |
|
352 self.__data["CommentedCodeChecker"] = { |
|
353 "Aggressive": False, |
|
354 } |
351 |
355 |
352 self.excludeFilesEdit.setText(self.__data["ExcludeFiles"]) |
356 self.excludeFilesEdit.setText(self.__data["ExcludeFiles"]) |
353 self.excludeMessagesEdit.setText(self.__data["ExcludeMessages"]) |
357 self.excludeMessagesEdit.setText(self.__data["ExcludeMessages"]) |
354 self.includeMessagesEdit.setText(self.__data["IncludeMessages"]) |
358 self.includeMessagesEdit.setText(self.__data["IncludeMessages"]) |
355 self.repeatCheckBox.setChecked(self.__data["RepeatMessages"]) |
359 self.repeatCheckBox.setChecked(self.__data["RepeatMessages"]) |
372 self.copyrightFileSizeSpinBox.setValue( |
376 self.copyrightFileSizeSpinBox.setValue( |
373 self.__data["CopyrightMinFileSize"]) |
377 self.__data["CopyrightMinFileSize"]) |
374 self.copyrightAuthorEdit.setText(self.__data["CopyrightAuthor"]) |
378 self.copyrightAuthorEdit.setText(self.__data["CopyrightAuthor"]) |
375 self.__initFuturesList(self.__data["FutureChecker"]) |
379 self.__initFuturesList(self.__data["FutureChecker"]) |
376 self.__initBuiltinsIgnoreList(self.__data["BuiltinsChecker"]) |
380 self.__initBuiltinsIgnoreList(self.__data["BuiltinsChecker"]) |
|
381 self.aggressiveCheckBox.setChecked( |
|
382 self.__data["CommentedCodeChecker"]["Aggressive"]) |
377 |
383 |
378 def start(self, fn, save=False, repeat=None): |
384 def start(self, fn, save=False, repeat=None): |
379 """ |
385 """ |
380 Public slot to start the code style check. |
386 Public slot to start the code style check. |
381 |
387 |
468 "MinFilesize": self.copyrightFileSizeSpinBox.value(), |
474 "MinFilesize": self.copyrightFileSizeSpinBox.value(), |
469 "Author": self.copyrightAuthorEdit.text(), |
475 "Author": self.copyrightAuthorEdit.text(), |
470 }, |
476 }, |
471 "FutureChecker": self.__getSelectedFutureImports(), |
477 "FutureChecker": self.__getSelectedFutureImports(), |
472 "BuiltinsChecker": self.__getBuiltinsIgnoreList(), |
478 "BuiltinsChecker": self.__getBuiltinsIgnoreList(), |
|
479 "CommentedCodeChecker": { |
|
480 "Aggressive": self.aggressiveCheckBox.isChecked(), |
|
481 } |
473 } |
482 } |
474 |
483 |
475 self.__options = [excludeMessages, includeMessages, repeatMessages, |
484 self.__options = [excludeMessages, includeMessages, repeatMessages, |
476 fixCodes, noFixCodes, fixIssues, maxLineLength, |
485 fixCodes, noFixCodes, fixIssues, maxLineLength, |
477 maxDocLineLength, blankLines, hangClosing, |
486 maxDocLineLength, blankLines, hangClosing, |
801 "ValidEncodings": self.encodingsEdit.text(), |
810 "ValidEncodings": self.encodingsEdit.text(), |
802 "CopyrightMinFileSize": self.copyrightFileSizeSpinBox.value(), |
811 "CopyrightMinFileSize": self.copyrightFileSizeSpinBox.value(), |
803 "CopyrightAuthor": self.copyrightAuthorEdit.text(), |
812 "CopyrightAuthor": self.copyrightAuthorEdit.text(), |
804 "FutureChecker": self.__getSelectedFutureImports(), |
813 "FutureChecker": self.__getSelectedFutureImports(), |
805 "BuiltinsChecker": self.__getBuiltinsIgnoreList(), |
814 "BuiltinsChecker": self.__getBuiltinsIgnoreList(), |
|
815 "CommentedCodeChecker": { |
|
816 "Aggressive": self.aggressiveCheckBox.isChecked(), |
|
817 } |
806 } |
818 } |
807 if data != self.__data: |
819 if data != self.__data: |
808 self.__data = data |
820 self.__data = data |
809 self.__project.setData("CHECKERSPARMS", "Pep8Checker", |
821 self.__project.setData("CHECKERSPARMS", "Pep8Checker", |
810 self.__data) |
822 self.__data) |
1003 self.__initBuiltinsIgnoreList(Preferences.toDict( |
1015 self.__initBuiltinsIgnoreList(Preferences.toDict( |
1004 Preferences.Prefs.settings.value("PEP8/BuiltinsChecker", { |
1016 Preferences.Prefs.settings.value("PEP8/BuiltinsChecker", { |
1005 "str": ["unicode", ], |
1017 "str": ["unicode", ], |
1006 "chr": ["unichr", ], |
1018 "chr": ["unichr", ], |
1007 }))) |
1019 }))) |
|
1020 self.aggressiveCheckBox.setChecked(Preferences.toBool( |
|
1021 Preferences.Prefs.settings.value("PEP8/AggressiveSearch", False))) |
1008 |
1022 |
1009 @pyqtSlot() |
1023 @pyqtSlot() |
1010 def on_storeDefaultButton_clicked(self): |
1024 def on_storeDefaultButton_clicked(self): |
1011 """ |
1025 """ |
1012 Private slot to store the current configuration values as |
1026 Private slot to store the current configuration values as |
1058 "PEP8/CopyrightAuthor", self.copyrightAuthorEdit.text()) |
1072 "PEP8/CopyrightAuthor", self.copyrightAuthorEdit.text()) |
1059 Preferences.Prefs.settings.setValue( |
1073 Preferences.Prefs.settings.setValue( |
1060 "PEP8/FutureChecker", self.__getSelectedFutureImports()) |
1074 "PEP8/FutureChecker", self.__getSelectedFutureImports()) |
1061 Preferences.Prefs.settings.setValue( |
1075 Preferences.Prefs.settings.setValue( |
1062 "PEP8/BuiltinsChecker", self.__getBuiltinsIgnoreList()) |
1076 "PEP8/BuiltinsChecker", self.__getBuiltinsIgnoreList()) |
|
1077 Preferences.Prefs.settings.setValue( |
|
1078 "PEP8/AggressiveSearch", self.aggressiveCheckBox.isChecked()) |
1063 |
1079 |
1064 @pyqtSlot() |
1080 @pyqtSlot() |
1065 def on_resetDefaultButton_clicked(self): |
1081 def on_resetDefaultButton_clicked(self): |
1066 """ |
1082 """ |
1067 Private slot to reset the configuration values to their default values. |
1083 Private slot to reset the configuration values to their default values. |
1096 Preferences.Prefs.settings.setValue("PEP8/FutureChecker", "") |
1112 Preferences.Prefs.settings.setValue("PEP8/FutureChecker", "") |
1097 Preferences.Prefs.settings.setValue("PEP8/BuiltinsChecker", { |
1113 Preferences.Prefs.settings.setValue("PEP8/BuiltinsChecker", { |
1098 "str": ["unicode", ], |
1114 "str": ["unicode", ], |
1099 "chr": ["unichr", ], |
1115 "chr": ["unichr", ], |
1100 }) |
1116 }) |
|
1117 Preferences.Prefs.settings.setValue("PEP8/AggressiveSearch", False) |
|
1118 |
1101 # Update UI with default values |
1119 # Update UI with default values |
1102 self.on_loadDefaultButton_clicked() |
1120 self.on_loadDefaultButton_clicked() |
1103 |
1121 |
1104 @pyqtSlot(QAbstractButton) |
1122 @pyqtSlot(QAbstractButton) |
1105 def on_buttonBox_clicked(self, button): |
1123 def on_buttonBox_clicked(self, button): |