Sun, 21 Apr 2013 20:30:56 +0200
Fixes and consolidation for PEP8-checker.
--- a/APIs/Python3/eric5.api Sat Apr 20 20:29:37 2013 +0200 +++ b/APIs/Python3/eric5.api Sun Apr 21 20:30:56 2013 +0200 @@ -5851,7 +5851,6 @@ eric5.Preferences.Prefs.userDefaults?7 eric5.Preferences.Prefs.varDefaults?7 eric5.Preferences.Prefs.vcsDefaults?7 -eric5.Preferences.Prefs.viewProfilesLength?7 eric5.Preferences.Prefs.webSettingsIntitialized?7 eric5.Preferences.ProgramsDialog.ProgramsDialog.on_buttonBox_clicked?4(button) eric5.Preferences.ProgramsDialog.ProgramsDialog.on_programsSearchButton_clicked?4() @@ -8260,12 +8259,6 @@ eric5.Utilities.win32_Kill?4(pid) eric5.Utilities.win32_getRealName?4() eric5.Utilities.writeEncodedFile?4(filename, text, orig_coding) -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker.filename?7 -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker.ignore?7 -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker.repeat?7 -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker.report_error_args?4(line_number, offset, code, check, *args) -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker.select?7 -eric5.UtilitiesPython2.Pep8Checker.Pep8Checker?1(filename, lines, repeat=False, select="", ignore="") eric5.UtilitiesPython2.Tabnanny.NannyNag.get_line?4() eric5.UtilitiesPython2.Tabnanny.NannyNag.get_lineno?4() eric5.UtilitiesPython2.Tabnanny.NannyNag.get_msg?4() @@ -8286,78 +8279,6 @@ eric5.UtilitiesPython2.Tools.get_coding?4(text) eric5.UtilitiesPython2.Tools.normalizeCode?4(codestring) eric5.UtilitiesPython2.Tools.readEncodedFile?4(filename) -eric5.UtilitiesPython2.pep8.BENCHMARK_KEYS?7 -eric5.UtilitiesPython2.pep8.BINARY_OPERATORS?7 -eric5.UtilitiesPython2.pep8.Checker.build_tokens_line?4() -eric5.UtilitiesPython2.pep8.Checker.check_all?4(expected=None, line_offset=0) -eric5.UtilitiesPython2.pep8.Checker.check_logical?4() -eric5.UtilitiesPython2.pep8.Checker.check_physical?4(line) -eric5.UtilitiesPython2.pep8.Checker.readline?4() -eric5.UtilitiesPython2.pep8.Checker.readline_check_physical?4() -eric5.UtilitiesPython2.pep8.Checker.report_error?4(line_number, offset, text, check) -eric5.UtilitiesPython2.pep8.Checker.run_check?4(check, argument_names) -eric5.UtilitiesPython2.pep8.Checker?1(filename, lines=None) -eric5.UtilitiesPython2.pep8.DEFAULT_EXCLUDE?7 -eric5.UtilitiesPython2.pep8.DEFAULT_IGNORE?7 -eric5.UtilitiesPython2.pep8.DOCSTRING_REGEX?7 -eric5.UtilitiesPython2.pep8.E225NOT_KEYWORDS?7 -eric5.UtilitiesPython2.pep8.ERRORCODE_REGEX?7 -eric5.UtilitiesPython2.pep8.EXTRANEOUS_WHITESPACE_REGEX?7 -eric5.UtilitiesPython2.pep8.INDENT_REGEX?7 -eric5.UtilitiesPython2.pep8.MAX_LINE_LENGTH?7 -eric5.UtilitiesPython2.pep8.OPERATORS?7 -eric5.UtilitiesPython2.pep8.RAISE_COMMA_REGEX?7 -eric5.UtilitiesPython2.pep8.SELFTEST_REGEX?7 -eric5.UtilitiesPython2.pep8.SKIP_TOKENS?7 -eric5.UtilitiesPython2.pep8.UNARY_OPERATORS?7 -eric5.UtilitiesPython2.pep8.WHITESPACE?7 -eric5.UtilitiesPython2.pep8.WHITESPACE_AROUND_NAMED_PARAMETER_REGEX?7 -eric5.UtilitiesPython2.pep8.WHITESPACE_AROUND_OPERATOR_REGEX?7 -eric5.UtilitiesPython2.pep8._main?5() -eric5.UtilitiesPython2.pep8.args?7 -eric5.UtilitiesPython2.pep8.blank_lines?4(logical_line, blank_lines, indent_level, line_number, previous_logical, previous_indent_level, blank_lines_before_comment) -eric5.UtilitiesPython2.pep8.compound_statements?4(logical_line) -eric5.UtilitiesPython2.pep8.excluded?4(filename) -eric5.UtilitiesPython2.pep8.expand_indent?4(line) -eric5.UtilitiesPython2.pep8.extraneous_whitespace?4(logical_line) -eric5.UtilitiesPython2.pep8.filename_match?4(filename) -eric5.UtilitiesPython2.pep8.find_checks?4(argument_name) -eric5.UtilitiesPython2.pep8.get_count?4(prefix='') -eric5.UtilitiesPython2.pep8.get_error_statistics?4() -eric5.UtilitiesPython2.pep8.get_statistics?4(prefix='') -eric5.UtilitiesPython2.pep8.get_warning_statistics?4() -eric5.UtilitiesPython2.pep8.ignore_code?4(code) -eric5.UtilitiesPython2.pep8.imports_on_separate_lines?4(logical_line) -eric5.UtilitiesPython2.pep8.indentation?4(logical_line, previous_logical, indent_char, indent_level, previous_indent_level) -eric5.UtilitiesPython2.pep8.input_dir?4(dirname, runner=None) -eric5.UtilitiesPython2.pep8.input_file?4(filename) -eric5.UtilitiesPython2.pep8.maximum_line_length?4(physical_line) -eric5.UtilitiesPython2.pep8.message?4(text) -eric5.UtilitiesPython2.pep8.missing_newline?4(physical_line) -eric5.UtilitiesPython2.pep8.missing_whitespace?4(logical_line) -eric5.UtilitiesPython2.pep8.missing_whitespace_around_operator?4(logical_line, tokens) -eric5.UtilitiesPython2.pep8.mute_string?4(text) -eric5.UtilitiesPython2.pep8.options?7 -eric5.UtilitiesPython2.pep8.print_benchmark?4(elapsed) -eric5.UtilitiesPython2.pep8.print_statistics?4(prefix='') -eric5.UtilitiesPython2.pep8.process_options?4(arglist=None) -eric5.UtilitiesPython2.pep8.python_3000_backticks?4(logical_line) -eric5.UtilitiesPython2.pep8.python_3000_has_key?4(logical_line) -eric5.UtilitiesPython2.pep8.python_3000_not_equal?4(logical_line) -eric5.UtilitiesPython2.pep8.python_3000_raise_comma?4(logical_line) -eric5.UtilitiesPython2.pep8.readlines?4(filename) -eric5.UtilitiesPython2.pep8.reset_counters?4() -eric5.UtilitiesPython2.pep8.run_tests?4(filename) -eric5.UtilitiesPython2.pep8.selftest?4() -eric5.UtilitiesPython2.pep8.tabs_obsolete?4(physical_line) -eric5.UtilitiesPython2.pep8.tabs_or_spaces?4(physical_line, indent_char) -eric5.UtilitiesPython2.pep8.trailing_blank_lines?4(physical_line, lines, line_number) -eric5.UtilitiesPython2.pep8.trailing_whitespace?4(physical_line) -eric5.UtilitiesPython2.pep8.whitespace_around_comma?4(logical_line) -eric5.UtilitiesPython2.pep8.whitespace_around_named_parameter_equals?4(logical_line) -eric5.UtilitiesPython2.pep8.whitespace_around_operator?4(logical_line) -eric5.UtilitiesPython2.pep8.whitespace_before_inline_comment?4(logical_line, tokens) -eric5.UtilitiesPython2.pep8.whitespace_before_parameters?4(logical_line, tokens) eric5.VCS.CommandOptionsDialog.vcsCommandOptionsDialog.getOptions?4() eric5.VCS.CommandOptionsDialog.vcsCommandOptionsDialog?1(vcs, parent=None) eric5.VCS.ProjectBrowserHelper.VcsProjectBrowserHelper._VCSAdd?5()
--- a/Documentation/Help/source.qhp Sat Apr 20 20:29:37 2013 +0200 +++ b/Documentation/Help/source.qhp Sun Apr 21 20:30:56 2013 +0200 @@ -955,12 +955,10 @@ <section title="eric5.Utilities.uic" ref="eric5.Utilities.uic.html" /> </section> <section title="eric5.UtilitiesPython2" ref="index-eric5.UtilitiesPython2.html"> - <section title="eric5.UtilitiesPython2.Pep8Checker" ref="eric5.UtilitiesPython2.Pep8Checker.html" /> <section title="eric5.UtilitiesPython2.PySideImporter" ref="eric5.UtilitiesPython2.PySideImporter.html" /> <section title="eric5.UtilitiesPython2.Tabnanny" ref="eric5.UtilitiesPython2.Tabnanny.html" /> <section title="eric5.UtilitiesPython2.TabnannyChecker" ref="eric5.UtilitiesPython2.TabnannyChecker.html" /> <section title="eric5.UtilitiesPython2.Tools" ref="eric5.UtilitiesPython2.Tools.html" /> - <section title="eric5.UtilitiesPython2.pep8" ref="eric5.UtilitiesPython2.pep8.html" /> </section> <section title="eric5.VCS" ref="index-eric5.VCS.html"> <section title="eric5.VCS.CommandOptionsDialog" ref="eric5.VCS.CommandOptionsDialog.html" /> @@ -1917,11 +1915,9 @@ <keyword name="Checker" id="Checker" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker" /> <keyword name="Checker" id="Checker" ref="eric5.Utilities.py2flakes.checker.html#Checker" /> <keyword name="Checker" id="Checker" ref="eric5.Utilities.py3flakes.checker.html#Checker" /> - <keyword name="Checker" id="Checker" ref="eric5.UtilitiesPython2.pep8.html#Checker" /> <keyword name="Checker (Constructor)" id="Checker (Constructor)" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.__init__" /> <keyword name="Checker (Constructor)" id="Checker (Constructor)" ref="eric5.Utilities.py2flakes.checker.html#Checker.__init__" /> <keyword name="Checker (Constructor)" id="Checker (Constructor)" ref="eric5.Utilities.py3flakes.checker.html#Checker.__init__" /> - <keyword name="Checker (Constructor)" id="Checker (Constructor)" ref="eric5.UtilitiesPython2.pep8.html#Checker.__init__" /> <keyword name="Checker.ASSIGN" id="Checker.ASSIGN" ref="eric5.Utilities.py2flakes.checker.html#Checker.ASSIGN" /> <keyword name="Checker.ASSIGN" id="Checker.ASSIGN" ref="eric5.Utilities.py3flakes.checker.html#Checker.ASSIGN" /> <keyword name="Checker.AUGASSIGN" id="Checker.AUGASSIGN" ref="eric5.Utilities.py2flakes.checker.html#Checker.AUGASSIGN" /> @@ -1955,17 +1951,13 @@ <keyword name="Checker.addBinding" id="Checker.addBinding" ref="eric5.Utilities.py2flakes.checker.html#Checker.addBinding" /> <keyword name="Checker.addBinding" id="Checker.addBinding" ref="eric5.Utilities.py3flakes.checker.html#Checker.addBinding" /> <keyword name="Checker.build_tokens_line" id="Checker.build_tokens_line" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.build_tokens_line" /> - <keyword name="Checker.build_tokens_line" id="Checker.build_tokens_line" ref="eric5.UtilitiesPython2.pep8.html#Checker.build_tokens_line" /> <keyword name="Checker.checkDeadScopes" id="Checker.checkDeadScopes" ref="eric5.Utilities.py2flakes.checker.html#Checker.checkDeadScopes" /> <keyword name="Checker.checkUnusedAssignments" id="Checker.checkUnusedAssignments" ref="eric5.Utilities.py2flakes.checker.html#Checker.checkUnusedAssignments" /> <keyword name="Checker.checkUnusedAssignments" id="Checker.checkUnusedAssignments" ref="eric5.Utilities.py3flakes.checker.html#Checker.checkUnusedAssignments" /> <keyword name="Checker.check_all" id="Checker.check_all" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.check_all" /> - <keyword name="Checker.check_all" id="Checker.check_all" ref="eric5.UtilitiesPython2.pep8.html#Checker.check_all" /> <keyword name="Checker.check_dead_scopes" id="Checker.check_dead_scopes" ref="eric5.Utilities.py3flakes.checker.html#Checker.check_dead_scopes" /> <keyword name="Checker.check_logical" id="Checker.check_logical" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.check_logical" /> - <keyword name="Checker.check_logical" id="Checker.check_logical" ref="eric5.UtilitiesPython2.pep8.html#Checker.check_logical" /> <keyword name="Checker.check_physical" id="Checker.check_physical" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.check_physical" /> - <keyword name="Checker.check_physical" id="Checker.check_physical" ref="eric5.UtilitiesPython2.pep8.html#Checker.check_physical" /> <keyword name="Checker.collectLoopVars" id="Checker.collectLoopVars" ref="eric5.Utilities.py2flakes.checker.html#Checker.collectLoopVars" /> <keyword name="Checker.collectLoopVars" id="Checker.collectLoopVars" ref="eric5.Utilities.py3flakes.checker.html#Checker.collectLoopVars" /> <keyword name="Checker.deferAssignment" id="Checker.deferAssignment" ref="eric5.Utilities.py2flakes.checker.html#Checker.deferAssignment" /> @@ -1997,18 +1989,14 @@ <keyword name="Checker.pushFunctionScope" id="Checker.pushFunctionScope" ref="eric5.Utilities.py2flakes.checker.html#Checker.pushFunctionScope" /> <keyword name="Checker.pushFunctionScope" id="Checker.pushFunctionScope" ref="eric5.Utilities.py3flakes.checker.html#Checker.pushFunctionScope" /> <keyword name="Checker.readline" id="Checker.readline" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.readline" /> - <keyword name="Checker.readline" id="Checker.readline" ref="eric5.UtilitiesPython2.pep8.html#Checker.readline" /> <keyword name="Checker.readline_check_physical" id="Checker.readline_check_physical" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.readline_check_physical" /> - <keyword name="Checker.readline_check_physical" id="Checker.readline_check_physical" ref="eric5.UtilitiesPython2.pep8.html#Checker.readline_check_physical" /> <keyword name="Checker.report" id="Checker.report" ref="eric5.Utilities.py2flakes.checker.html#Checker.report" /> <keyword name="Checker.report" id="Checker.report" ref="eric5.Utilities.py3flakes.checker.html#Checker.report" /> <keyword name="Checker.report_error" id="Checker.report_error" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.report_error" /> - <keyword name="Checker.report_error" id="Checker.report_error" ref="eric5.UtilitiesPython2.pep8.html#Checker.report_error" /> <keyword name="Checker.runDeferred" id="Checker.runDeferred" ref="eric5.Utilities.py2flakes.checker.html#Checker.runDeferred" /> <keyword name="Checker.runFunction" id="Checker.runFunction" ref="eric5.Utilities.py2flakes.checker.html#Checker.runFunction" /> <keyword name="Checker.runFunction" id="Checker.runFunction" ref="eric5.Utilities.py3flakes.checker.html#Checker.runFunction" /> <keyword name="Checker.run_check" id="Checker.run_check" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#Checker.run_check" /> - <keyword name="Checker.run_check" id="Checker.run_check" ref="eric5.UtilitiesPython2.pep8.html#Checker.run_check" /> <keyword name="Checker.scope" id="Checker.scope" ref="eric5.Utilities.py2flakes.checker.html#Checker.scope" /> <keyword name="Checker.scope" id="Checker.scope" ref="eric5.Utilities.py3flakes.checker.html#Checker.scope" /> <keyword name="CheckerPlugins (Package)" id="CheckerPlugins (Package)" ref="index-eric5.Plugins.CheckerPlugins.html" /> @@ -7831,15 +7819,10 @@ <keyword name="PasswordsDialog.on_passwordsButton_clicked" id="PasswordsDialog.on_passwordsButton_clicked" ref="eric5.Helpviewer.Passwords.PasswordsDialog.html#PasswordsDialog.on_passwordsButton_clicked" /> <keyword name="Pep8 (Package)" id="Pep8 (Package)" ref="index-eric5.Plugins.CheckerPlugins.Pep8.html" /> <keyword name="Pep8Checker" id="Pep8Checker" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Checker.html#Pep8Checker" /> - <keyword name="Pep8Checker" id="Pep8Checker" ref="eric5.UtilitiesPython2.Pep8Checker.html#Pep8Checker" /> <keyword name="Pep8Checker (Constructor)" id="Pep8Checker (Constructor)" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Checker.html#Pep8Checker.__init__" /> - <keyword name="Pep8Checker (Constructor)" id="Pep8Checker (Constructor)" ref="eric5.UtilitiesPython2.Pep8Checker.html#Pep8Checker.__init__" /> <keyword name="Pep8Checker (Module)" id="Pep8Checker (Module)" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Checker.html" /> - <keyword name="Pep8Checker (Module)" id="Pep8Checker (Module)" ref="eric5.UtilitiesPython2.Pep8Checker.html" /> <keyword name="Pep8Checker.__ignore_code" id="Pep8Checker.__ignore_code" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Checker.html#Pep8Checker.__ignore_code" /> - <keyword name="Pep8Checker.__ignore_code" id="Pep8Checker.__ignore_code" ref="eric5.UtilitiesPython2.Pep8Checker.html#Pep8Checker.__ignore_code" /> <keyword name="Pep8Checker.report_error_args" id="Pep8Checker.report_error_args" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Checker.html#Pep8Checker.report_error_args" /> - <keyword name="Pep8Checker.report_error_args" id="Pep8Checker.report_error_args" ref="eric5.UtilitiesPython2.Pep8Checker.html#Pep8Checker.report_error_args" /> <keyword name="Pep8CheckerPlugin" id="Pep8CheckerPlugin" ref="eric5.Plugins.PluginPep8Checker.html#Pep8CheckerPlugin" /> <keyword name="Pep8CheckerPlugin (Constructor)" id="Pep8CheckerPlugin (Constructor)" ref="eric5.Plugins.PluginPep8Checker.html#Pep8CheckerPlugin.__init__" /> <keyword name="Pep8CheckerPlugin.__editorClosed" id="Pep8CheckerPlugin.__editorClosed" ref="eric5.Plugins.PluginPep8Checker.html#Pep8CheckerPlugin.__editorClosed" /> @@ -7861,6 +7844,7 @@ <keyword name="Pep8Dialog (Constructor)" id="Pep8Dialog (Constructor)" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__init__" /> <keyword name="Pep8Dialog (Module)" id="Pep8Dialog (Module)" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html" /> <keyword name="Pep8Dialog.__clearErrors" id="Pep8Dialog.__clearErrors" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__clearErrors" /> + <keyword name="Pep8Dialog.__createErrorItem" id="Pep8Dialog.__createErrorItem" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__createErrorItem" /> <keyword name="Pep8Dialog.__createResultItem" id="Pep8Dialog.__createResultItem" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__createResultItem" /> <keyword name="Pep8Dialog.__finish" id="Pep8Dialog.__finish" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__finish" /> <keyword name="Pep8Dialog.__resetStatistics" id="Pep8Dialog.__resetStatistics" ref="eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html#Pep8Dialog.__resetStatistics" /> @@ -12231,7 +12215,6 @@ <keyword name="_indent" id="_indent" ref="eric5.Utilities.ClassBrowsers.pyclbr.html#_indent" /> <keyword name="_indent" id="_indent" ref="eric5.Utilities.ModuleParser.html#_indent" /> <keyword name="_main" id="_main" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#_main" /> - <keyword name="_main" id="_main" ref="eric5.UtilitiesPython2.pep8.html#_main" /> <keyword name="_percentReplacementFunc" id="_percentReplacementFunc" ref="eric5.Utilities.__init__.html#_percentReplacementFunc" /> <keyword name="addActions" id="addActions" ref="eric5.E5Gui.E5Action.html#addActions" /> <keyword name="addSearchPath" id="addSearchPath" ref="eric5.UI.PixmapCache.html#addSearchPath" /> @@ -12241,7 +12224,6 @@ <keyword name="append_PKCS7_padding" id="append_PKCS7_padding" ref="eric5.Utilities.crypto.py3AES.html#append_PKCS7_padding" /> <keyword name="binplistlib (Module)" id="binplistlib (Module)" ref="eric5.Utilities.binplistlib.html" /> <keyword name="blank_lines" id="blank_lines" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#blank_lines" /> - <keyword name="blank_lines" id="blank_lines" ref="eric5.UtilitiesPython2.pep8.html#blank_lines" /> <keyword name="bookmarks (Module)" id="bookmarks (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.BookmarksExtension.bookmarks.html" /> <keyword name="changeRememberedMaster" id="changeRememberedMaster" ref="eric5.Utilities.crypto.__init__.html#changeRememberedMaster" /> <keyword name="check" id="check" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#check" /> @@ -12268,7 +12250,6 @@ <keyword name="compile_ui" id="compile_ui" ref="eric5.compileUiFiles.html#compile_ui" /> <keyword name="compile_ui" id="compile_ui" ref="eric5.install.html#compile_ui" /> <keyword name="compound_statements" id="compound_statements" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#compound_statements" /> - <keyword name="compound_statements" id="compound_statements" ref="eric5.UtilitiesPython2.pep8.html#compound_statements" /> <keyword name="contentSniff" id="contentSniff" ref="eric5.Helpviewer.HelpBrowserWV.html#contentSniff" /> <keyword name="context" id="context" ref="eric5.DebugClients.Ruby.Debuggee.html#context" /> <keyword name="context_diff" id="context_diff" ref="eric5.UI.DiffDialog.html#context_diff" /> @@ -12410,7 +12391,6 @@ <keyword name="eventPoll" id="eventPoll" ref="eric5.DebugClients.Ruby.Debuggee.html#eventPoll" /> <keyword name="excepthook" id="excepthook" ref="eric5.eric5.html#excepthook" /> <keyword name="excluded" id="excluded" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#excluded" /> - <keyword name="excluded" id="excluded" ref="eric5.UtilitiesPython2.pep8.html#excluded" /> <keyword name="exeDisplayData" id="exeDisplayData" ref="eric5.Plugins.PluginEricapi.html#exeDisplayData" /> <keyword name="exeDisplayData" id="exeDisplayData" ref="eric5.Plugins.PluginVcsMercurial.html#exeDisplayData" /> <keyword name="exeDisplayData" id="exeDisplayData" ref="eric5.Plugins.PluginVcsPySvn.html#exeDisplayData" /> @@ -12418,7 +12398,6 @@ <keyword name="exeDisplayDataList" id="exeDisplayDataList" ref="eric5.Plugins.PluginEricdoc.html#exeDisplayDataList" /> <keyword name="exit" id="exit" ref="eric5.install.html#exit" /> <keyword name="expand_indent" id="expand_indent" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#expand_indent" /> - <keyword name="expand_indent" id="expand_indent" ref="eric5.UtilitiesPython2.pep8.html#expand_indent" /> <keyword name="exportPreferences" id="exportPreferences" ref="eric5.Preferences.__init__.html#exportPreferences" /> <keyword name="exportShortcuts" id="exportShortcuts" ref="eric5.Preferences.Shortcuts.html#exportShortcuts" /> <keyword name="extractFlags" id="extractFlags" ref="eric5.Utilities.__init__.html#extractFlags" /> @@ -12426,17 +12405,14 @@ <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.Utilities.SyntaxCheck.html#extractLineFlags" /> <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.UtilitiesPython2.Tools.html#extractLineFlags" /> <keyword name="extraneous_whitespace" id="extraneous_whitespace" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#extraneous_whitespace" /> - <keyword name="extraneous_whitespace" id="extraneous_whitespace" ref="eric5.UtilitiesPython2.pep8.html#extraneous_whitespace" /> <keyword name="factory" id="factory" ref="eric5.VCS.__init__.html#factory" /> <keyword name="factory" id="factory" ref="eric5.ViewManager.__init__.html#factory" /> <keyword name="fetch (Module)" id="fetch (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.FetchExtension.fetch.html" /> <keyword name="filename_match" id="filename_match" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#filename_match" /> - <keyword name="filename_match" id="filename_match" ref="eric5.UtilitiesPython2.pep8.html#filename_match" /> <keyword name="fileno" id="fileno" ref="eric5.DebugClients.Ruby.AsyncFile.html#fileno" /> <keyword name="filterCharsFromFilename" id="filterCharsFromFilename" ref="eric5.Helpviewer.HelpUtilities.html#filterCharsFromFilename" /> <keyword name="findPythonInterpreters" id="findPythonInterpreters" ref="eric5.Globals.__init__.html#findPythonInterpreters" /> <keyword name="find_checks" id="find_checks" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#find_checks" /> - <keyword name="find_checks" id="find_checks" ref="eric5.UtilitiesPython2.pep8.html#find_checks" /> <keyword name="find_module" id="find_module" ref="eric5.Utilities.ClassBrowsers.__init__.html#find_module" /> <keyword name="find_module" id="find_module" ref="eric5.Utilities.ModuleParser.html#find_module" /> <keyword name="flush" id="flush" ref="eric5.DebugClients.Ruby.AsyncFile.html#flush" /> @@ -12563,14 +12539,10 @@ <keyword name="get_coding" id="get_coding" ref="eric5.UtilitiesPython2.Tools.html#get_coding" /> <keyword name="get_codingBytes" id="get_codingBytes" ref="eric5.Utilities.SyntaxCheck.html#get_codingBytes" /> <keyword name="get_count" id="get_count" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#get_count" /> - <keyword name="get_count" id="get_count" ref="eric5.UtilitiesPython2.pep8.html#get_count" /> <keyword name="get_error_statistics" id="get_error_statistics" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#get_error_statistics" /> - <keyword name="get_error_statistics" id="get_error_statistics" ref="eric5.UtilitiesPython2.pep8.html#get_error_statistics" /> <keyword name="get_statistics" id="get_statistics" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#get_statistics" /> - <keyword name="get_statistics" id="get_statistics" ref="eric5.UtilitiesPython2.pep8.html#get_statistics" /> <keyword name="get_thread" id="get_thread" ref="eric5.DebugClients.Ruby.Debuggee.html#get_thread" /> <keyword name="get_warning_statistics" id="get_warning_statistics" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#get_warning_statistics" /> - <keyword name="get_warning_statistics" id="get_warning_statistics" ref="eric5.UtilitiesPython2.pep8.html#get_warning_statistics" /> <keyword name="getpass" id="getpass" ref="eric5.DebugClients.Python.getpass.html#getpass" /> <keyword name="getpass" id="getpass" ref="eric5.DebugClients.Python3.getpass.html#getpass" /> <keyword name="getpass (Module)" id="getpass (Module)" ref="eric5.DebugClients.Python.getpass.html" /> @@ -12590,13 +12562,10 @@ <keyword name="html_uencode" id="html_uencode" ref="eric5.Utilities.__init__.html#html_uencode" /> <keyword name="idlclbr (Module)" id="idlclbr (Module)" ref="eric5.Utilities.ClassBrowsers.idlclbr.html" /> <keyword name="ignore_code" id="ignore_code" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#ignore_code" /> - <keyword name="ignore_code" id="ignore_code" ref="eric5.UtilitiesPython2.pep8.html#ignore_code" /> <keyword name="importPreferences" id="importPreferences" ref="eric5.Preferences.__init__.html#importPreferences" /> <keyword name="importShortcuts" id="importShortcuts" ref="eric5.Preferences.Shortcuts.html#importShortcuts" /> <keyword name="imports_on_separate_lines" id="imports_on_separate_lines" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#imports_on_separate_lines" /> - <keyword name="imports_on_separate_lines" id="imports_on_separate_lines" ref="eric5.UtilitiesPython2.pep8.html#imports_on_separate_lines" /> <keyword name="indentation" id="indentation" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#indentation" /> - <keyword name="indentation" id="indentation" ref="eric5.UtilitiesPython2.pep8.html#indentation" /> <keyword name="information" id="information" ref="eric5.E5Gui.E5MessageBox.html#information" /> <keyword name="initDebugger" id="initDebugger" ref="eric5.DebugClients.Python.eric5dbgstub.html#initDebugger" /> <keyword name="initDebugger" id="initDebugger" ref="eric5.DebugClients.Python3.eric5dbgstub.html#initDebugger" /> @@ -12607,9 +12576,7 @@ <keyword name="initRecentSettings" id="initRecentSettings" ref="eric5.Preferences.__init__.html#initRecentSettings" /> <keyword name="initializeResourceSearchPath" id="initializeResourceSearchPath" ref="eric5.Toolbox.Startup.html#initializeResourceSearchPath" /> <keyword name="input_dir" id="input_dir" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#input_dir" /> - <keyword name="input_dir" id="input_dir" ref="eric5.UtilitiesPython2.pep8.html#input_dir" /> <keyword name="input_file" id="input_file" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#input_file" /> - <keyword name="input_file" id="input_file" ref="eric5.UtilitiesPython2.pep8.html#input_file" /> <keyword name="install (Module)" id="install (Module)" ref="eric5.install.html" /> <keyword name="install-i18n (Module)" id="install-i18n (Module)" ref="eric5.install-i18n.html" /> <keyword name="installEric" id="installEric" ref="eric5.install.html#installEric" /> @@ -12659,19 +12626,13 @@ <keyword name="makeAppInfo" id="makeAppInfo" ref="eric5.Globals.AppInfo.html#makeAppInfo" /> <keyword name="make_thread_list" id="make_thread_list" ref="eric5.DebugClients.Ruby.Debuggee.html#make_thread_list" /> <keyword name="maximum_line_length" id="maximum_line_length" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#maximum_line_length" /> - <keyword name="maximum_line_length" id="maximum_line_length" ref="eric5.UtilitiesPython2.pep8.html#maximum_line_length" /> <keyword name="message" id="message" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#message" /> - <keyword name="message" id="message" ref="eric5.UtilitiesPython2.pep8.html#message" /> <keyword name="messages (Module)" id="messages (Module)" ref="eric5.Utilities.py2flakes.messages.html" /> <keyword name="messages (Module)" id="messages (Module)" ref="eric5.Utilities.py3flakes.messages.html" /> <keyword name="missing_newline" id="missing_newline" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#missing_newline" /> - <keyword name="missing_newline" id="missing_newline" ref="eric5.UtilitiesPython2.pep8.html#missing_newline" /> <keyword name="missing_whitespace" id="missing_whitespace" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#missing_whitespace" /> - <keyword name="missing_whitespace" id="missing_whitespace" ref="eric5.UtilitiesPython2.pep8.html#missing_whitespace" /> <keyword name="missing_whitespace_around_operator" id="missing_whitespace_around_operator" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#missing_whitespace_around_operator" /> - <keyword name="missing_whitespace_around_operator" id="missing_whitespace_around_operator" ref="eric5.UtilitiesPython2.pep8.html#missing_whitespace_around_operator" /> <keyword name="mute_string" id="mute_string" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#mute_string" /> - <keyword name="mute_string" id="mute_string" ref="eric5.UtilitiesPython2.pep8.html#mute_string" /> <keyword name="normabsjoinpath" id="normabsjoinpath" ref="eric5.Utilities.__init__.html#normabsjoinpath" /> <keyword name="normabspath" id="normabspath" ref="eric5.Utilities.__init__.html#normabspath" /> <keyword name="normalizeCode" id="normalizeCode" ref="eric5.Utilities.SyntaxCheck.html#normalizeCode" /> @@ -12688,7 +12649,6 @@ <keyword name="pbkdf2" id="pbkdf2" ref="eric5.Utilities.crypto.py3PBKDF2.html#pbkdf2" /> <keyword name="pendingWrite" id="pendingWrite" ref="eric5.DebugClients.Ruby.AsyncFile.html#pendingWrite" /> <keyword name="pep8 (Module)" id="pep8 (Module)" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html" /> - <keyword name="pep8 (Module)" id="pep8 (Module)" ref="eric5.UtilitiesPython2.pep8.html" /> <keyword name="prepareQtMacBundle" id="prepareQtMacBundle" ref="eric5.Utilities.__init__.html#prepareQtMacBundle" /> <keyword name="prepareUninstall" id="prepareUninstall" ref="eric5.Plugins.PluginVcsMercurial.html#prepareUninstall" /> <keyword name="prepareUninstall" id="prepareUninstall" ref="eric5.Plugins.PluginVcsPySvn.html#prepareUninstall" /> @@ -12696,13 +12656,10 @@ <keyword name="previewPix" id="previewPix" ref="eric5.Plugins.PluginVmListspace.html#previewPix" /> <keyword name="previewPix" id="previewPix" ref="eric5.Plugins.PluginVmTabview.html#previewPix" /> <keyword name="print_benchmark" id="print_benchmark" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#print_benchmark" /> - <keyword name="print_benchmark" id="print_benchmark" ref="eric5.UtilitiesPython2.pep8.html#print_benchmark" /> <keyword name="print_statistics" id="print_statistics" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#print_statistics" /> - <keyword name="print_statistics" id="print_statistics" ref="eric5.UtilitiesPython2.pep8.html#print_statistics" /> <keyword name="printerr" id="printerr" ref="eric5.DebugClients.Python.DebugBase.html#printerr" /> <keyword name="printerr" id="printerr" ref="eric5.DebugClients.Python3.DebugBase.html#printerr" /> <keyword name="process_options" id="process_options" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#process_options" /> - <keyword name="process_options" id="process_options" ref="eric5.UtilitiesPython2.pep8.html#process_options" /> <keyword name="process_tokens" id="process_tokens" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#process_tokens" /> <keyword name="process_tokens" id="process_tokens" ref="eric5.UtilitiesPython2.Tabnanny.html#process_tokens" /> <keyword name="proxyAuthenticationRequired" id="proxyAuthenticationRequired" ref="eric5.E5Network.E5NetworkProxyFactory.html#proxyAuthenticationRequired" /> @@ -12723,13 +12680,9 @@ <keyword name="pyName" id="pyName" ref="eric5.install.html#pyName" /> <keyword name="pyclbr (Module)" id="pyclbr (Module)" ref="eric5.Utilities.ClassBrowsers.pyclbr.html" /> <keyword name="python_3000_backticks" id="python_3000_backticks" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#python_3000_backticks" /> - <keyword name="python_3000_backticks" id="python_3000_backticks" ref="eric5.UtilitiesPython2.pep8.html#python_3000_backticks" /> <keyword name="python_3000_has_key" id="python_3000_has_key" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#python_3000_has_key" /> - <keyword name="python_3000_has_key" id="python_3000_has_key" ref="eric5.UtilitiesPython2.pep8.html#python_3000_has_key" /> <keyword name="python_3000_not_equal" id="python_3000_not_equal" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#python_3000_not_equal" /> - <keyword name="python_3000_not_equal" id="python_3000_not_equal" ref="eric5.UtilitiesPython2.pep8.html#python_3000_not_equal" /> <keyword name="python_3000_raise_comma" id="python_3000_raise_comma" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#python_3000_raise_comma" /> - <keyword name="python_3000_raise_comma" id="python_3000_raise_comma" ref="eric5.UtilitiesPython2.pep8.html#python_3000_raise_comma" /> <keyword name="question" id="question" ref="eric5.E5Gui.E5MessageBox.html#question" /> <keyword name="queues (Module)" id="queues (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.QueuesExtension.queues.html" /> <keyword name="rbclbr (Module)" id="rbclbr (Module)" ref="eric5.Utilities.ClassBrowsers.rbclbr.html" /> @@ -12746,9 +12699,7 @@ <keyword name="readline" id="readline" ref="eric5.DebugClients.Ruby.AsyncFile.html#readline" /> <keyword name="readlines" id="readlines" ref="eric5.DebugClients.Ruby.AsyncFile.html#readlines" /> <keyword name="readlines" id="readlines" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#readlines" /> - <keyword name="readlines" id="readlines" ref="eric5.UtilitiesPython2.pep8.html#readlines" /> <keyword name="readlines_1" id="readlines_1" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#readlines_1" /> - <keyword name="readlines_1" id="readlines_1" ref="eric5.UtilitiesPython2.pep8.html#readlines_1" /> <keyword name="readmodule" id="readmodule" ref="eric5.Utilities.ClassBrowsers.__init__.html#readmodule" /> <keyword name="readmodule_ex" id="readmodule_ex" ref="eric5.Utilities.ClassBrowsers.idlclbr.html#readmodule_ex" /> <keyword name="readmodule_ex" id="readmodule_ex" ref="eric5.Utilities.ClassBrowsers.pyclbr.html#readmodule_ex" /> @@ -12764,10 +12715,8 @@ <keyword name="resetParsedModule" id="resetParsedModule" ref="eric5.Utilities.ModuleParser.html#resetParsedModule" /> <keyword name="resetParsedModules" id="resetParsedModules" ref="eric5.Utilities.ModuleParser.html#resetParsedModules" /> <keyword name="reset_counters" id="reset_counters" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#reset_counters" /> - <keyword name="reset_counters" id="reset_counters" ref="eric5.UtilitiesPython2.pep8.html#reset_counters" /> <keyword name="retryAbort" id="retryAbort" ref="eric5.E5Gui.E5MessageBox.html#retryAbort" /> <keyword name="run_tests" id="run_tests" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#run_tests" /> - <keyword name="run_tests" id="run_tests" ref="eric5.UtilitiesPython2.pep8.html#run_tests" /> <keyword name="runcall" id="runcall" ref="eric5.DebugClients.Python.eric5dbgstub.html#runcall" /> <keyword name="runcall" id="runcall" ref="eric5.DebugClients.Python3.eric5dbgstub.html#runcall" /> <keyword name="samefilepath" id="samefilepath" ref="eric5.Utilities.__init__.html#samefilepath" /> @@ -12779,7 +12728,6 @@ <keyword name="schemeFromProxyType" id="schemeFromProxyType" ref="eric5.E5Network.E5NetworkProxyFactory.html#schemeFromProxyType" /> <keyword name="seek" id="seek" ref="eric5.DebugClients.Ruby.AsyncFile.html#seek" /> <keyword name="selftest" id="selftest" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#selftest" /> - <keyword name="selftest" id="selftest" ref="eric5.UtilitiesPython2.pep8.html#selftest" /> <keyword name="setActions" id="setActions" ref="eric5.Preferences.Shortcuts.html#setActions" /> <keyword name="setConfigDir" id="setConfigDir" ref="eric5.Globals.__init__.html#setConfigDir" /> <keyword name="setCooperation" id="setCooperation" ref="eric5.Preferences.__init__.html#setCooperation" /> @@ -12839,9 +12787,7 @@ <keyword name="summarize" id="summarize" ref="eric5.DataViews.CodeMetrics.html#summarize" /> <keyword name="syncPreferences" id="syncPreferences" ref="eric5.Preferences.__init__.html#syncPreferences" /> <keyword name="tabs_obsolete" id="tabs_obsolete" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#tabs_obsolete" /> - <keyword name="tabs_obsolete" id="tabs_obsolete" ref="eric5.UtilitiesPython2.pep8.html#tabs_obsolete" /> <keyword name="tabs_or_spaces" id="tabs_or_spaces" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#tabs_or_spaces" /> - <keyword name="tabs_or_spaces" id="tabs_or_spaces" ref="eric5.UtilitiesPython2.pep8.html#tabs_or_spaces" /> <keyword name="tell" id="tell" ref="eric5.DebugClients.Ruby.AsyncFile.html#tell" /> <keyword name="thread_list" id="thread_list" ref="eric5.DebugClients.Ruby.Debuggee.html#thread_list" /> <keyword name="thread_list_all" id="thread_list_all" ref="eric5.DebugClients.Ruby.Debuggee.html#thread_list_all" /> @@ -12855,9 +12801,7 @@ <keyword name="toSecondLevelDomain" id="toSecondLevelDomain" ref="eric5.Helpviewer.AdBlock.AdBlockRule.html#toSecondLevelDomain" /> <keyword name="traceRuby?" id="traceRuby?" ref="eric5.DebugClients.Ruby.Debuggee.html#traceRuby?" /> <keyword name="trailing_blank_lines" id="trailing_blank_lines" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#trailing_blank_lines" /> - <keyword name="trailing_blank_lines" id="trailing_blank_lines" ref="eric5.UtilitiesPython2.pep8.html#trailing_blank_lines" /> <keyword name="trailing_whitespace" id="trailing_whitespace" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#trailing_whitespace" /> - <keyword name="trailing_whitespace" id="trailing_whitespace" ref="eric5.UtilitiesPython2.pep8.html#trailing_whitespace" /> <keyword name="transplant (Module)" id="transplant (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.TransplantExtension.transplant.html" /> <keyword name="uiStartUp" id="uiStartUp" ref="eric5.eric5.html#uiStartUp" /> <keyword name="uic (Module)" id="uic (Module)" ref="eric5.Utilities.uic.html" /> @@ -12885,15 +12829,10 @@ <keyword name="version" id="version" ref="eric5.eric5_doc.html#version" /> <keyword name="warning" id="warning" ref="eric5.E5Gui.E5MessageBox.html#warning" /> <keyword name="whitespace_around_comma" id="whitespace_around_comma" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#whitespace_around_comma" /> - <keyword name="whitespace_around_comma" id="whitespace_around_comma" ref="eric5.UtilitiesPython2.pep8.html#whitespace_around_comma" /> <keyword name="whitespace_around_named_parameter_equals" id="whitespace_around_named_parameter_equals" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#whitespace_around_named_parameter_equals" /> - <keyword name="whitespace_around_named_parameter_equals" id="whitespace_around_named_parameter_equals" ref="eric5.UtilitiesPython2.pep8.html#whitespace_around_named_parameter_equals" /> <keyword name="whitespace_around_operator" id="whitespace_around_operator" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#whitespace_around_operator" /> - <keyword name="whitespace_around_operator" id="whitespace_around_operator" ref="eric5.UtilitiesPython2.pep8.html#whitespace_around_operator" /> <keyword name="whitespace_before_inline_comment" id="whitespace_before_inline_comment" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#whitespace_before_inline_comment" /> - <keyword name="whitespace_before_inline_comment" id="whitespace_before_inline_comment" ref="eric5.UtilitiesPython2.pep8.html#whitespace_before_inline_comment" /> <keyword name="whitespace_before_parameters" id="whitespace_before_parameters" ref="eric5.Plugins.CheckerPlugins.Pep8.pep8.html#whitespace_before_parameters" /> - <keyword name="whitespace_before_parameters" id="whitespace_before_parameters" ref="eric5.UtilitiesPython2.pep8.html#whitespace_before_parameters" /> <keyword name="wildcardMatch" id="wildcardMatch" ref="eric5.Helpviewer.GreaseMonkey.GreaseMonkeyUrlMatcher.html#wildcardMatch" /> <keyword name="win32_GetUserName" id="win32_GetUserName" ref="eric5.Utilities.__init__.html#win32_GetUserName" /> <keyword name="win32_Kill" id="win32_Kill" ref="eric5.Utilities.__init__.html#win32_Kill" /> @@ -13231,7 +13170,6 @@ <file>eric5.IconEditor.IconEditorPalette.html</file> <file>eric5.IconEditor.IconEditorWindow.html</file> <file>eric5.IconEditor.IconSizeDialog.html</file> - <file>eric5.IconEditor.cursors.cursors_rc.html</file> <file>eric5.MultiProject.AddProjectDialog.html</file> <file>eric5.MultiProject.MultiProject.html</file> <file>eric5.MultiProject.MultiProjectBrowser.html</file> @@ -13654,15 +13592,10 @@ <file>eric5.Utilities.py3flakes.checker.html</file> <file>eric5.Utilities.py3flakes.messages.html</file> <file>eric5.Utilities.uic.html</file> - <file>eric5.UtilitiesPython2.Pep8Checker.html</file> - <file>eric5.UtilitiesPython2.Py2SyntaxChecker.html</file> <file>eric5.UtilitiesPython2.PySideImporter.html</file> <file>eric5.UtilitiesPython2.Tabnanny.html</file> <file>eric5.UtilitiesPython2.TabnannyChecker.html</file> <file>eric5.UtilitiesPython2.Tools.html</file> - <file>eric5.UtilitiesPython2.pep8.html</file> - <file>eric5.UtilitiesPython2.py2flakes.checker.html</file> - <file>eric5.UtilitiesPython2.py2flakes.messages.html</file> <file>eric5.VCS.CommandOptionsDialog.html</file> <file>eric5.VCS.ProjectBrowserHelper.html</file> <file>eric5.VCS.ProjectHelper.html</file> @@ -13799,7 +13732,6 @@ <file>index-eric5.Utilities.py2flakes.html</file> <file>index-eric5.Utilities.py3flakes.html</file> <file>index-eric5.UtilitiesPython2.html</file> - <file>index-eric5.UtilitiesPython2.py2flakes.html</file> <file>index-eric5.VCS.html</file> <file>index-eric5.ViewManager.html</file> <file>index-eric5.html</file>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html Sat Apr 20 20:29:37 2013 +0200 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.Pep8Dialog.html Sun Apr 21 20:30:56 2013 +0200 @@ -63,6 +63,9 @@ <td><a href="#Pep8Dialog.__clearErrors">__clearErrors</a></td> <td>Private method to clear all warning markers of open editors.</td> </tr><tr> +<td><a href="#Pep8Dialog.__createErrorItem">__createErrorItem</a></td> +<td>Private method to create an entry in the result list.</td> +</tr><tr> <td><a href="#Pep8Dialog.__createResultItem">__createResultItem</a></td> <td>Private method to create an entry in the result list.</td> </tr><tr> @@ -134,7 +137,29 @@ <b>__clearErrors</b>(<i></i>) <p> Private method to clear all warning markers of open editors. -</p><a NAME="Pep8Dialog.__createResultItem" ID="Pep8Dialog.__createResultItem"></a> +</p><a NAME="Pep8Dialog.__createErrorItem" ID="Pep8Dialog.__createErrorItem"></a> +<h4>Pep8Dialog.__createErrorItem</h4> +<b>__createErrorItem</b>(<i>file, line, pos, message</i>) +<p> + Private method to create an entry in the result list. +</p><dl> +<dt><i>file</i></dt> +<dd> +file name of the file (string) +</dd><dt><i>line</i></dt> +<dd> +line number of issue (integer or string) +</dd><dt><i>pos</i></dt> +<dd> +character position of issue (integer or string) +</dd><dt><i>message</i></dt> +<dd> +message text (string) +</dd><dt><i>fixed</i></dt> +<dd> +flag indicating a fixed issue (boolean) +</dd> +</dl><a NAME="Pep8Dialog.__createResultItem" ID="Pep8Dialog.__createResultItem"></a> <h4>Pep8Dialog.__createResultItem</h4> <b>__createResultItem</b>(<i>file, line, pos, message, fixed</i>) <p>
--- a/Documentation/Source/eric5.Preferences.__init__.html Sat Apr 20 20:29:37 2013 +0200 +++ b/Documentation/Source/eric5.Preferences.__init__.html Sun Apr 21 20:30:56 2013 +0200 @@ -351,7 +351,7 @@ object <h3>Class Attributes</h3> <table> -<tr><td>cooperationDefaults</td></tr><tr><td>corbaDefaults</td></tr><tr><td>debuggerDefaults</td></tr><tr><td>editorColourDefaults</td></tr><tr><td>editorDefaults</td></tr><tr><td>editorExporterDefaults</td></tr><tr><td>editorOtherFontsDefaults</td></tr><tr><td>editorTypingDefaults</td></tr><tr><td>geometryDefaults</td></tr><tr><td>graphicsDefaults</td></tr><tr><td>helpDefaults</td></tr><tr><td>iconEditorDefaults</td></tr><tr><td>iconsDefaults</td></tr><tr><td>ircDefaults</td></tr><tr><td>multiProjectDefaults</td></tr><tr><td>pluginManagerDefaults</td></tr><tr><td>printerDefaults</td></tr><tr><td>projectBrowserColourDefaults</td></tr><tr><td>projectBrowserFlagsDefaults</td></tr><tr><td>projectDefaults</td></tr><tr><td>py3flakesDefaults</td></tr><tr><td>qtDefaults</td></tr><tr><td>resetLayout</td></tr><tr><td>shellDefaults</td></tr><tr><td>sysDefaults</td></tr><tr><td>tasksDefaults</td></tr><tr><td>templatesDefaults</td></tr><tr><td>trayStarterDefaults</td></tr><tr><td>uiDefaults</td></tr><tr><td>userDefaults</td></tr><tr><td>varDefaults</td></tr><tr><td>vcsDefaults</td></tr><tr><td>viewProfilesLength</td></tr><tr><td>webSettingsIntitialized</td></tr> +<tr><td>cooperationDefaults</td></tr><tr><td>corbaDefaults</td></tr><tr><td>debuggerDefaults</td></tr><tr><td>editorColourDefaults</td></tr><tr><td>editorDefaults</td></tr><tr><td>editorExporterDefaults</td></tr><tr><td>editorOtherFontsDefaults</td></tr><tr><td>editorTypingDefaults</td></tr><tr><td>geometryDefaults</td></tr><tr><td>graphicsDefaults</td></tr><tr><td>helpDefaults</td></tr><tr><td>iconEditorDefaults</td></tr><tr><td>iconsDefaults</td></tr><tr><td>ircDefaults</td></tr><tr><td>multiProjectDefaults</td></tr><tr><td>pluginManagerDefaults</td></tr><tr><td>printerDefaults</td></tr><tr><td>projectBrowserColourDefaults</td></tr><tr><td>projectBrowserFlagsDefaults</td></tr><tr><td>projectDefaults</td></tr><tr><td>py3flakesDefaults</td></tr><tr><td>qtDefaults</td></tr><tr><td>resetLayout</td></tr><tr><td>shellDefaults</td></tr><tr><td>sysDefaults</td></tr><tr><td>tasksDefaults</td></tr><tr><td>templatesDefaults</td></tr><tr><td>trayStarterDefaults</td></tr><tr><td>uiDefaults</td></tr><tr><td>userDefaults</td></tr><tr><td>varDefaults</td></tr><tr><td>vcsDefaults</td></tr><tr><td>webSettingsIntitialized</td></tr> </table> <h3>Class Methods</h3> <table>
--- a/Documentation/Source/eric5.UtilitiesPython2.Pep8Checker.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.Pep8Checker</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.UtilitiesPython2.Pep8Checker</h1> -<p> -Class implementing the PEP 8 checker for Python2. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#Pep8Checker">Pep8Checker</a></td> -<td>Class implementing the PEP 8 checker for Python2.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="Pep8Checker" ID="Pep8Checker"></a> -<h2>Pep8Checker</h2> -<p> - Class implementing the PEP 8 checker for Python2. -</p> -<h3>Derived from</h3> -pep8.Checker -<h3>Class Attributes</h3> -<table> -<tr><td>filename</td></tr><tr><td>ignore</td></tr><tr><td>repeat</td></tr><tr><td>select</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Pep8Checker.__init__">Pep8Checker</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Pep8Checker.__ignore_code">__ignore_code</a></td> -<td>Private method to check, if the message for the given code should be ignored.</td> -</tr><tr> -<td><a href="#Pep8Checker.report_error_args">report_error_args</a></td> -<td>Public method to collect the error messages.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Pep8Checker.__init__" ID="Pep8Checker.__init__"></a> -<h4>Pep8Checker (Constructor)</h4> -<b>Pep8Checker</b>(<i>filename, lines, repeat=False, select="", ignore=""</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file to check (string) -</dd><dt><i>lines</i></dt> -<dd> -source of the file (list of strings) -</dd><dt><i>repeat=</i></dt> -<dd> -flag indicating to repeat message categories (boolean) -</dd><dt><i>select=</i></dt> -<dd> -list of message IDs to check for - (comma separated string) -</dd><dt><i>ignore=</i></dt> -<dd> -list of message IDs to ignore - (comma separated string) -</dd> -</dl><a NAME="Pep8Checker.__ignore_code" ID="Pep8Checker.__ignore_code"></a> -<h4>Pep8Checker.__ignore_code</h4> -<b>__ignore_code</b>(<i>code</i>) -<p> - Private method to check, if the message for the given code should - be ignored. -</p><p> - If codes are selected and the code has a selected prefix and does not - have an ignored prefix, it is not ignored. If codes are selected and - the code does not have a selected prefix, it is ignored. If no codes - are selected, the code is ignored, if it has a prefix, that is - contained in the ignored codes. -</p><dl> -<dt><i>code</i></dt> -<dd> -code to be checked (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating, that the code should be ignored (boolean) -</dd> -</dl><a NAME="Pep8Checker.report_error_args" ID="Pep8Checker.report_error_args"></a> -<h4>Pep8Checker.report_error_args</h4> -<b>report_error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> - Public method to collect the error messages. -</p><dl> -<dt><i>line_number</i></dt> -<dd> -line number of the issue (integer) -</dd><dt><i>offset</i></dt> -<dd> -position within line of the issue (integer) -</dd><dt><i>code</i></dt> -<dd> -message code (string) -</dd><dt><i>check</i></dt> -<dd> -reference to the checker function (function) -</dd><dt><i>args</i></dt> -<dd> -arguments for the message (list) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.UtilitiesPython2.Py2SyntaxChecker.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.Py2SyntaxChecker</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.UtilitiesPython2.Py2SyntaxChecker</h1> -<p> -Module implementing the syntax check for Python 2. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#compile">compile</a></td> -<td>Function to compile one Python source file to Python bytecode.</td> -</tr><tr> -<td><a href="#flakesCheck">flakesCheck</a></td> -<td>Function to perform a pyflakes check.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="compile" ID="compile"></a> -<h2>compile</h2> -<b>compile</b>(<i>file, codestring</i>) -<p> - Function to compile one Python source file to Python bytecode. -</p><dl> -<dt><i>file</i></dt> -<dd> -source filename (string) -</dd><dt><i>codestring</i></dt> -<dd> -source code (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -A tuple indicating status (True = an error was found), the - file name, the line number, the index number, the code string - and the error message (boolean, string, string, string, string, - string). The values are only valid, if the status equals 1. -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="flakesCheck" ID="flakesCheck"></a> -<h2>flakesCheck</h2> -<b>flakesCheck</b>(<i>fileName, codestring, ignoreStarImportWarnings</i>) -<p> - Function to perform a pyflakes check. -</p><dl> -<dt><i>fileName</i></dt> -<dd> -name of the file (string) -</dd><dt><i>codestring</i></dt> -<dd> -source code to be checked (string) -</dd><dt><i>ignoreStarImportWarnings</i></dt> -<dd> -flag indicating to - ignore 'star import' warnings (boolean) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of strings containing the warnings - (marker, file name, line number, message) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.UtilitiesPython2.pep8.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,736 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.pep8</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.UtilitiesPython2.pep8</h1> - -<h3>Global Attributes</h3> -<table> -<tr><td>BENCHMARK_KEYS</td></tr><tr><td>BINARY_OPERATORS</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>E225NOT_KEYWORDS</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATORS</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>SELFTEST_REGEX</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AROUND_NAMED_PARAMETER_REGEX</td></tr><tr><td>WHITESPACE_AROUND_OPERATOR_REGEX</td></tr><tr><td>__version__</td></tr><tr><td>args</td></tr><tr><td>options</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#Checker">Checker</a></td> -<td>Load a Python source file, tokenize it, check coding style.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#_main">_main</a></td> -<td>Parse options and run checks on Python source.</td> -</tr><tr> -<td><a href="#blank_lines">blank_lines</a></td> -<td></td> -</tr><tr> -<td><a href="#compound_statements">compound_statements</a></td> -<td></td> -</tr><tr> -<td><a href="#excluded">excluded</a></td> -<td>Check if options.exclude contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#expand_indent">expand_indent</a></td> -<td>Return the amount of indentation.</td> -</tr><tr> -<td><a href="#extraneous_whitespace">extraneous_whitespace</a></td> -<td>Avoid extraneous whitespace in the following situations:</td> -</tr><tr> -<td><a href="#filename_match">filename_match</a></td> -<td>Check if options.filename contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#find_checks">find_checks</a></td> -<td>Find all globally visible functions where the first argument name starts with argument_name.</td> -</tr><tr> -<td><a href="#get_count">get_count</a></td> -<td>Return the total count of errors and warnings.</td> -</tr><tr> -<td><a href="#get_error_statistics">get_error_statistics</a></td> -<td>Get error statistics.</td> -</tr><tr> -<td><a href="#get_statistics">get_statistics</a></td> -<td>Get statistics for message codes that start with the prefix.</td> -</tr><tr> -<td><a href="#get_warning_statistics">get_warning_statistics</a></td> -<td>Get warning statistics.</td> -</tr><tr> -<td><a href="#ignore_code">ignore_code</a></td> -<td>Check if options.ignore contains a prefix of the error code.</td> -</tr><tr> -<td><a href="#imports_on_separate_lines">imports_on_separate_lines</a></td> -<td></td> -</tr><tr> -<td><a href="#indentation">indentation</a></td> -<td></td> -</tr><tr> -<td><a href="#input_dir">input_dir</a></td> -<td>Check all Python source files in this directory and all subdirectories.</td> -</tr><tr> -<td><a href="#input_file">input_file</a></td> -<td>Run all checks on a Python source file.</td> -</tr><tr> -<td><a href="#maximum_line_length">maximum_line_length</a></td> -<td>Limit all lines to a maximum of 79 characters.</td> -</tr><tr> -<td><a href="#message">message</a></td> -<td>Print a message.</td> -</tr><tr> -<td><a href="#missing_newline">missing_newline</a></td> -<td>JCR: The last line should have a newline.</td> -</tr><tr> -<td><a href="#missing_whitespace">missing_whitespace</a></td> -<td>JCR: Each comma, semicolon or colon should be followed by whitespace.</td> -</tr><tr> -<td><a href="#missing_whitespace_around_operator">missing_whitespace_around_operator</a></td> -<td></td> -</tr><tr> -<td><a href="#mute_string">mute_string</a></td> -<td>Replace contents with 'xxx' to prevent syntax matching.</td> -</tr><tr> -<td><a href="#print_benchmark">print_benchmark</a></td> -<td>Print benchmark numbers.</td> -</tr><tr> -<td><a href="#print_statistics">print_statistics</a></td> -<td>Print overall statistics (number of errors and warnings).</td> -</tr><tr> -<td><a href="#process_options">process_options</a></td> -<td>Process options passed either via arglist or via command line args.</td> -</tr><tr> -<td><a href="#python_3000_backticks">python_3000_backticks</a></td> -<td>Backticks are removed in Python 3000.</td> -</tr><tr> -<td><a href="#python_3000_has_key">python_3000_has_key</a></td> -<td>The {}.has_key() method will be removed in the future version of Python.</td> -</tr><tr> -<td><a href="#python_3000_not_equal">python_3000_not_equal</a></td> -<td>!= can also be written <>, but this is an obsolete usage kept for backwards compatibility only.</td> -</tr><tr> -<td><a href="#python_3000_raise_comma">python_3000_raise_comma</a></td> -<td>When raising an exception, use "raise ValueError('message')" instead of the older form "raise ValueError, 'message'".</td> -</tr><tr> -<td><a href="#readlines">readlines</a></td> -<td></td> -</tr><tr> -<td><a href="#readlines_1">readlines</a></td> -<td></td> -</tr><tr> -<td><a href="#reset_counters">reset_counters</a></td> -<td></td> -</tr><tr> -<td><a href="#run_tests">run_tests</a></td> -<td>Run all the tests from a file.</td> -</tr><tr> -<td><a href="#selftest">selftest</a></td> -<td>Test all check functions with test cases in docstrings.</td> -</tr><tr> -<td><a href="#tabs_obsolete">tabs_obsolete</a></td> -<td></td> -</tr><tr> -<td><a href="#tabs_or_spaces">tabs_or_spaces</a></td> -<td></td> -</tr><tr> -<td><a href="#trailing_blank_lines">trailing_blank_lines</a></td> -<td></td> -</tr><tr> -<td><a href="#trailing_whitespace">trailing_whitespace</a></td> -<td></td> -</tr><tr> -<td><a href="#whitespace_around_comma">whitespace_around_comma</a></td> -<td>Avoid extraneous whitespace in the following situations:</td> -</tr><tr> -<td><a href="#whitespace_around_named_parameter_equals">whitespace_around_named_parameter_equals</a></td> -<td>Don't use spaces around the '=' sign when used to indicate a keyword argument or a default parameter value.</td> -</tr><tr> -<td><a href="#whitespace_around_operator">whitespace_around_operator</a></td> -<td>Avoid extraneous whitespace in the following situations:</td> -</tr><tr> -<td><a href="#whitespace_before_inline_comment">whitespace_before_inline_comment</a></td> -<td>Separate inline comments by at least two spaces.</td> -</tr><tr> -<td><a href="#whitespace_before_parameters">whitespace_before_parameters</a></td> -<td>Avoid extraneous whitespace in the following situations:</td> -</tr> -</table> -<hr /><hr /> -<a NAME="Checker" ID="Checker"></a> -<h2>Checker</h2> -<p> - Load a Python source file, tokenize it, check coding style. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Checker.__init__">Checker</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.build_tokens_line">build_tokens_line</a></td> -<td>Build a logical line from tokens.</td> -</tr><tr> -<td><a href="#Checker.check_all">check_all</a></td> -<td>Run all checks on the input file.</td> -</tr><tr> -<td><a href="#Checker.check_logical">check_logical</a></td> -<td>Build a line from tokens and run all logical checks on it.</td> -</tr><tr> -<td><a href="#Checker.check_physical">check_physical</a></td> -<td>Run all physical checks on a raw input line.</td> -</tr><tr> -<td><a href="#Checker.readline">readline</a></td> -<td>Get the next line from the input buffer.</td> -</tr><tr> -<td><a href="#Checker.readline_check_physical">readline_check_physical</a></td> -<td>Check and return the next physical line.</td> -</tr><tr> -<td><a href="#Checker.report_error">report_error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#Checker.run_check">run_check</a></td> -<td>Run a check plugin.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Checker.__init__" ID="Checker.__init__"></a> -<h4>Checker (Constructor)</h4> -<b>Checker</b>(<i>filename, lines=None</i>) -<a NAME="Checker.build_tokens_line" ID="Checker.build_tokens_line"></a> -<h4>Checker.build_tokens_line</h4> -<b>build_tokens_line</b>(<i></i>) -<p> - Build a logical line from tokens. -</p><a NAME="Checker.check_all" ID="Checker.check_all"></a> -<h4>Checker.check_all</h4> -<b>check_all</b>(<i>expected=None, line_offset=0</i>) -<p> - Run all checks on the input file. -</p><a NAME="Checker.check_logical" ID="Checker.check_logical"></a> -<h4>Checker.check_logical</h4> -<b>check_logical</b>(<i></i>) -<p> - Build a line from tokens and run all logical checks on it. -</p><a NAME="Checker.check_physical" ID="Checker.check_physical"></a> -<h4>Checker.check_physical</h4> -<b>check_physical</b>(<i>line</i>) -<p> - Run all physical checks on a raw input line. -</p><a NAME="Checker.readline" ID="Checker.readline"></a> -<h4>Checker.readline</h4> -<b>readline</b>(<i></i>) -<p> - Get the next line from the input buffer. -</p><a NAME="Checker.readline_check_physical" ID="Checker.readline_check_physical"></a> -<h4>Checker.readline_check_physical</h4> -<b>readline_check_physical</b>(<i></i>) -<p> - Check and return the next physical line. This method can be - used to feed tokenize.generate_tokens. -</p><a NAME="Checker.report_error" ID="Checker.report_error"></a> -<h4>Checker.report_error</h4> -<b>report_error</b>(<i>line_number, offset, text, check</i>) -<p> - Report an error, according to options. -</p><a NAME="Checker.run_check" ID="Checker.run_check"></a> -<h4>Checker.run_check</h4> -<b>run_check</b>(<i>check, argument_names</i>) -<p> - Run a check plugin. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="_main" ID="_main"></a> -<h2>_main</h2> -<b>_main</b>(<i></i>) -<p> - Parse options and run checks on Python source. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="blank_lines" ID="blank_lines"></a> -<h2>blank_lines</h2> -<b>blank_lines</b>(<i>logical_line, blank_lines, indent_level, line_number, previous_logical, previous_indent_level, blank_lines_before_comment</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="compound_statements" ID="compound_statements"></a> -<h2>compound_statements</h2> -<b>compound_statements</b>(<i>logical_line</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="excluded" ID="excluded"></a> -<h2>excluded</h2> -<b>excluded</b>(<i>filename</i>) -<p> - Check if options.exclude contains a pattern that matches filename. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="expand_indent" ID="expand_indent"></a> -<h2>expand_indent</h2> -<b>expand_indent</b>(<i>line</i>) -<p> - Return the amount of indentation. - Tabs are expanded to the next multiple of 8. -</p><p> - >>> expand_indent(' ') - 4 - >>> expand_indent('\\t') - 8 - >>> expand_indent(' \\t') - 8 - >>> expand_indent(' \\t') - 8 - >>> expand_indent(' \\t') - 16 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="extraneous_whitespace" ID="extraneous_whitespace"></a> -<h2>extraneous_whitespace</h2> -<b>extraneous_whitespace</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace in the following situations: -</p><p> - - Immediately inside parentheses, brackets or braces. -</p><p> - - Immediately before a comma, semicolon, or colon. -</p><p> - Okay: spam(ham[1], {eggs: 2}) - E201: spam( ham[1], {eggs: 2}) - E201: spam(ham[ 1], {eggs: 2}) - E201: spam(ham[1], { eggs: 2}) - E202: spam(ham[1], {eggs: 2} ) - E202: spam(ham[1 ], {eggs: 2}) - E202: spam(ham[1], {eggs: 2 }) -</p><p> - E203: if x == 4: print x, y; x, y = y , x - E203: if x == 4: print x, y ; x, y = y, x - E203: if x == 4 : print x, y; x, y = y, x -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="filename_match" ID="filename_match"></a> -<h2>filename_match</h2> -<b>filename_match</b>(<i>filename</i>) -<p> - Check if options.filename contains a pattern that matches filename. - If options.filename is unspecified, this always returns True. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="find_checks" ID="find_checks"></a> -<h2>find_checks</h2> -<b>find_checks</b>(<i>argument_name</i>) -<p> - Find all globally visible functions where the first argument name - starts with argument_name. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_count" ID="get_count"></a> -<h2>get_count</h2> -<b>get_count</b>(<i>prefix=''</i>) -<p> -Return the total count of errors and warnings. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_error_statistics" ID="get_error_statistics"></a> -<h2>get_error_statistics</h2> -<b>get_error_statistics</b>(<i></i>) -<p> -Get error statistics. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_statistics" ID="get_statistics"></a> -<h2>get_statistics</h2> -<b>get_statistics</b>(<i>prefix=''</i>) -<p> - Get statistics for message codes that start with the prefix. -</p><p> - prefix='' matches all errors and warnings - prefix='E' matches all errors - prefix='W' matches all warnings - prefix='E4' matches all errors that have to do with imports -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_warning_statistics" ID="get_warning_statistics"></a> -<h2>get_warning_statistics</h2> -<b>get_warning_statistics</b>(<i></i>) -<p> -Get warning statistics. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ignore_code" ID="ignore_code"></a> -<h2>ignore_code</h2> -<b>ignore_code</b>(<i>code</i>) -<p> - Check if options.ignore contains a prefix of the error code. - If options.select contains a prefix of the error code, do not ignore it. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="imports_on_separate_lines" ID="imports_on_separate_lines"></a> -<h2>imports_on_separate_lines</h2> -<b>imports_on_separate_lines</b>(<i>logical_line</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="indentation" ID="indentation"></a> -<h2>indentation</h2> -<b>indentation</b>(<i>logical_line, previous_logical, indent_char, indent_level, previous_indent_level</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="input_dir" ID="input_dir"></a> -<h2>input_dir</h2> -<b>input_dir</b>(<i>dirname, runner=None</i>) -<p> - Check all Python source files in this directory and all subdirectories. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="input_file" ID="input_file"></a> -<h2>input_file</h2> -<b>input_file</b>(<i>filename</i>) -<p> - Run all checks on a Python source file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="maximum_line_length" ID="maximum_line_length"></a> -<h2>maximum_line_length</h2> -<b>maximum_line_length</b>(<i>physical_line</i>) -<p> - Limit all lines to a maximum of 79 characters. -</p><p> - There are still many devices around that are limited to 80 character - lines; plus, limiting windows to 80 characters makes it possible to have - several windows side-by-side. The default wrapping on such devices looks - ugly. Therefore, please limit all lines to a maximum of 79 characters. - For flowing long blocks of text (docstrings or comments), limiting the - length to 72 characters is recommended. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="message" ID="message"></a> -<h2>message</h2> -<b>message</b>(<i>text</i>) -<p> -Print a message. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="missing_newline" ID="missing_newline"></a> -<h2>missing_newline</h2> -<b>missing_newline</b>(<i>physical_line</i>) -<p> - JCR: The last line should have a newline. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="missing_whitespace" ID="missing_whitespace"></a> -<h2>missing_whitespace</h2> -<b>missing_whitespace</b>(<i>logical_line</i>) -<p> - JCR: Each comma, semicolon or colon should be followed by whitespace. -</p><p> - Okay: [a, b] - Okay: (3,) - Okay: a[1:4] - Okay: a[:4] - Okay: a[1:] - Okay: a[1:4:2] - E231: ['a','b'] - E231: foo(bar,baz) -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="missing_whitespace_around_operator" ID="missing_whitespace_around_operator"></a> -<h2>missing_whitespace_around_operator</h2> -<b>missing_whitespace_around_operator</b>(<i>logical_line, tokens</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="mute_string" ID="mute_string"></a> -<h2>mute_string</h2> -<b>mute_string</b>(<i>text</i>) -<p> - Replace contents with 'xxx' to prevent syntax matching. -</p><p> - >>> mute_string('"abc"') - '"xxx"' - >>> mute_string("'''abc'''") - "'''xxx'''" - >>> mute_string("r'abc'") - "r'xxx'" -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="print_benchmark" ID="print_benchmark"></a> -<h2>print_benchmark</h2> -<b>print_benchmark</b>(<i>elapsed</i>) -<p> - Print benchmark numbers. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="print_statistics" ID="print_statistics"></a> -<h2>print_statistics</h2> -<b>print_statistics</b>(<i>prefix=''</i>) -<p> -Print overall statistics (number of errors and warnings). -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="process_options" ID="process_options"></a> -<h2>process_options</h2> -<b>process_options</b>(<i>arglist=None</i>) -<p> - Process options passed either via arglist or via command line args. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="python_3000_backticks" ID="python_3000_backticks"></a> -<h2>python_3000_backticks</h2> -<b>python_3000_backticks</b>(<i>logical_line</i>) -<p> - Backticks are removed in Python 3000. - Use repr() instead. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="python_3000_has_key" ID="python_3000_has_key"></a> -<h2>python_3000_has_key</h2> -<b>python_3000_has_key</b>(<i>logical_line</i>) -<p> - The {}.has_key() method will be removed in the future version of - Python. Use the 'in' operation instead, like: - d = {"a": 1, "b": 2} - if "b" in d: - print d["b"] -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="python_3000_not_equal" ID="python_3000_not_equal"></a> -<h2>python_3000_not_equal</h2> -<b>python_3000_not_equal</b>(<i>logical_line</i>) -<p> - != can also be written <>, but this is an obsolete usage kept for - backwards compatibility only. New code should always use !=. - The older syntax is removed in Python 3000. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="python_3000_raise_comma" ID="python_3000_raise_comma"></a> -<h2>python_3000_raise_comma</h2> -<b>python_3000_raise_comma</b>(<i>logical_line</i>) -<p> - When raising an exception, use "raise ValueError('message')" - instead of the older form "raise ValueError, 'message'". -</p><p> - The paren-using form is preferred because when the exception arguments - are long or include string formatting, you don't need to use line - continuation characters thanks to the containing parentheses. The older - form will be removed in Python 3000. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="readlines" ID="readlines"></a> -<h2>readlines</h2> -<b>readlines</b>(<i>filename</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="readlines_1" ID="readlines_1"></a> -<h2>readlines</h2> -<b>readlines</b>(<i>filename</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="reset_counters" ID="reset_counters"></a> -<h2>reset_counters</h2> -<b>reset_counters</b>(<i></i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="run_tests" ID="run_tests"></a> -<h2>run_tests</h2> -<b>run_tests</b>(<i>filename</i>) -<p> - Run all the tests from a file. -</p><p> - A test file can provide many tests. Each test starts with a declaration. - This declaration is a single line starting with '#:'. - It declares codes of expected failures, separated by spaces or 'Okay' - if no failure is expected. - If the file does not contain such declaration, it should pass all tests. - If the declaration is empty, following lines are not checked, until next - declaration. -</p><p> - Examples: -</p><p> - * Only E224 and W701 are expected: #: E224 W701 - * Following example is conform: #: Okay - * Don't check these lines: #: -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="selftest" ID="selftest"></a> -<h2>selftest</h2> -<b>selftest</b>(<i></i>) -<p> - Test all check functions with test cases in docstrings. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="tabs_obsolete" ID="tabs_obsolete"></a> -<h2>tabs_obsolete</h2> -<b>tabs_obsolete</b>(<i>physical_line</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="tabs_or_spaces" ID="tabs_or_spaces"></a> -<h2>tabs_or_spaces</h2> -<b>tabs_or_spaces</b>(<i>physical_line, indent_char</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="trailing_blank_lines" ID="trailing_blank_lines"></a> -<h2>trailing_blank_lines</h2> -<b>trailing_blank_lines</b>(<i>physical_line, lines, line_number</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="trailing_whitespace" ID="trailing_whitespace"></a> -<h2>trailing_whitespace</h2> -<b>trailing_whitespace</b>(<i>physical_line</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="whitespace_around_comma" ID="whitespace_around_comma"></a> -<h2>whitespace_around_comma</h2> -<b>whitespace_around_comma</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace in the following situations: -</p><p> - - More than one space around an assignment (or other) operator to - align it with another. -</p><p> - JCR: This should also be applied around comma etc. - Note: these checks are disabled by default -</p><p> - Okay: a = (1, 2) - E241: a = (1, 2) - E242: a = (1,\t2) -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="whitespace_around_named_parameter_equals" ID="whitespace_around_named_parameter_equals"></a> -<h2>whitespace_around_named_parameter_equals</h2> -<b>whitespace_around_named_parameter_equals</b>(<i>logical_line</i>) -<p> - Don't use spaces around the '=' sign when used to indicate a - keyword argument or a default parameter value. -</p><p> - Okay: def complex(real, imag=0.0): - Okay: return magic(r=real, i=imag) - Okay: boolean(a == b) - Okay: boolean(a != b) - Okay: boolean(a <= b) - Okay: boolean(a >= b) -</p><p> - E251: def complex(real, imag = 0.0): - E251: return magic(r = real, i = imag) -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="whitespace_around_operator" ID="whitespace_around_operator"></a> -<h2>whitespace_around_operator</h2> -<b>whitespace_around_operator</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace in the following situations: -</p><p> - - More than one space around an assignment (or other) operator to - align it with another. -</p><p> - Okay: a = 12 + 3 - E221: a = 4 + 5 - E222: a = 4 + 5 - E223: a = 4\t+ 5 - E224: a = 4 +\t5 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="whitespace_before_inline_comment" ID="whitespace_before_inline_comment"></a> -<h2>whitespace_before_inline_comment</h2> -<b>whitespace_before_inline_comment</b>(<i>logical_line, tokens</i>) -<p> - Separate inline comments by at least two spaces. -</p><p> - An inline comment is a comment on the same line as a statement. Inline - comments should be separated by at least two spaces from the statement. - They should start with a # and a single space. -</p><p> - Okay: x = x + 1 # Increment x - Okay: x = x + 1 # Increment x - E261: x = x + 1 # Increment x - E262: x = x + 1 #Increment x - E262: x = x + 1 # Increment x -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="whitespace_before_parameters" ID="whitespace_before_parameters"></a> -<h2>whitespace_before_parameters</h2> -<b>whitespace_before_parameters</b>(<i>logical_line, tokens</i>) -<p> - Avoid extraneous whitespace in the following situations: -</p><p> - - Immediately before the open parenthesis that starts the argument - list of a function call. -</p><p> - - Immediately before the open parenthesis that starts an indexing or - slicing. -</p><p> - Okay: spam(1) - E211: spam (1) -</p><p> - Okay: dict['key'] = list[index] - E211: dict ['key'] = list[index] - E211: dict['key'] = list [index] -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.UtilitiesPython2.py2flakes.checker.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,706 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.py2flakes.checker</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.UtilitiesPython2.py2flakes.checker</h1> - -<h3>Global Attributes</h3> -<table> -<tr><td>_MAGIC_GLOBALS</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#Argument">Argument</a></td> -<td>Represents binding a name as an argument.</td> -</tr><tr> -<td><a href="#Assignment">Assignment</a></td> -<td>Represents binding a name with an explicit assignment.</td> -</tr><tr> -<td><a href="#Binding">Binding</a></td> -<td>Represents the binding of a value to a name.</td> -</tr><tr> -<td><a href="#Checker">Checker</a></td> -<td>Class to check the cleanliness and sanity of Python code.</td> -</tr><tr> -<td><a href="#ClassScope">ClassScope</a></td> -<td>Class representing a name scope for a class.</td> -</tr><tr> -<td><a href="#ExportBinding">ExportBinding</a></td> -<td>A binding created by an __all__ assignment.</td> -</tr><tr> -<td><a href="#FunctionDefinition">FunctionDefinition</a></td> -<td>Represents a function definition.</td> -</tr><tr> -<td><a href="#FunctionScope">FunctionScope</a></td> -<td>Class representing a name scope for a function.</td> -</tr><tr> -<td><a href="#Importation">Importation</a></td> -<td>A binding created by an import statement.</td> -</tr><tr> -<td><a href="#ModuleScope">ModuleScope</a></td> -<td>Class representing a name scope for a module.</td> -</tr><tr> -<td><a href="#Scope">Scope</a></td> -<td>Class defining the scope base class.</td> -</tr><tr> -<td><a href="#UnBinding">UnBinding</a></td> -<td>Created by the 'del' operator.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#iter_child_nodes">iter_child_nodes</a></td> -<td>Yield all direct child nodes of *node*, that is, all fields that are nodes and all items of fields that are lists of nodes.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="Argument" ID="Argument"></a> -<h2>Argument</h2> -<p> - Represents binding a name as an argument. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Assignment" ID="Assignment"></a> -<h2>Assignment</h2> -<p> - Represents binding a name with an explicit assignment. -</p><p> - The checker will raise warnings for any Assignment that isn't used. Also, - the checker does not consider assignments in tuple/list unpacking to be - Assignments, rather it treats them as simple Bindings. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Binding" ID="Binding"></a> -<h2>Binding</h2> -<p> - Represents the binding of a value to a name. -</p><p> - The checker uses this to keep track of which names have been bound and - which names have not. See L{Assignment} for a special type of binding that - is checked with stricter rules. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Binding.__init__">Binding</a></td> -<td></td> -</tr><tr> -<td><a href="#Binding.__repr__">__repr__</a></td> -<td></td> -</tr><tr> -<td><a href="#Binding.__str__">__str__</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Binding.__init__" ID="Binding.__init__"></a> -<h4>Binding (Constructor)</h4> -<b>Binding</b>(<i>name, source</i>) -<a NAME="Binding.__repr__" ID="Binding.__repr__"></a> -<h4>Binding.__repr__</h4> -<b>__repr__</b>(<i></i>) -<a NAME="Binding.__str__" ID="Binding.__str__"></a> -<h4>Binding.__str__</h4> -<b>__str__</b>(<i></i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Checker" ID="Checker"></a> -<h2>Checker</h2> -<p> - Class to check the cleanliness and sanity of Python code. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>AND</td></tr><tr><td>BITOR</td></tr><tr><td>BOOLOP</td></tr><tr><td>CALL</td></tr><tr><td>COMPREHENSION</td></tr><tr><td>CONTINUE</td></tr><tr><td>EQ</td></tr><tr><td>GENERATOREXP</td></tr><tr><td>LOAD</td></tr><tr><td>NUM</td></tr><tr><td>RETURN</td></tr><tr><td>SLICE</td></tr><tr><td>nodeDepth</td></tr><tr><td>scope</td></tr><tr><td>traceTree</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Checker.__init__">Checker</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Checker.ASSIGN">ASSIGN</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.AUGASSIGN">AUGASSIGN</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.CLASSDEF">CLASSDEF</a></td> -<td>Check names used in a class definition, including its decorators, base classes, and the body of its definition.</td> -</tr><tr> -<td><a href="#Checker.DICTCOMP">DICTCOMP</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.FOR">FOR</a></td> -<td>Process bindings for loop variables.</td> -</tr><tr> -<td><a href="#Checker.FUNCTIONDEF">FUNCTIONDEF</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.GLOBAL">GLOBAL</a></td> -<td>Keep track of globals declarations.</td> -</tr><tr> -<td><a href="#Checker.IMPORT">IMPORT</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.IMPORTFROM">IMPORTFROM</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.LAMBDA">LAMBDA</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.LISTCOMP">LISTCOMP</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.NAME">NAME</a></td> -<td>Locate the name in locals / function / globals scopes.</td> -</tr><tr> -<td><a href="#Checker._runDeferred">_runDeferred</a></td> -<td>Run the callables in deferred using their associated scope stack.</td> -</tr><tr> -<td><a href="#Checker.addArgs">addArgs</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.addBinding">addBinding</a></td> -<td>Called when a binding is altered.</td> -</tr><tr> -<td><a href="#Checker.checkUnusedAssignments">checkUnusedAssignments</a></td> -<td>Check to see if any assignments have not been used.</td> -</tr><tr> -<td><a href="#Checker.check_dead_scopes">check_dead_scopes</a></td> -<td>Look at scopes which have been fully examined and report names in them which were imported but unused.</td> -</tr><tr> -<td><a href="#Checker.collectLoopVars">collectLoopVars</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.deferAssignment">deferAssignment</a></td> -<td>Schedule an assignment handler to be called just after deferred function handlers.</td> -</tr><tr> -<td><a href="#Checker.deferFunction">deferFunction</a></td> -<td>Schedule a function handler to be called just before completion.</td> -</tr><tr> -<td><a href="#Checker.handleChildren">handleChildren</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.handleNode">handleNode</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.ignore">ignore</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.isDocstring">isDocstring</a></td> -<td>Determine if the given node is a docstring, as long as it is at the correct place in the node tree.</td> -</tr><tr> -<td><a href="#Checker.popScope">popScope</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.pushClassScope">pushClassScope</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.pushFunctionScope">pushFunctionScope</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.report">report</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.runFunction">runFunction</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.scope">scope</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Checker.__init__" ID="Checker.__init__"></a> -<h4>Checker (Constructor)</h4> -<b>Checker</b>(<i>module, filename='(none)'</i>) -<p> - Constructor -</p><dl> -<dt><i>module</i></dt> -<dd> -parsed module tree or module source code -</dd><dt><i>filename</i></dt> -<dd> -name of the module file (string) -</dd> -</dl><a NAME="Checker.ASSIGN" ID="Checker.ASSIGN"></a> -<h4>Checker.ASSIGN</h4> -<b>ASSIGN</b>(<i>node</i>) -<a NAME="Checker.AUGASSIGN" ID="Checker.AUGASSIGN"></a> -<h4>Checker.AUGASSIGN</h4> -<b>AUGASSIGN</b>(<i>node</i>) -<a NAME="Checker.CLASSDEF" ID="Checker.CLASSDEF"></a> -<h4>Checker.CLASSDEF</h4> -<b>CLASSDEF</b>(<i>node</i>) -<p> - Check names used in a class definition, including its decorators, base - classes, and the body of its definition. Additionally, add its name to - the current scope. -</p><a NAME="Checker.DICTCOMP" ID="Checker.DICTCOMP"></a> -<h4>Checker.DICTCOMP</h4> -<b>DICTCOMP</b>(<i>node</i>) -<a NAME="Checker.FOR" ID="Checker.FOR"></a> -<h4>Checker.FOR</h4> -<b>FOR</b>(<i>node</i>) -<p> - Process bindings for loop variables. -</p><a NAME="Checker.FUNCTIONDEF" ID="Checker.FUNCTIONDEF"></a> -<h4>Checker.FUNCTIONDEF</h4> -<b>FUNCTIONDEF</b>(<i>node</i>) -<a NAME="Checker.GLOBAL" ID="Checker.GLOBAL"></a> -<h4>Checker.GLOBAL</h4> -<b>GLOBAL</b>(<i>node</i>) -<p> - Keep track of globals declarations. -</p><a NAME="Checker.IMPORT" ID="Checker.IMPORT"></a> -<h4>Checker.IMPORT</h4> -<b>IMPORT</b>(<i>node</i>) -<a NAME="Checker.IMPORTFROM" ID="Checker.IMPORTFROM"></a> -<h4>Checker.IMPORTFROM</h4> -<b>IMPORTFROM</b>(<i>node</i>) -<a NAME="Checker.LAMBDA" ID="Checker.LAMBDA"></a> -<h4>Checker.LAMBDA</h4> -<b>LAMBDA</b>(<i>node</i>) -<a NAME="Checker.LISTCOMP" ID="Checker.LISTCOMP"></a> -<h4>Checker.LISTCOMP</h4> -<b>LISTCOMP</b>(<i>node</i>) -<a NAME="Checker.NAME" ID="Checker.NAME"></a> -<h4>Checker.NAME</h4> -<b>NAME</b>(<i>node</i>) -<p> - Locate the name in locals / function / globals scopes. -</p><a NAME="Checker._runDeferred" ID="Checker._runDeferred"></a> -<h4>Checker._runDeferred</h4> -<b>_runDeferred</b>(<i>deferred</i>) -<p> - Run the callables in deferred using their associated scope stack. -</p><a NAME="Checker.addArgs" ID="Checker.addArgs"></a> -<h4>Checker.addArgs</h4> -<b>addArgs</b>(<i></i>) -<a NAME="Checker.addBinding" ID="Checker.addBinding"></a> -<h4>Checker.addBinding</h4> -<b>addBinding</b>(<i>lineno, value, reportRedef=True</i>) -<p> - Called when a binding is altered. -</p><dl> -<dt><i>lineno</i></dt> -<dd> -line of the statement responsible for the change (integer) -</dd><dt><i>value</i></dt> -<dd> -the optional new value, a Binding instance, associated - with the binding; if None, the binding is deleted if it exists -</dd><dt><i>reportRedef</i></dt> -<dd> -flag indicating if rebinding while unused will be - reported (boolean) -</dd> -</dl><a NAME="Checker.checkUnusedAssignments" ID="Checker.checkUnusedAssignments"></a> -<h4>Checker.checkUnusedAssignments</h4> -<b>checkUnusedAssignments</b>(<i></i>) -<p> - Check to see if any assignments have not been used. -</p><a NAME="Checker.check_dead_scopes" ID="Checker.check_dead_scopes"></a> -<h4>Checker.check_dead_scopes</h4> -<b>check_dead_scopes</b>(<i></i>) -<p> - Look at scopes which have been fully examined and report names in them - which were imported but unused. -</p><a NAME="Checker.collectLoopVars" ID="Checker.collectLoopVars"></a> -<h4>Checker.collectLoopVars</h4> -<b>collectLoopVars</b>(<i></i>) -<a NAME="Checker.deferAssignment" ID="Checker.deferAssignment"></a> -<h4>Checker.deferAssignment</h4> -<b>deferAssignment</b>(<i>callable</i>) -<p> - Schedule an assignment handler to be called just after deferred - function handlers. -</p><a NAME="Checker.deferFunction" ID="Checker.deferFunction"></a> -<h4>Checker.deferFunction</h4> -<b>deferFunction</b>(<i>callable</i>) -<p> - Schedule a function handler to be called just before completion. -</p><p> - This is used for handling function bodies, which must be deferred - because code later in the file might modify the global scope. When - `callable` is called, the scope at the time this is called will be - restored, however it will contain any new bindings added to it. -</p><a NAME="Checker.handleChildren" ID="Checker.handleChildren"></a> -<h4>Checker.handleChildren</h4> -<b>handleChildren</b>(<i>tree</i>) -<a NAME="Checker.handleNode" ID="Checker.handleNode"></a> -<h4>Checker.handleNode</h4> -<b>handleNode</b>(<i>node, parent</i>) -<a NAME="Checker.ignore" ID="Checker.ignore"></a> -<h4>Checker.ignore</h4> -<b>ignore</b>(<i>node</i>) -<a NAME="Checker.isDocstring" ID="Checker.isDocstring"></a> -<h4>Checker.isDocstring</h4> -<b>isDocstring</b>(<i>node</i>) -<p> - Determine if the given node is a docstring, as long as it is at the - correct place in the node tree. -</p><a NAME="Checker.popScope" ID="Checker.popScope"></a> -<h4>Checker.popScope</h4> -<b>popScope</b>(<i></i>) -<a NAME="Checker.pushClassScope" ID="Checker.pushClassScope"></a> -<h4>Checker.pushClassScope</h4> -<b>pushClassScope</b>(<i></i>) -<a NAME="Checker.pushFunctionScope" ID="Checker.pushFunctionScope"></a> -<h4>Checker.pushFunctionScope</h4> -<b>pushFunctionScope</b>(<i></i>) -<a NAME="Checker.report" ID="Checker.report"></a> -<h4>Checker.report</h4> -<b>report</b>(<i>messageClass, *args, **kwargs</i>) -<a NAME="Checker.runFunction" ID="Checker.runFunction"></a> -<h4>Checker.runFunction</h4> -<b>runFunction</b>(<i></i>) -<a NAME="Checker.scope" ID="Checker.scope"></a> -<h4>Checker.scope</h4> -<b>scope</b>(<i></i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ClassScope" ID="ClassScope"></a> -<h2>ClassScope</h2> -<p> - Class representing a name scope for a class. -</p> -<h3>Derived from</h3> -Scope -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ExportBinding" ID="ExportBinding"></a> -<h2>ExportBinding</h2> -<p> - A binding created by an __all__ assignment. If the names in the list - can be determined statically, they will be treated as names for export and - additional checking applied to them. -</p><p> - The only __all__ assignment that can be recognized is one which takes - the value of a literal list containing literal strings. For example:: -</p><p> - __all__ = ["foo", "bar"] -</p><p> - Names which are imported and not otherwise used but appear in the value of - __all__ will not have an unused import warning reported for them. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#ExportBinding.names">names</a></td> -<td>Return a list of the names referenced by this binding.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="ExportBinding.names" ID="ExportBinding.names"></a> -<h4>ExportBinding.names</h4> -<b>names</b>(<i></i>) -<p> - Return a list of the names referenced by this binding. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="FunctionDefinition" ID="FunctionDefinition"></a> -<h2>FunctionDefinition</h2> -<p> - Represents a function definition. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="FunctionScope" ID="FunctionScope"></a> -<h2>FunctionScope</h2> -<p> - Class representing a name scope for a function. -</p> -<h3>Derived from</h3> -Scope -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#FunctionScope.__init__">FunctionScope</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="FunctionScope.__init__" ID="FunctionScope.__init__"></a> -<h4>FunctionScope (Constructor)</h4> -<b>FunctionScope</b>(<i></i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Importation" ID="Importation"></a> -<h2>Importation</h2> -<p> - A binding created by an import statement. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Importation.__init__">Importation</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Importation.__init__" ID="Importation.__init__"></a> -<h4>Importation (Constructor)</h4> -<b>Importation</b>(<i>name, source</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ModuleScope" ID="ModuleScope"></a> -<h2>ModuleScope</h2> -<p> - Class representing a name scope for a module. -</p> -<h3>Derived from</h3> -Scope -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Scope" ID="Scope"></a> -<h2>Scope</h2> -<p> - Class defining the scope base class. -</p> -<h3>Derived from</h3> -dict -<h3>Class Attributes</h3> -<table> -<tr><td>importStarred</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Scope.__init__">Scope</a></td> -<td></td> -</tr><tr> -<td><a href="#Scope.__repr__">__repr__</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Scope.__init__" ID="Scope.__init__"></a> -<h4>Scope (Constructor)</h4> -<b>Scope</b>(<i></i>) -<a NAME="Scope.__repr__" ID="Scope.__repr__"></a> -<h4>Scope.__repr__</h4> -<b>__repr__</b>(<i></i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UnBinding" ID="UnBinding"></a> -<h2>UnBinding</h2> -<p> - Created by the 'del' operator. -</p> -<h3>Derived from</h3> -Binding -<h3>Class Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="iter_child_nodes" ID="iter_child_nodes"></a> -<h2>iter_child_nodes</h2> -<b>iter_child_nodes</b>(<i>node, astcls=_ast.AST</i>) -<p> - Yield all direct child nodes of *node*, that is, all fields that are nodes - and all items of fields that are lists of nodes. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.UtilitiesPython2.py2flakes.messages.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,652 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.py2flakes.messages</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body><a NAME="top" ID="top"></a> -<h1>eric5.UtilitiesPython2.py2flakes.messages</h1> - -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#DuplicateArgument">DuplicateArgument</a></td> -<td>Class defining the "Duplicate Argument" message.</td> -</tr><tr> -<td><a href="#ImportShadowedByLoopVar">ImportShadowedByLoopVar</a></td> -<td>Class defining the "Import Shadowed By Loop Var" message.</td> -</tr><tr> -<td><a href="#ImportStarUsed">ImportStarUsed</a></td> -<td>Class defining the "Import Star Used" message.</td> -</tr><tr> -<td><a href="#LateFutureImport">LateFutureImport</a></td> -<td>Class defining the "Late Future Import" message.</td> -</tr><tr> -<td><a href="#Message">Message</a></td> -<td>Class defining the base for all specific message classes.</td> -</tr><tr> -<td><a href="#RedefinedFunction">RedefinedFunction</a></td> -<td>Class defining the "Redefined Function" message.</td> -</tr><tr> -<td><a href="#RedefinedWhileUnused">RedefinedWhileUnused</a></td> -<td>Class defining the "Redefined While Unused" message.</td> -</tr><tr> -<td><a href="#UndefinedExport">UndefinedExport</a></td> -<td>Class defining the "Undefined Export" message.</td> -</tr><tr> -<td><a href="#UndefinedLocal">UndefinedLocal</a></td> -<td>Class defining the "Undefined Local Variable" message.</td> -</tr><tr> -<td><a href="#UndefinedName">UndefinedName</a></td> -<td>Class defining the "Undefined Name" message.</td> -</tr><tr> -<td><a href="#UnusedImport">UnusedImport</a></td> -<td>Class defining the "Unused Import" message.</td> -</tr><tr> -<td><a href="#UnusedVariable">UnusedVariable</a></td> -<td>Class defining the "Unused Variable" message.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="DuplicateArgument" ID="DuplicateArgument"></a> -<h2>DuplicateArgument</h2> -<p> - Class defining the "Duplicate Argument" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#DuplicateArgument.__init__">DuplicateArgument</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DuplicateArgument.__init__" ID="DuplicateArgument.__init__"></a> -<h4>DuplicateArgument (Constructor)</h4> -<b>DuplicateArgument</b>(<i>filename, lineno, name</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the duplicate argument (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ImportShadowedByLoopVar" ID="ImportShadowedByLoopVar"></a> -<h2>ImportShadowedByLoopVar</h2> -<p> - Class defining the "Import Shadowed By Loop Var" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#ImportShadowedByLoopVar.__init__">ImportShadowedByLoopVar</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="ImportShadowedByLoopVar.__init__" ID="ImportShadowedByLoopVar.__init__"></a> -<h4>ImportShadowedByLoopVar (Constructor)</h4> -<b>ImportShadowedByLoopVar</b>(<i>filename, lineno, name, orig_lineno</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the shadowed import (string) -</dd><dt><i>orig_lineno</i></dt> -<dd> -line number of the import (integer) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="ImportStarUsed" ID="ImportStarUsed"></a> -<h2>ImportStarUsed</h2> -<p> - Class defining the "Import Star Used" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#ImportStarUsed.__init__">ImportStarUsed</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="ImportStarUsed.__init__" ID="ImportStarUsed.__init__"></a> -<h4>ImportStarUsed (Constructor)</h4> -<b>ImportStarUsed</b>(<i>filename, lineno, modname</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>modname</i></dt> -<dd> -name of the module imported using star import (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="LateFutureImport" ID="LateFutureImport"></a> -<h2>LateFutureImport</h2> -<p> - Class defining the "Late Future Import" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#LateFutureImport.__init__">LateFutureImport</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="LateFutureImport.__init__" ID="LateFutureImport.__init__"></a> -<h4>LateFutureImport (Constructor)</h4> -<b>LateFutureImport</b>(<i>filename, lineno, names</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>names</i></dt> -<dd> -names of the imported futures (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Message" ID="Message"></a> -<h2>Message</h2> -<p> - Class defining the base for all specific message classes. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr><tr><td>message_args</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Message.__init__">Message</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Message.__str__">__str__</a></td> -<td>Special method return a string representation of the instance object.</td> -</tr><tr> -<td><a href="#Message.getMessageData">getMessageData</a></td> -<td>Public method to get the individual message data elements.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Message.__init__" ID="Message.__init__"></a> -<h4>Message (Constructor)</h4> -<b>Message</b>(<i>filename, lineno</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd> -</dl><a NAME="Message.__str__" ID="Message.__str__"></a> -<h4>Message.__str__</h4> -<b>__str__</b>(<i></i>) -<p> - Special method return a string representation of the instance object. -</p><dl> -<dt>Returns:</dt> -<dd> -string representation of the object (string) -</dd> -</dl><a NAME="Message.getMessageData" ID="Message.getMessageData"></a> -<h4>Message.getMessageData</h4> -<b>getMessageData</b>(<i></i>) -<p> - Public method to get the individual message data elements. -</p><dl> -<dt>Returns:</dt> -<dd> -tuple containing file name, line number and message - (string, integer, string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="RedefinedFunction" ID="RedefinedFunction"></a> -<h2>RedefinedFunction</h2> -<p> - Class defining the "Redefined Function" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#RedefinedFunction.__init__">RedefinedFunction</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="RedefinedFunction.__init__" ID="RedefinedFunction.__init__"></a> -<h4>RedefinedFunction (Constructor)</h4> -<b>RedefinedFunction</b>(<i>filename, lineno, name, orig_lineno</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the redefined function (string) -</dd><dt><i>orig_lineno</i></dt> -<dd> -line number of the original definition (integer) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="RedefinedWhileUnused" ID="RedefinedWhileUnused"></a> -<h2>RedefinedWhileUnused</h2> -<p> - Class defining the "Redefined While Unused" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#RedefinedWhileUnused.__init__">RedefinedWhileUnused</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="RedefinedWhileUnused.__init__" ID="RedefinedWhileUnused.__init__"></a> -<h4>RedefinedWhileUnused (Constructor)</h4> -<b>RedefinedWhileUnused</b>(<i>filename, lineno, name, orig_lineno</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the redefined object (string) -</dd><dt><i>orig_lineno</i></dt> -<dd> -line number of the original definition (integer) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UndefinedExport" ID="UndefinedExport"></a> -<h2>UndefinedExport</h2> -<p> - Class defining the "Undefined Export" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#UndefinedExport.__init__">UndefinedExport</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="UndefinedExport.__init__" ID="UndefinedExport.__init__"></a> -<h4>UndefinedExport (Constructor)</h4> -<b>UndefinedExport</b>(<i>filename, lineno, name</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -undefined exported name (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UndefinedLocal" ID="UndefinedLocal"></a> -<h2>UndefinedLocal</h2> -<p> - Class defining the "Undefined Local Variable" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#UndefinedLocal.__init__">UndefinedLocal</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="UndefinedLocal.__init__" ID="UndefinedLocal.__init__"></a> -<h4>UndefinedLocal (Constructor)</h4> -<b>UndefinedLocal</b>(<i>filename, lineno, name, orig_lineno</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the prematurely referenced variable (string) -</dd><dt><i>orig_lineno</i></dt> -<dd> -line number of the variable definition (integer) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UndefinedName" ID="UndefinedName"></a> -<h2>UndefinedName</h2> -<p> - Class defining the "Undefined Name" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#UndefinedName.__init__">UndefinedName</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="UndefinedName.__init__" ID="UndefinedName.__init__"></a> -<h4>UndefinedName (Constructor)</h4> -<b>UndefinedName</b>(<i>filename, lineno, name</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -undefined name (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UnusedImport" ID="UnusedImport"></a> -<h2>UnusedImport</h2> -<p> - Class defining the "Unused Import" message. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#UnusedImport.__init__">UnusedImport</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="UnusedImport.__init__" ID="UnusedImport.__init__"></a> -<h4>UnusedImport (Constructor)</h4> -<b>UnusedImport</b>(<i>filename, lineno, name</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the unused import (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="UnusedVariable" ID="UnusedVariable"></a> -<h2>UnusedVariable</h2> -<p> - Class defining the "Unused Variable" message. -</p><p> - Indicates that a variable has been explicitly assigned to but not actually - used. -</p> -<h3>Derived from</h3> -Message -<h3>Class Attributes</h3> -<table> -<tr><td>message</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#UnusedVariable.__init__">UnusedVariable</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="UnusedVariable.__init__" ID="UnusedVariable.__init__"></a> -<h4>UnusedVariable (Constructor)</h4> -<b>UnusedVariable</b>(<i>filename, lineno, names</i>) -<p> - Constructor -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file (string) -</dd><dt><i>lineno</i></dt> -<dd> -line number (integer) -</dd><dt><i>name</i></dt> -<dd> -name of the unused variable (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.UtilitiesPython2.html Sat Apr 20 20:29:37 2013 +0200 +++ b/Documentation/Source/index-eric5.UtilitiesPython2.html Sun Apr 21 20:30:56 2013 +0200 @@ -28,9 +28,6 @@ <h3>Modules</h3> <table> <tr> -<td><a href="eric5.UtilitiesPython2.Pep8Checker.html">Pep8Checker</a></td> -<td>Class implementing the PEP 8 checker for Python2.</td> -</tr><tr> <td><a href="eric5.UtilitiesPython2.PySideImporter.html">PySideImporter</a></td> <td>Module to check for the presence of PySide by importing it.</td> </tr><tr> @@ -42,9 +39,6 @@ </tr><tr> <td><a href="eric5.UtilitiesPython2.Tools.html">Tools</a></td> <td>Module implementing tool functions.</td> -</tr><tr> -<td><a href="eric5.UtilitiesPython2.pep8.html">pep8</a></td> -<td></td> </tr> </table> </body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.UtilitiesPython2.py2flakes.html Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.py2flakes</title> -<meta charset="UTF-8"> -<style> -body { - background: #EDECE6; - margin: 0em 1em 10em 1em; - color: black; -} - -h1 { color: white; background: #85774A; } -h2 { color: white; background: #85774A; } -h3 { color: white; background: #9D936E; } -h4 { color: white; background: #9D936E; } - -a { color: #BA6D36; } - -</style> -</head> -<body> -<h1>eric5.UtilitiesPython2.py2flakes</h1> -<p> -Package containg pyflakes for Python2. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.UtilitiesPython2.py2flakes.checker.html">checker</a></td> -<td></td> -</tr><tr> -<td><a href="eric5.UtilitiesPython2.py2flakes.messages.html">messages</a></td> -<td></td> -</tr> -</table> -</body></html> \ No newline at end of file
--- a/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py Sat Apr 20 20:29:37 2013 +0200 +++ b/Plugins/CheckerPlugins/Pep8/Pep8Dialog.py Sun Apr 21 20:30:56 2013 +0200 @@ -11,6 +11,7 @@ import os import fnmatch +import tokenize from PyQt4.QtCore import pyqtSlot, Qt from PyQt4.QtGui import QDialog, QTreeWidgetItem, QAbstractButton, \ @@ -125,7 +126,40 @@ itm.setData(0, self.lineRole, int(line)) itm.setData(0, self.positionRole, int(pos)) itm.setData(0, self.messageRole, message) - + + def __createErrorItem(self, file, line, pos, message): + """ + Private method to create an entry in the result list. + + @param file file name of the file (string) + @param line line number of issue (integer or string) + @param pos character position of issue (integer or string) + @param message message text (string) + @param fixed flag indicating a fixed issue (boolean) + """ + if self.__lastFileItem is None: + # It's a new file + self.__lastFileItem = QTreeWidgetItem(self.resultList, [file]) + self.__lastFileItem.setFirstColumnSpanned(True) + self.__lastFileItem.setExpanded(True) + self.__lastFileItem.setData(0, self.filenameRole, file) + + itm = QTreeWidgetItem(self.__lastFileItem, + ["{0:6}".format(line), '', message]) + itm.setIcon(0, UI.PixmapCache.getIcon("syntaxError.png")) + + itm.setTextAlignment(0, Qt.AlignRight) + itm.setTextAlignment(1, Qt.AlignHCenter) + + itm.setTextAlignment(0, Qt.AlignVCenter) + itm.setTextAlignment(1, Qt.AlignVCenter) + itm.setTextAlignment(2, Qt.AlignVCenter) + + itm.setData(0, self.filenameRole, file) + itm.setData(0, self.lineRole, int(line)) + itm.setData(0, self.positionRole, int(pos)) + itm.setData(0, self.messageRole, message) + def __updateStatistics(self, statistics, fixer): """ Private method to update the collected statistics. @@ -222,12 +256,10 @@ files = fn[:] elif os.path.isdir(fn): files = [] - for ext in Preferences.getPython("Python3Extensions"): - files.extend( - Utilities.direntries(fn, 1, '*{0}'.format(ext), 0)) - for ext in Preferences.getPython("PythonExtensions"): - files.extend( - Utilities.direntries(fn, 1, '*{0}'.format(ext), 0)) + extensions = set(Preferences.getPython("PythonExtensions") + + Preferences.getPython("Python3Extensions")) + for ext in extensions: + files.extend(Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) else: files = [fn] @@ -241,15 +273,8 @@ [f for f in files if not fnmatch.fnmatch(f, filter.strip())] - py3files = [f for f in files \ - if f.endswith( - tuple(Preferences.getPython("Python3Extensions")))] - py2files = [f for f in files \ - if f.endswith( - tuple(Preferences.getPython("PythonExtensions")))] - - if len(py3files) + len(py2files) > 0: - self.checkProgress.setMaximum(len(py3files) + len(py2files)) + if len(files) > 0: + self.checkProgress.setMaximum(len(files)) QApplication.processEvents() # extract the configuration values @@ -266,7 +291,7 @@ # now go through all the files progress = 0 - for file in py3files + py2files: + for file in files: self.checkProgress.setValue(progress) QApplication.processEvents() @@ -281,58 +306,57 @@ source = source.splitlines(True) except (UnicodeError, IOError) as msg: self.noResults = False - self.__createResultItem(file, "1", "1", + self.__createResultItem(file, 1, 1, self.trUtf8("Error: {0}").format(str(msg))\ .rstrip()[1:-1], False) progress += 1 continue - flags = Utilities.extractFlags(source) - ext = os.path.splitext(file)[1] if fixIssues: from .Pep8Fixer import Pep8Fixer fixer = Pep8Fixer(self.__project, file, source, fixCodes, True) # always fix in place else: fixer = None - if ("FileType" in flags and - flags["FileType"] in ["Python", "Python2"]) or \ - file in py2files or \ - (ext in [".py", ".pyw"] and \ - Preferences.getProject("DeterminePyFromProject") and \ - self.__project.isOpen() and \ - self.__project.isProjectFile(file) and \ - self.__project.getProjectLanguage() in ["Python", - "Python2"]): - from .Pep8Checker import Pep8Py2Checker - checker = Pep8Py2Checker(file, [], - repeat=repeatMessages, - select=includeMessages, - ignore=excludeMessages) + from .Pep8Checker import Pep8Checker + checker = Pep8Checker(file, source, + repeat=repeatMessages, + select=includeMessages, + ignore=excludeMessages) + try: + checker.check_all() + except tokenize.TokenError as msg: + self.noResults = False + self.__createErrorItem(file, 1, -1, + self.trUtf8("Token Error: {0}".format(str(msg)))) + except IndentationError as err: + self.noResults = False + self.__createErrorItem(file, err.lineno, -1, + self.trUtf8("Indentation Error: {0}".format(str(err.msg)))) + except Exception as err: + self.noResults = False + self.__createErrorItem(file, 1, -1, + self.trUtf8("Unspecific Error: {0}".format(str(err)))) else: - from .Pep8Checker import Pep8Checker - checker = Pep8Checker(file, source, - repeat=repeatMessages, - select=includeMessages, - ignore=excludeMessages) - checker.check_all() - checker.messages.sort(key=lambda a: a[1]) - for message in checker.messages: - fname, lineno, position, text = message - if "__IGNORE_WARNING__" not in Utilities.extractLineFlags( - source[lineno - 1].strip()): - self.noResults = False - fixed = False - if fixer: - fixed, msg = fixer.fixIssue(lineno, position, text) - if fixed: - text += "\n" + \ - self.trUtf8("Fix: {0}").format(msg) - self.__createResultItem( - fname, lineno, position, text, fixed) - fixer and fixer.saveFile(encoding) - self.__updateStatistics(checker.statistics, fixer) - progress += 1 + checker.messages.sort(key=lambda a: a[1]) + for message in checker.messages: + fname, lineno, position, text = message + if "__IGNORE_WARNING__" not in Utilities.extractLineFlags( + source[lineno - 1].strip()): + self.noResults = False + fixed = False + if fixer: + fixed, msg = fixer.fixIssue(lineno, position, text) + if fixed: + text += "\n" + \ + self.trUtf8("Fix: {0}").format(msg) + self.__createResultItem( + fname, lineno, position, text, fixed) + if fixer: + fixer.saveFile(encoding) + self.__updateStatistics(checker.statistics, fixer) + finally: + progress += 1 finally: # reenable updates of the list self.resultList.setSortingEnabled(True) @@ -450,7 +474,11 @@ vm.openSourceFile(fn, lineno=lineno, pos=position) editor = vm.getOpenEditor(fn) - editor.toggleFlakesWarning(lineno, True, message) + if position > 0: + editor.toggleFlakesWarning(lineno, True, message) + else: + error = message.split(':', 1)[-1] + editor.toggleSyntaxError(lineno, 1, True, error.strip(), show=True) @pyqtSlot() def on_showButton_clicked(self):
--- a/Plugins/CheckerPlugins/Pep8/pep8.py Sat Apr 20 20:29:37 2013 +0200 +++ b/Plugins/CheckerPlugins/Pep8/pep8.py Sun Apr 21 20:30:56 2013 +0200 @@ -364,13 +364,12 @@ """ line = physical_line.rstrip() length = len(line) - if length > MAX_LINE_LENGTH: - try: - # The line could contain multi-byte characters - if hasattr(line, 'decode'): # Python 2 only - length = len(line.decode('utf-8')) - except UnicodeDecodeError: - pass + try: + # The line could contain multi-byte characters + if hasattr(line, 'decode'): # Python 2 only + length = len(line.decode('utf-8')) + except (UnicodeDecodeError, UnicodeEncodeError): + pass if length > MAX_LINE_LENGTH: return MAX_LINE_LENGTH, "E501", length @@ -985,7 +984,8 @@ for name, check, argument_names in options.physical_checks: result = self.run_check(check, argument_names) if result is not None: - offset, code, *args = result + offset, code = result[:2] + args = result[2:] self.report_error_args(self.line_number, offset, code, check, *args) @@ -1041,7 +1041,8 @@ print(' ' + name) result = self.run_check(check, argument_names) if result is not None: - offset, code, *args = result + offset, code = result[:2] + args = result[2:] if isinstance(offset, tuple): original_number, original_offset = offset else:
--- a/UtilitiesPython2/Pep8Checker.py Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2011 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Class implementing the PEP 8 checker for Python2. -""" - -import sys -import optparse -import getopt - -from Tools import readEncodedFile, normalizeCode - -import pep8 - - -class Pep8Checker(pep8.Checker): - """ - Class implementing the PEP 8 checker for Python2. - """ - def __init__(self, filename, lines, repeat=False, - select="", ignore=""): - """ - Constructor - - @param filename name of the file to check (string) - @param lines source of the file (list of strings) - @keyparam repeat flag indicating to repeat message categories (boolean) - @keyparam select list of message IDs to check for - (comma separated string) - @keyparam ignore list of message IDs to ignore - (comma separated string) - """ - pep8.options = optparse.Values() - - pep8.options.verbose = 0 - - pep8.options.repeat = repeat - if select: - pep8.options.select = [s.strip() for s in select.split(',') - if s.strip()] - else: - pep8.options.select = [] - if ignore: - pep8.options.ignore = [i.strip() for i in ignore.split(',') - if i.strip()] - else: - pep8.options.ignore = [] - pep8.options.physical_checks = pep8.find_checks('physical_line') - pep8.options.logical_checks = pep8.find_checks('logical_line') - pep8.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0) - pep8.options.messages = {} - - pep8.Checker.__init__(self, filename, lines) - - self.messages = [] - self.statistics = {} - - def __ignore_code(self, code): - """ - Private method to check, if the message for the given code should - be ignored. - - If codes are selected and the code has a selected prefix and does not - have an ignored prefix, it is not ignored. If codes are selected and - the code does not have a selected prefix, it is ignored. If no codes - are selected, the code is ignored, if it has a prefix, that is - contained in the ignored codes. - - @param code code to be checked (string) - @return flag indicating, that the code should be ignored (boolean) - """ - if pep8.options.select: - if code.startswith(tuple(pep8.options.select)): - if code.startswith(tuple(pep8.options.ignore)): - return True - else: - return False - else: - return True - else: - if code.startswith(tuple(pep8.options.ignore)): - return True - else: - return False - - def report_error_args(self, line_number, offset, code, check, *args): - """ - Public method to collect the error messages. - - @param line_number line number of the issue (integer) - @param offset position within line of the issue (integer) - @param code message code (string) - @param check reference to the checker function (function) - @param args arguments for the message (list) - """ - if self.__ignore_code(code): - return - - if code in self.statistics: - self.statistics[code] += 1 - else: - self.statistics[code] = 1 - self.file_errors += 1 - if self.statistics[code] == 1 or pep8.options.repeat: - self.messages.append( - (self.filename, self.line_offset + line_number, - offset + 1, code, args) - ) - -if __name__ == "__main__": - repeat = False - select = "" - ignore = "" - filename = "" - - if "-f" not in sys.argv: - print "ERROR" - print "" - print "No file name given." - else: - try: - optlist, args = getopt.getopt(sys.argv[1:], "rf:i:s:") - except getopt.GetoptError: - print "ERROR" - print "" - print "Wrong arguments given" - sys.exit(1) - - for opt, arg in optlist: - if opt == "-r": - repeat = True - elif opt == "-f": - filename = arg - elif opt == "-i": - ignore = arg - elif opt == "-s": - select = arg - - try: - codestring = readEncodedFile(filename)[0] - codestring = normalizeCode(codestring) - codestring = codestring.splitlines(True) - except IOError, msg: - print "ERROR" - print filename - print "I/O Error: %s" % unicode(msg) - sys.exit(1) - - checker = Pep8Checker(filename, codestring, repeat=repeat, - select=select, ignore=ignore) - checker.check_all() - if len(checker.messages) > 0: - checker.messages.sort(key=lambda a: a[1]) - for message in checker.messages: - fname, lineno, position, code, args = message - print "PEP8" - print fname - print lineno - print position - print code - print len(args) - for a in args: - print a - print "PEP8_STATISTICS" - for key in checker.statistics: - print key, checker.statistics[key] - else: - print "NO_PEP8" - print filename - -# -# eflag: FileType = Python2
--- a/UtilitiesPython2/pep8.py Sat Apr 20 20:29:37 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1373 +0,0 @@ -# -*- coding: utf-8 -*- - -# -# pep8.py - Check Python source code formatting, according to PEP 8 -# Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net> -# -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, -# including without limitation the rights to use, copy, modify, merge, -# publish, distribute, sublicense, and/or sell copies of the Software, -# and to permit persons to whom the Software is furnished to do so, -# subject to the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -""" -Check Python source code formatting, according to PEP 8: -http://www.python.org/dev/peps/pep-0008/ - -For usage and a list of options, try this: -$ python pep8.py -h - -This program and its regression test suite live here: -http://github.com/jcrocholl/pep8 - -Groups of errors and warnings: -E errors -W warnings -100 indentation -200 whitespace -300 blank lines -400 imports -500 line length -600 deprecation -700 statements - -You can add checks to this program by writing plugins. Each plugin is -a simple function that is called for each line of source code, either -physical or logical. - -Physical line: -- Raw line of text from the input file. - -Logical line: -- Multi-line statements converted to a single line. -- Stripped left and right. -- Contents of strings replaced with 'xxx' of same length. -- Comments removed. - -The check function requests physical or logical lines by the name of -the first argument: - -def maximum_line_length(physical_line) -def extraneous_whitespace(logical_line) -def blank_lines(logical_line, blank_lines, indent_level, line_number) - -The last example above demonstrates how check plugins can request -additional information with extra arguments. All attributes of the -Checker object are available. Some examples: - -lines: a list of the raw lines from the input file -tokens: the tokens that contribute to this logical line -line_number: line number in the input file -blank_lines: blank lines before this one -indent_char: first indentation character in this file (' ' or '\t') -indent_level: indentation (with tabs expanded to multiples of 8) -previous_indent_level: indentation on previous line -previous_logical: previous logical line - -The docstring of each check function shall be the relevant part of -text from PEP 8. It is printed if the user enables --show-pep8. -Several docstrings contain examples directly from the PEP 8 document. - -Okay: spam(ham[1], {eggs: 2}) -E201: spam( ham[1], {eggs: 2}) - -These examples are verified automatically when pep8.py is run with the ---doctest option. You can add examples for your own check functions. -The format is simple: "Okay" or error/warning code followed by colon -and space, the rest of the line is example source code. If you put 'r' -before the docstring, you can use \n for newline, \t for tab and \s -for space. - -""" - -# -# This is a modified version to make the original tabnanny better suitable -# for being called from within the eric5 IDE. The modifications are as -# follows: -# -# - made messages translatable via Qt -# -# Copyright (c) 2011 - 2013 Detlev Offenbach <detlev@die-offenbachs.de> -# - -__version__ = '0.6.1' - -import os -import sys -import re -import time -import inspect -import keyword -import tokenize -from optparse import OptionParser -from fnmatch import fnmatch -try: - frozenset -except NameError: - from sets import ImmutableSet as frozenset - -DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git' -DEFAULT_IGNORE = 'E24' -MAX_LINE_LENGTH = 79 - -INDENT_REGEX = re.compile(r'([ \t]*)') -RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*(,)') -SELFTEST_REGEX = re.compile(r'(Okay|[EW]\d{3}):\s(.*)') -ERRORCODE_REGEX = re.compile(r'[EW]\d{3}') -DOCSTRING_REGEX = re.compile(r'u?r?["\']') -WHITESPACE_AROUND_OPERATOR_REGEX = \ - re.compile('([^\w\s]*)\s*(\t| )\s*([^\w\s]*)') -EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') -WHITESPACE_AROUND_NAMED_PARAMETER_REGEX = \ - re.compile(r'[()]|\s=[^=]|[^=!<>]=\s') - - -WHITESPACE = ' \t' - -BINARY_OPERATORS = frozenset(['**=', '*=', '+=', '-=', '!=', '<>', - '%=', '^=', '&=', '|=', '==', '/=', '//=', '<=', '>=', '<<=', '>>=', - '%', '^', '&', '|', '=', '/', '//', '<', '>', '<<']) -UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) -OPERATORS = BINARY_OPERATORS | UNARY_OPERATORS -SKIP_TOKENS = frozenset([tokenize.COMMENT, tokenize.NL, tokenize.INDENT, - tokenize.DEDENT, tokenize.NEWLINE]) -E225NOT_KEYWORDS = (frozenset(keyword.kwlist + ['print']) - - frozenset(['False', 'None', 'True'])) -BENCHMARK_KEYS = ('directories', 'files', 'logical lines', 'physical lines') - -options = None -args = None - - -############################################################################## -# Plugins (check functions) for physical lines -############################################################################## - - -def tabs_or_spaces(physical_line, indent_char): - r""" - Never mix tabs and spaces. - - The most popular way of indenting Python is with spaces only. The - second-most popular way is with tabs only. Code indented with a mixture - of tabs and spaces should be converted to using spaces exclusively. When - invoking the Python command line interpreter with the -t option, it issues - warnings about code that illegally mixes tabs and spaces. When using -tt - these warnings become errors. These options are highly recommended! - - Okay: if a == 0:\n a = 1\n b = 1 - E101: if a == 0:\n a = 1\n\tb = 1 - """ - indent = INDENT_REGEX.match(physical_line).group(1) - for offset, char in enumerate(indent): - if char != indent_char: - return offset, "E101" - - -def tabs_obsolete(physical_line): - r""" - For new projects, spaces-only are strongly recommended over tabs. Most - editors have features that make this easy to do. - - Okay: if True:\n return - W191: if True:\n\treturn - """ - indent = INDENT_REGEX.match(physical_line).group(1) - if indent.count('\t'): - return indent.index('\t'), "W191" - - -def trailing_whitespace(physical_line): - r""" - JCR: Trailing whitespace is superfluous. - FBM: Except when it occurs as part of a blank line (i.e. the line is - nothing but whitespace). According to Python docs[1] a line with only - whitespace is considered a blank line, and is to be ignored. However, - matching a blank line to its indentation level avoids mistakenly - terminating a multi-line statement (e.g. class declaration) when - pasting code into the standard Python interpreter. - - [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines - - The warning returned varies on whether the line itself is blank, for easier - filtering for those who want to indent their blank lines. - - Okay: spam(1) - W291: spam(1)\s - W293: class Foo(object):\n \n bang = 12 - """ - physical_line = physical_line.rstrip('\n') # chr(10), newline - physical_line = physical_line.rstrip('\r') # chr(13), carriage return - physical_line = physical_line.rstrip('\x0c') # chr(12), form feed, ^L - stripped = physical_line.rstrip() - if physical_line != stripped: - if stripped: - return len(stripped), "W291" - else: - return 0, "W293" - - -def trailing_blank_lines(physical_line, lines, line_number): - r""" - JCR: Trailing blank lines are superfluous. - - Okay: spam(1) - W391: spam(1)\n - """ - if physical_line.strip() == '' and line_number == len(lines): - return 0, "W391" - - -def missing_newline(physical_line): - """ - JCR: The last line should have a newline. - """ - if physical_line.rstrip() == physical_line: - return len(physical_line), "W292" - - -def maximum_line_length(physical_line): - """ - Limit all lines to a maximum of 79 characters. - - There are still many devices around that are limited to 80 character - lines; plus, limiting windows to 80 characters makes it possible to have - several windows side-by-side. The default wrapping on such devices looks - ugly. Therefore, please limit all lines to a maximum of 79 characters. - For flowing long blocks of text (docstrings or comments), limiting the - length to 72 characters is recommended. - """ - line = physical_line.rstrip() - length = len(line) - if length > MAX_LINE_LENGTH: - try: - # The line could contain multi-byte characters - if hasattr(line, 'decode'): # Python 2 only - length = len(line.decode('utf-8')) - except UnicodeDecodeError: - pass - if length > MAX_LINE_LENGTH: - return MAX_LINE_LENGTH, "E501", length - - -############################################################################## -# Plugins (check functions) for logical lines -############################################################################## - - -def blank_lines(logical_line, blank_lines, indent_level, line_number, - previous_logical, previous_indent_level, - blank_lines_before_comment): - r""" - Separate top-level function and class definitions with two blank lines. - - Method definitions inside a class are separated by a single blank line. - - Extra blank lines may be used (sparingly) to separate groups of related - functions. Blank lines may be omitted between a bunch of related - one-liners (e.g. a set of dummy implementations). - - Use blank lines in functions, sparingly, to indicate logical sections. - - Okay: def a():\n pass\n\n\ndef b():\n pass - Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass - - E301: class Foo:\n b = 0\n def bar():\n pass - E302: def a():\n pass\n\ndef b(n):\n pass - E303: def a():\n pass\n\n\n\ndef b(n):\n pass - E303: def a():\n\n\n\n pass - E304: @decorator\n\ndef a():\n pass - """ - if line_number == 1: - return # Don't expect blank lines before the first line - max_blank_lines = max(blank_lines, blank_lines_before_comment) - if previous_logical.startswith('@'): - if max_blank_lines: - return 0, "E304" - elif max_blank_lines > 2 or (indent_level and max_blank_lines == 2): - return 0, "E303", max_blank_lines - elif (logical_line.startswith('def ') or - logical_line.startswith('class ') or - logical_line.startswith('@')): - if indent_level: - if not (max_blank_lines or previous_indent_level < indent_level or - DOCSTRING_REGEX.match(previous_logical)): - return 0, "E301" - elif max_blank_lines != 2: - return 0, "E302", max_blank_lines - - -def extraneous_whitespace(logical_line): - """ - Avoid extraneous whitespace in the following situations: - - - Immediately inside parentheses, brackets or braces. - - - Immediately before a comma, semicolon, or colon. - - Okay: spam(ham[1], {eggs: 2}) - E201: spam( ham[1], {eggs: 2}) - E201: spam(ham[ 1], {eggs: 2}) - E201: spam(ham[1], { eggs: 2}) - E202: spam(ham[1], {eggs: 2} ) - E202: spam(ham[1 ], {eggs: 2}) - E202: spam(ham[1], {eggs: 2 }) - - E203: if x == 4: print x, y; x, y = y , x - E203: if x == 4: print x, y ; x, y = y, x - E203: if x == 4 : print x, y; x, y = y, x - """ - line = logical_line - for match in EXTRANEOUS_WHITESPACE_REGEX.finditer(line): - text = match.group() - char = text.strip() - found = match.start() - if text == char + ' ' and char in '([{': - return found + 1, "E201", char - if text == ' ' + char and line[found - 1] != ',': - if char in '}])': - return found, "E202", char - if char in ',;:': - return found, "E203", char - - -def missing_whitespace(logical_line): - """ - JCR: Each comma, semicolon or colon should be followed by whitespace. - - Okay: [a, b] - Okay: (3,) - Okay: a[1:4] - Okay: a[:4] - Okay: a[1:] - Okay: a[1:4:2] - E231: ['a','b'] - E231: foo(bar,baz) - """ - line = logical_line - for index in range(len(line) - 1): - char = line[index] - if char in ',;:' and line[index + 1] not in WHITESPACE: - before = line[:index] - if char == ':' and before.count('[') > before.count(']'): - continue # Slice syntax, no space required - if char == ',' and line[index + 1] == ')': - continue # Allow tuple with only one element: (3,) - return index, "E231", char - - -def indentation(logical_line, previous_logical, indent_char, - indent_level, previous_indent_level): - r""" - Use 4 spaces per indentation level. - - For really old code that you don't want to mess up, you can continue to - use 8-space tabs. - - Okay: a = 1 - Okay: if a == 0:\n a = 1 - E111: a = 1 - - Okay: for item in items:\n pass - E112: for item in items:\npass - - Okay: a = 1\nb = 2 - E113: a = 1\n b = 2 - """ - if indent_char == ' ' and indent_level % 4: - return 0, "E111" - indent_expect = previous_logical.endswith(':') - if indent_expect and indent_level <= previous_indent_level: - return 0, "E112" - if indent_level > previous_indent_level and not indent_expect: - return 0, "E113" - - -def whitespace_before_parameters(logical_line, tokens): - """ - Avoid extraneous whitespace in the following situations: - - - Immediately before the open parenthesis that starts the argument - list of a function call. - - - Immediately before the open parenthesis that starts an indexing or - slicing. - - Okay: spam(1) - E211: spam (1) - - Okay: dict['key'] = list[index] - E211: dict ['key'] = list[index] - E211: dict['key'] = list [index] - """ - prev_type = tokens[0][0] - prev_text = tokens[0][1] - prev_end = tokens[0][3] - for index in range(1, len(tokens)): - token_type, text, start, end, line = tokens[index] - if (token_type == tokenize.OP and - text in '([' and - start != prev_end and - (prev_type == tokenize.NAME or prev_text in '}])') and - # Syntax "class A (B):" is allowed, but avoid it - (index < 2 or tokens[index - 2][1] != 'class') and - # Allow "return (a.foo for a in range(5))" - (not keyword.iskeyword(prev_text))): - return prev_end, "E211", text - prev_type = token_type - prev_text = text - prev_end = end - - -def whitespace_around_operator(logical_line): - """ - Avoid extraneous whitespace in the following situations: - - - More than one space around an assignment (or other) operator to - align it with another. - - Okay: a = 12 + 3 - E221: a = 4 + 5 - E222: a = 4 + 5 - E223: a = 4\t+ 5 - E224: a = 4 +\t5 - """ - for match in WHITESPACE_AROUND_OPERATOR_REGEX.finditer(logical_line): - before, whitespace, after = match.groups() - tab = whitespace == '\t' - offset = match.start(2) - if before in OPERATORS: - return offset, (tab and "E224" or "E222") - elif after in OPERATORS: - return offset, (tab and "E223" or "E221") - - -def missing_whitespace_around_operator(logical_line, tokens): - r""" - - Always surround these binary operators with a single space on - either side: assignment (=), augmented assignment (+=, -= etc.), - comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not), - Booleans (and, or, not). - - - Use spaces around arithmetic operators. - - Okay: i = i + 1 - Okay: submitted += 1 - Okay: x = x * 2 - 1 - Okay: hypot2 = x * x + y * y - Okay: c = (a + b) * (a - b) - Okay: foo(bar, key='word', *args, **kwargs) - Okay: baz(**kwargs) - Okay: negative = -1 - Okay: spam(-1) - Okay: alpha[:-i] - Okay: if not -5 < x < +5:\n pass - Okay: lambda *args, **kw: (args, kw) - - E225: i=i+1 - E225: submitted +=1 - E225: x = x*2 - 1 - E225: hypot2 = x*x + y*y - E225: c = (a+b) * (a-b) - E225: c = alpha -4 - E225: z = x **y - """ - parens = 0 - need_space = False - prev_type = tokenize.OP - prev_text = prev_end = None - for token_type, text, start, end, line in tokens: - if token_type in (tokenize.NL, tokenize.NEWLINE, tokenize.ERRORTOKEN): - # ERRORTOKEN is triggered by backticks in Python 3000 - continue - if text in ('(', 'lambda'): - parens += 1 - elif text == ')': - parens -= 1 - if need_space: - if start != prev_end: - need_space = False - elif text == '>' and prev_text == '<': - # Tolerate the "<>" operator, even if running Python 3 - pass - else: - return prev_end, "E225" - elif token_type == tokenize.OP and prev_end is not None: - if text == '=' and parens: - # Allow keyword args or defaults: foo(bar=None). - pass - elif text in BINARY_OPERATORS: - need_space = True - elif text in UNARY_OPERATORS: - # Allow unary operators: -123, -x, +1. - # Allow argument unpacking: foo(*args, **kwargs). - if prev_type == tokenize.OP: - if prev_text in '}])': - need_space = True - elif prev_type == tokenize.NAME: - if prev_text not in E225NOT_KEYWORDS: - need_space = True - else: - need_space = True - if need_space and start == prev_end: - return prev_end, "E225" - prev_type = token_type - prev_text = text - prev_end = end - - -def whitespace_around_comma(logical_line): - """ - Avoid extraneous whitespace in the following situations: - - - More than one space around an assignment (or other) operator to - align it with another. - - JCR: This should also be applied around comma etc. - Note: these checks are disabled by default - - Okay: a = (1, 2) - E241: a = (1, 2) - E242: a = (1,\t2) - """ - line = logical_line - for separator in ',;:': - found = line.find(separator + ' ') - if found > -1: - return found + 1, "E241", separator - found = line.find(separator + '\t') - if found > -1: - return found + 1, "E242", separator - - -def whitespace_around_named_parameter_equals(logical_line): - """ - Don't use spaces around the '=' sign when used to indicate a - keyword argument or a default parameter value. - - Okay: def complex(real, imag=0.0): - Okay: return magic(r=real, i=imag) - Okay: boolean(a == b) - Okay: boolean(a != b) - Okay: boolean(a <= b) - Okay: boolean(a >= b) - - E251: def complex(real, imag = 0.0): - E251: return magic(r = real, i = imag) - """ - parens = 0 - for match in WHITESPACE_AROUND_NAMED_PARAMETER_REGEX.finditer( - logical_line): - text = match.group() - if parens and len(text) == 3: - issue = "E251" - return match.start(), issue - if text == '(': - parens += 1 - elif text == ')': - parens -= 1 - - -def whitespace_before_inline_comment(logical_line, tokens): - """ - Separate inline comments by at least two spaces. - - An inline comment is a comment on the same line as a statement. Inline - comments should be separated by at least two spaces from the statement. - They should start with a # and a single space. - - Okay: x = x + 1 # Increment x - Okay: x = x + 1 # Increment x - E261: x = x + 1 # Increment x - E262: x = x + 1 #Increment x - E262: x = x + 1 # Increment x - """ - prev_end = (0, 0) - for token_type, text, start, end, line in tokens: - if token_type == tokenize.NL: - continue - if token_type == tokenize.COMMENT: - if not line[:start[1]].strip(): - continue - if prev_end[0] == start[0] and start[1] < prev_end[1] + 2: - return (prev_end, "E261") - if (len(text) > 1 and text.startswith('# ') - or not text.startswith('# ')): - return start, "E262" - else: - prev_end = end - - -def imports_on_separate_lines(logical_line): - r""" - Imports should usually be on separate lines. - - Okay: import os\nimport sys - E401: import sys, os - - Okay: from subprocess import Popen, PIPE - Okay: from myclas import MyClass - Okay: from foo.bar.yourclass import YourClass - Okay: import myclass - Okay: import foo.bar.yourclass - """ - line = logical_line - if line.startswith('import '): - found = line.find(',') - if found > -1: - return found, "E401" - - -def compound_statements(logical_line): - r""" - Compound statements (multiple statements on the same line) are - generally discouraged. - - While sometimes it's okay to put an if/for/while with a small body - on the same line, never do this for multi-clause statements. Also - avoid folding such long lines! - - Okay: if foo == 'blah':\n do_blah_thing() - Okay: do_one() - Okay: do_two() - Okay: do_three() - - E701: if foo == 'blah': do_blah_thing() - E701: for x in lst: total += x - E701: while t < 10: t = delay() - E701: if foo == 'blah': do_blah_thing() - E701: else: do_non_blah_thing() - E701: try: something() - E701: finally: cleanup() - E701: if foo == 'blah': one(); two(); three() - - E702: do_one(); do_two(); do_three() - """ - line = logical_line - found = line.find(':') - if -1 < found < len(line) - 1: - before = line[:found] - if (before.count('{') <= before.count('}') and # {'a': 1} (dict) - before.count('[') <= before.count(']') and # [1:2] (slice) - not re.search(r'\blambda\b', before)): # lambda x: x - return found, "E701" - found = line.find(';') - if -1 < found: - return found, "E702" - - -def python_3000_has_key(logical_line): - """ - The {}.has_key() method will be removed in the future version of - Python. Use the 'in' operation instead, like: - d = {"a": 1, "b": 2} - if "b" in d: - print d["b"] - """ - pos = logical_line.find('.has_key(') - if pos > -1: - return pos, "W601" - - -def python_3000_raise_comma(logical_line): - """ - When raising an exception, use "raise ValueError('message')" - instead of the older form "raise ValueError, 'message'". - - The paren-using form is preferred because when the exception arguments - are long or include string formatting, you don't need to use line - continuation characters thanks to the containing parentheses. The older - form will be removed in Python 3000. - """ - match = RAISE_COMMA_REGEX.match(logical_line) - if match: - return match.start(1), "W602" - - -def python_3000_not_equal(logical_line): - """ - != can also be written <>, but this is an obsolete usage kept for - backwards compatibility only. New code should always use !=. - The older syntax is removed in Python 3000. - """ - pos = logical_line.find('<>') - if pos > -1: - return pos, "W603" - - -def python_3000_backticks(logical_line): - """ - Backticks are removed in Python 3000. - Use repr() instead. - """ - pos = logical_line.find('`') - if pos > -1: - return pos, "W604" - - -############################################################################## -# Helper functions -############################################################################## - - -if '' == ''.encode(): - # Python 2: implicit encoding. - def readlines(filename): - return open(filename).readlines() -else: - # Python 3: decode to latin-1. - # This function is lazy, it does not read the encoding declaration. - # XXX: use tokenize.detect_encoding() - def readlines(filename): # __IGNORE_WARNING__ - return open(filename, encoding='latin-1').readlines() - - -def expand_indent(line): - """ - Return the amount of indentation. - Tabs are expanded to the next multiple of 8. - - >>> expand_indent(' ') - 4 - >>> expand_indent('\\t') - 8 - >>> expand_indent(' \\t') - 8 - >>> expand_indent(' \\t') - 8 - >>> expand_indent(' \\t') - 16 - """ - result = 0 - for char in line: - if char == '\t': - result = result // 8 * 8 + 8 - elif char == ' ': - result += 1 - else: - break - return result - - -def mute_string(text): - """ - Replace contents with 'xxx' to prevent syntax matching. - - >>> mute_string('"abc"') - '"xxx"' - >>> mute_string("'''abc'''") - "'''xxx'''" - >>> mute_string("r'abc'") - "r'xxx'" - """ - start = 1 - end = len(text) - 1 - # String modifiers (e.g. u or r) - if text.endswith('"'): - start += text.index('"') - elif text.endswith("'"): - start += text.index("'") - # Triple quotes - if text.endswith('"""') or text.endswith("'''"): - start += 2 - end -= 2 - return text[:start] + 'x' * (end - start) + text[end:] - - -def message(text): - """Print a message.""" - # print >> sys.stderr, options.prog + ': ' + text - # print >> sys.stderr, text - print(text) - - -############################################################################## -# Framework to run all checks -############################################################################## - - -def find_checks(argument_name): - """ - Find all globally visible functions where the first argument name - starts with argument_name. - """ - checks = [] - for name, function in globals().items(): - if not inspect.isfunction(function): - continue - args = inspect.getargspec(function)[0] - if args and args[0].startswith(argument_name): - codes = ERRORCODE_REGEX.findall(inspect.getdoc(function) or '') - for code in codes or ['']: - if not code or not ignore_code(code): - checks.append((name, function, args)) - break - checks.sort() - return checks - - -class Checker(object): - """ - Load a Python source file, tokenize it, check coding style. - """ - - def __init__(self, filename, lines=None): - self.filename = filename - if filename is None: - self.filename = 'stdin' - self.lines = lines or [] - elif lines is None: - self.lines = readlines(filename) - else: - self.lines = lines - options.counters['physical lines'] += len(self.lines) - - def readline(self): - """ - Get the next line from the input buffer. - """ - self.line_number += 1 - if self.line_number > len(self.lines): - return '' - return self.lines[self.line_number - 1] - - def readline_check_physical(self): - """ - Check and return the next physical line. This method can be - used to feed tokenize.generate_tokens. - """ - line = self.readline() - if line: - self.check_physical(line) - return line - - def run_check(self, check, argument_names): - """ - Run a check plugin. - """ - arguments = [] - for name in argument_names: - arguments.append(getattr(self, name)) - return check(*arguments) - - def check_physical(self, line): - """ - Run all physical checks on a raw input line. - """ - self.physical_line = line - if self.indent_char is None and len(line) and line[0] in ' \t': - self.indent_char = line[0] - for name, check, argument_names in options.physical_checks: - result = self.run_check(check, argument_names) - if result is not None: - offset, code = result[:2] - args = result[2:] - self.report_error_args(self.line_number, offset, code, check, - *args) - - def build_tokens_line(self): - """ - Build a logical line from tokens. - """ - self.mapping = [] - logical = [] - length = 0 - previous = None - for token in self.tokens: - token_type, text = token[0:2] - if token_type in SKIP_TOKENS: - continue - if token_type == tokenize.STRING: - text = mute_string(text) - if previous: - end_line, end = previous[3] - start_line, start = token[2] - if end_line != start_line: # different row - prev_text = self.lines[end_line - 1][end - 1] - if prev_text == ',' or (prev_text not in '{[(' - and text not in '}])'): - logical.append(' ') - length += 1 - elif end != start: # different column - fill = self.lines[end_line - 1][end:start] - logical.append(fill) - length += len(fill) - self.mapping.append((length, token)) - logical.append(text) - length += len(text) - previous = token - self.logical_line = ''.join(logical) - assert self.logical_line.lstrip() == self.logical_line - assert self.logical_line.rstrip() == self.logical_line - - def check_logical(self): - """ - Build a line from tokens and run all logical checks on it. - """ - options.counters['logical lines'] += 1 - self.build_tokens_line() - first_line = self.lines[self.mapping[0][1][2][0] - 1] - indent = first_line[:self.mapping[0][1][2][1]] - self.previous_indent_level = self.indent_level - self.indent_level = expand_indent(indent) - if options.verbose >= 2: - print(self.logical_line[:80].rstrip()) - for name, check, argument_names in options.logical_checks: - if options.verbose >= 4: - print(' ' + name) - result = self.run_check(check, argument_names) - if result is not None: - offset, code = result[:2] - args = result[2:] - if isinstance(offset, tuple): - original_number, original_offset = offset - else: - for token_offset, token in self.mapping: - if offset >= token_offset: - original_number = token[2][0] - original_offset = (token[2][1] - + offset - token_offset) - self.report_error_args(original_number, original_offset, - code, check, *args) - self.previous_logical = self.logical_line - - def check_all(self, expected=None, line_offset=0): - """ - Run all checks on the input file. - """ - self.expected = expected or () - self.line_offset = line_offset - self.line_number = 0 - self.file_errors = 0 - self.indent_char = None - self.indent_level = 0 - self.previous_logical = '' - self.blank_lines = 0 - self.blank_lines_before_comment = 0 - self.tokens = [] - parens = 0 - for token in tokenize.generate_tokens(self.readline_check_physical): - if options.verbose >= 3: - if token[2][0] == token[3][0]: - pos = '[%s:%s]' % (token[2][1] or '', token[3][1]) - else: - pos = 'l.%s' % token[3][0] - print('l.%s\t%s\t%s\t%r' % - (token[2][0], pos, tokenize.tok_name[token[0]], token[1])) - self.tokens.append(token) - token_type, text = token[0:2] - if token_type == tokenize.OP and text in '([{': - parens += 1 - if token_type == tokenize.OP and text in '}])': - parens -= 1 - if token_type == tokenize.NEWLINE and not parens: - self.check_logical() - self.blank_lines = 0 - self.blank_lines_before_comment = 0 - self.tokens = [] - if token_type == tokenize.NL and not parens: - if len(self.tokens) <= 1: - # The physical line contains only this token. - self.blank_lines += 1 - self.tokens = [] - if token_type == tokenize.COMMENT: - source_line = token[4] - token_start = token[2][1] - if source_line[:token_start].strip() == '': - self.blank_lines_before_comment = max(self.blank_lines, - self.blank_lines_before_comment) - self.blank_lines = 0 - if text.endswith('\n') and not parens: - # The comment also ends a physical line. This works around - # Python < 2.6 behaviour, which does not generate NL after - # a comment which is on a line by itself. - self.tokens = [] - return self.file_errors - - def report_error(self, line_number, offset, text, check): - """ - Report an error, according to options. - """ - code = text[:4] - if ignore_code(code): - return - if options.quiet == 1 and not self.file_errors: - message(self.filename) - if code in options.counters: - options.counters[code] += 1 - else: - options.counters[code] = 1 - options.messages[code] = text[5:] - if options.quiet or code in self.expected: - # Don't care about expected errors or warnings - return - self.file_errors += 1 - if options.counters[code] == 1 or options.repeat: - message("%s:%s:%d: %s" % - (self.filename, self.line_offset + line_number, - offset + 1, text)) - if options.show_source: - line = self.lines[line_number - 1] - message(line.rstrip()) - message(' ' * offset + '^') - if options.show_pep8: - message(check.__doc__.lstrip('\n').rstrip()) - - -def input_file(filename): - """ - Run all checks on a Python source file. - """ - if options.verbose: - message('checking ' + filename) - Checker(filename).check_all() - - -def input_dir(dirname, runner=None): - """ - Check all Python source files in this directory and all subdirectories. - """ - dirname = dirname.rstrip('/') - if excluded(dirname): - return - if runner is None: - runner = input_file - for root, dirs, files in os.walk(dirname): - if options.verbose: - message('directory ' + root) - options.counters['directories'] += 1 - dirs.sort() - for subdir in dirs: - if excluded(subdir): - dirs.remove(subdir) - files.sort() - for filename in files: - if filename_match(filename) and not excluded(filename): - options.counters['files'] += 1 - runner(os.path.join(root, filename)) - - -def excluded(filename): - """ - Check if options.exclude contains a pattern that matches filename. - """ - basename = os.path.basename(filename) - for pattern in options.exclude: - if fnmatch(basename, pattern): - # print basename, 'excluded because it matches', pattern - return True - - -def filename_match(filename): - """ - Check if options.filename contains a pattern that matches filename. - If options.filename is unspecified, this always returns True. - """ - if not options.filename: - return True - for pattern in options.filename: - if fnmatch(filename, pattern): - return True - - -def ignore_code(code): - """ - Check if options.ignore contains a prefix of the error code. - If options.select contains a prefix of the error code, do not ignore it. - """ - for select in options.select: - if code.startswith(select): - return False - for ignore in options.ignore: - if code.startswith(ignore): - return True - - -def reset_counters(): - for key in list(options.counters.keys()): - if key not in BENCHMARK_KEYS: - del options.counters[key] - options.messages = {} - - -def get_error_statistics(): - """Get error statistics.""" - return get_statistics("E") - - -def get_warning_statistics(): - """Get warning statistics.""" - return get_statistics("W") - - -def get_statistics(prefix=''): - """ - Get statistics for message codes that start with the prefix. - - prefix='' matches all errors and warnings - prefix='E' matches all errors - prefix='W' matches all warnings - prefix='E4' matches all errors that have to do with imports - """ - stats = [] - keys = list(options.messages.keys()) - keys.sort() - for key in keys: - if key.startswith(prefix): - stats.append('%-7s %s %s' % - (options.counters[key], key, options.messages[key])) - return stats - - -def get_count(prefix=''): - """Return the total count of errors and warnings.""" - keys = list(options.messages.keys()) - count = 0 - for key in keys: - if key.startswith(prefix): - count += options.counters[key] - return count - - -def print_statistics(prefix=''): - """Print overall statistics (number of errors and warnings).""" - for line in get_statistics(prefix): - print(line) - - -def print_benchmark(elapsed): - """ - Print benchmark numbers. - """ - print('%-7.2f %s' % (elapsed, 'seconds elapsed')) - for key in BENCHMARK_KEYS: - print('%-7d %s per second (%d total)' % ( - options.counters[key] / elapsed, key, - options.counters[key])) - - -def run_tests(filename): - """ - Run all the tests from a file. - - A test file can provide many tests. Each test starts with a declaration. - This declaration is a single line starting with '#:'. - It declares codes of expected failures, separated by spaces or 'Okay' - if no failure is expected. - If the file does not contain such declaration, it should pass all tests. - If the declaration is empty, following lines are not checked, until next - declaration. - - Examples: - - * Only E224 and W701 are expected: #: E224 W701 - * Following example is conform: #: Okay - * Don't check these lines: #: - """ - lines = readlines(filename) + ['#:\n'] - line_offset = 0 - codes = ['Okay'] - testcase = [] - for index, line in enumerate(lines): - if not line.startswith('#:'): - if codes: - # Collect the lines of the test case - testcase.append(line) - continue - if codes and index > 0: - label = '%s:%s:1' % (filename, line_offset + 1) - codes = [c for c in codes if c != 'Okay'] - # Run the checker - errors = Checker(filename, testcase).check_all(codes, line_offset) - # Check if the expected errors were found - for code in codes: - if not options.counters.get(code): - errors += 1 - message('%s: error %s not found' % (label, code)) - if options.verbose and not errors: - message('%s: passed (%s)' % (label, ' '.join(codes))) - # Keep showing errors for multiple tests - reset_counters() - # output the real line numbers - line_offset = index - # configure the expected errors - codes = line.split()[1:] - # empty the test case buffer - del testcase[:] - - -def selftest(): - """ - Test all check functions with test cases in docstrings. - """ - count_passed = 0 - count_failed = 0 - checks = options.physical_checks + options.logical_checks - for name, check, argument_names in checks: - for line in check.__doc__.splitlines(): - line = line.lstrip() - match = SELFTEST_REGEX.match(line) - if match is None: - continue - code, source = match.groups() - checker = Checker(None) - for part in source.split(r'\n'): - part = part.replace(r'\t', '\t') - part = part.replace(r'\s', ' ') - checker.lines.append(part + '\n') - options.quiet = 2 - checker.check_all() - error = None - if code == 'Okay': - if len(options.counters) > len(BENCHMARK_KEYS): - codes = [key for key in options.counters.keys() - if key not in BENCHMARK_KEYS] - error = "incorrectly found %s" % ', '.join(codes) - elif not options.counters.get(code): - error = "failed to find %s" % code - # Reset the counters - reset_counters() - if not error: - count_passed += 1 - else: - count_failed += 1 - if len(checker.lines) == 1: - print("pep8.py: %s: %s" % - (error, checker.lines[0].rstrip())) - else: - print("pep8.py: %s:" % error) - for line in checker.lines: - print(line.rstrip()) - if options.verbose: - print("%d passed and %d failed." % (count_passed, count_failed)) - if count_failed: - print("Test failed.") - else: - print("Test passed.") - - -def process_options(arglist=None): - """ - Process options passed either via arglist or via command line args. - """ - global options, args - parser = OptionParser(version=__version__, - usage="%prog [options] input ...") - parser.add_option('-v', '--verbose', default=0, action='count', - help="print status messages, or debug with -vv") - parser.add_option('-q', '--quiet', default=0, action='count', - help="report only file names, or nothing with -qq") - parser.add_option('-r', '--repeat', action='store_true', - help="show all occurrences of the same error") - parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE, - help="exclude files or directories which match these " - "comma separated patterns (default: %s)" % - DEFAULT_EXCLUDE) - parser.add_option('--filename', metavar='patterns', default='*.py', - help="when parsing directories, only check filenames " - "matching these comma separated patterns (default: " - "*.py)") - parser.add_option('--select', metavar='errors', default='', - help="select errors and warnings (e.g. E,W6)") - parser.add_option('--ignore', metavar='errors', default='', - help="skip errors and warnings (e.g. E4,W)") - parser.add_option('--show-source', action='store_true', - help="show source code for each error") - parser.add_option('--show-pep8', action='store_true', - help="show text of PEP 8 for each error") - parser.add_option('--statistics', action='store_true', - help="count errors and warnings") - parser.add_option('--count', action='store_true', - help="print total number of errors and warnings " - "to standard error and set exit code to 1 if " - "total is not null") - parser.add_option('--benchmark', action='store_true', - help="measure processing speed") - parser.add_option('--testsuite', metavar='dir', - help="run regression tests from dir") - parser.add_option('--doctest', action='store_true', - help="run doctest on myself") - options, args = parser.parse_args(arglist) - if options.testsuite: - args.append(options.testsuite) - if not args and not options.doctest: - parser.error('input not specified') - options.prog = os.path.basename(sys.argv[0]) - options.exclude = options.exclude.split(',') - for index in range(len(options.exclude)): - options.exclude[index] = options.exclude[index].rstrip('/') - if options.filename: - options.filename = options.filename.split(',') - if options.select: - options.select = options.select.split(',') - else: - options.select = [] - if options.ignore: - options.ignore = options.ignore.split(',') - elif options.select: - # Ignore all checks which are not explicitly selected - options.ignore = [''] - elif options.testsuite or options.doctest: - # For doctest and testsuite, all checks are required - options.ignore = [] - else: - # The default choice: ignore controversial checks - options.ignore = DEFAULT_IGNORE.split(',') - options.physical_checks = find_checks('physical_line') - options.logical_checks = find_checks('logical_line') - options.counters = dict.fromkeys(BENCHMARK_KEYS, 0) - options.messages = {} - return options, args - - -def _main(): - """ - Parse options and run checks on Python source. - """ - options, args = process_options() - if options.doctest: - import doctest - doctest.testmod(verbose=options.verbose) - selftest() - if options.testsuite: - runner = run_tests - else: - runner = input_file - start_time = time.time() - for path in args: - if os.path.isdir(path): - input_dir(path, runner=runner) - elif not excluded(path): - options.counters['files'] += 1 - runner(path) - elapsed = time.time() - start_time - if options.statistics: - print_statistics() - if options.benchmark: - print_benchmark(elapsed) - count = get_count() - if count: - if options.count: - sys.stderr.write(str(count) + '\n') - sys.exit(1) - - -if __name__ == '__main__': - _main() - -# -# eflag: FileType = Python2