Sun, 30 Mar 2014 22:00:14 +0200
Merge with BgService.
--- a/APIs/Python3/eric5.api Sun Jan 05 23:22:17 2014 +0100 +++ b/APIs/Python3/eric5.api Sun Mar 30 22:00:14 2014 +0200 @@ -3734,7 +3734,12 @@ eric5.Plugins.AboutPlugin.AboutDialog.licenseText?7 eric5.Plugins.AboutPlugin.AboutDialog.thanksText?7 eric5.Plugins.AboutPlugin.AboutDialog.titleText?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.CodeStyleCheckerPy2?1(filename, lines, repeat=False, select="", ignore="", max_line_length=79, hang_closing=False, docType="pep257") +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.CodeStyleCheckerReport.error_args?4(line_number, offset, code, check, *args) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.CodeStyleCheckerReport?1(options) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.codeStyleCheck?4(filename, source, args) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.extractLineFlags?4(line, startComment=") +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.initService?4() +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.check?4(codestring='', onlyFixes={}) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.codeRole?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.filenameRole?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.fixableRole?7 @@ -3757,16 +3762,14 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.positionRole?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.prepare?4(fileList, project) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog.start?4(fn, save=False, repeat=None) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog?1(parent=None) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerReport.error_args?4(line_number, offset, code, check, *args) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerReport?1(options) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.CodeStyleCheckerDialog?1(styleCheckService, parent=None) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCodeSelectionDialog.CodeStyleCodeSelectionDialog.getSelectedCodes?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCodeSelectionDialog.CodeStyleCodeSelectionDialog?1(codes, showFixCodes, parent=None) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer.finalize?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer.fixIssue?4(line, pos, message) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer.mutualStartswith?4(b) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer.saveFile?4(encoding) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer?1(project, filename, sourceLines, fixCodes, noFixCodes, maxLineLength, inPlace) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.CodeStyleFixer?1(filename, sourceLines, fixCodes, noFixCodes, maxLineLength, inPlace, eol) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.FixableCodeStyleIssues?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.IndentationWrapper.SKIP_TOKENS?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.IndentationWrapper.pep8Expected?4() @@ -3779,9 +3782,6 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.Reindenter?1(sourceLines) eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.CodeStyleStatisticsDialog?1(statistics, parent=None) eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.Codes?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.Messages?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.MessagesSampleArgs?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.getMessage?4(code, *args) eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.run?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker.unpackArgs?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleChecker?1(source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257") @@ -3792,15 +3792,13 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleContext.ssource?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleContext.start?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.DocStyleContext?1(source, startLine, contextType) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.PyCF_ONLY_AST?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.CamelcaseRegexp?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.Codes?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.LowercaseRegex?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.Messages?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.MixedcaseRegexp?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.UppercaseRegexp?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.getMessage?4(code, *args) eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.run?4() +eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker.unpackArgs?4() eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.NamingStyleChecker?1(tree, filename, options) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.ARITHMETIC_OP?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.BENCHMARK_KEYS?7 @@ -3884,7 +3882,6 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.explicit_line_join?4(logical_line, tokens) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.extraneous_whitespace?4(logical_line) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.filename_match?4(filename, patterns, default=True) -eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.getMessage?4(code, *args) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.get_parser?4(prog='pep8', version=__version__) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.imports_on_separate_lines?4(logical_line) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.indentation?4(logical_line, previous_logical, indent_char, indent_level, previous_indent_level) @@ -3896,8 +3893,6 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.mute_string?4(text) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.noqa?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.parse_udiff?4(diff, patterns=None, parent='.') -eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.pep8_messages?7 -eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.pep8_messages_sample_args?7 eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.process_options?4(arglist=None, parse_argv=False, config_file=None, parser=None) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.python_3000_backticks?4(logical_line) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.python_3000_has_key?4(logical_line) @@ -3917,6 +3912,21 @@ eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.whitespace_around_operator?4(logical_line) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.whitespace_before_inline_comment?4(logical_line, tokens) eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.whitespace_before_parameters?4(logical_line, tokens) +eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations._messages?8 +eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations._messages_sample_args?8 +eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.getTranslatedMessage?4(message) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.extractLineFlags?4(line, startComment=") +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.initService?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.normalizeCode?4(codestring) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.syntaxAndPyflakesCheck?4(filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.addLanguage?4(lang, path, module, getArgs, getExt, callback, onError) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.getExtensions?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.getLanguages?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.removeLanguage?4(lang) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.syntaxCheck?4(lang, filename, source) +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService.syntaxChecked?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.SyntaxCheckService?1() +eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.check?4(codestring='') eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.errorRole?7 eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.filenameRole?7 eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.indexRole?7 @@ -3929,6 +3939,110 @@ eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.start?4(fn, codestring="") eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog.warningRole?7 eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.SyntaxCheckerDialog?1(parent=None) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.AND?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.ASSIGN?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.AUGASSIGN?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.BOOLOP?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.CLASSDEF?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.COMPREHENSION?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.CONTINUE?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.DICTCOMP?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.EXCEPTHANDLER?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.FOR?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.FUNCTIONDEF?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.GENERATOREXP?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.GLOBAL?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.IMPORT?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.IMPORTFROM?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.LAMBDA?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.LISTCOMP?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.LOAD?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.NAME?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.NONLOCAL?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.NUM?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.RETURN?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.SETCOMP?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.SLICE?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.TRY?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.TRYEXCEPT?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker._customBuiltIns?8 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker._getDoctestExamples?8 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.addArgs?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.addBinding?4(node, value, reportRedef=True) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.builtIns?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.checkDeadScopes?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.checkUnusedAssignments?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.collectLoopVars?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.deferAssignment?4(callable) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.deferFunction?4(callable) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.descendantOf?4(node, ancestors, stop=None) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.differentForks?4(lnode, rnode) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.getCommonAncestor?4(lnode, rnode, stop=None) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.getDocstring?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.getNodeHandler?4(node_class) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleChildren?4(tree) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleDoctests?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleNode?4(node, parent) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleNodeDelete?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleNodeLoad?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.handleNodeStore?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.hasParent?4(node, kind) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.ignore?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.isDocstring?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.nodeDepth?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.offset?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.onFork?4(parent, lnode, rnode, items) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.popScope?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.pushClassScope?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.pushFunctionScope?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.pushScope?4(scopeClass=FunctionScope) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.report?4(messageClass, *args, **kwargs) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.runDeferred?4(deferred) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.runFunction?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.scope?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.traceTree?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker.withDoctest?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Checker?1(tree, filename='(none)', builtins=None) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.FunctionScope.alwaysUsed?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.FunctionScope.usesLocals?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.Scope.importStarred?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker._MAGIC_GLOBALS?8 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.getNodeName?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.getNodeType?4(node_class) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.iter_child_nodes?4(node) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.names?4(self) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.unusedAssignments?4(self) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.DoctestSyntaxError.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.DoctestSyntaxError?1(filename, loc, position=None) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.DuplicateArgument.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.DuplicateArgument?1(filename, loc, name) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.ImportShadowedByLoopVar.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.ImportShadowedByLoopVar?1(filename, loc, name, orig_loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.ImportStarUsed.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.ImportStarUsed?1(filename, loc, modname) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.LateFutureImport.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.LateFutureImport?1(filename, loc, names) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Message.getMessageData?4() +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Message.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Message.message_args?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Message?1(filename, loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.QT_TRANSLATE_NOOP?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Redefined.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.Redefined?1(filename, loc, name, orig_loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.RedefinedInListComp.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.RedefinedInListComp?1(filename, loc, name, orig_loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.RedefinedWhileUnused.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.RedefinedWhileUnused?1(filename, loc, name, orig_loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedExport.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedExport?1(filename, loc, name) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedLocal.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedLocal?1(filename, loc, name, orig_loc) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedName.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UndefinedName?1(filename, loc, name) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UnusedImport.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UnusedImport?1(filename, loc, name) +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UnusedVariable.message?7 +eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.UnusedVariable?1(filename, loc, names) eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.NannyNag.get_line?4() eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.NannyNag.get_lineno?4() eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.NannyNag.get_msg?4() @@ -3942,13 +4056,15 @@ eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.Whitespace?1(ws) eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.check?4(file, text="") eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.format_witnesses?4(w) +eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.initService?4() eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.process_tokens?4(tokens) +eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.check?4(codestring='') eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.on_buttonBox_clicked?4(button) eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.on_resultList_itemActivated?4(itm, col) eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.on_startButton_clicked?4() eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.prepare?4(fileList, project) eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog.start?4(fn) -eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog?1(parent=None) +eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.TabnannyDialog?1(indentCheckService, parent=None) eric5.Plugins.DocumentationPlugins.Ericapi.EricapiConfigDialog.EricapiConfigDialog.accept?4() eric5.Plugins.DocumentationPlugins.Ericapi.EricapiConfigDialog.EricapiConfigDialog.generateParameters?4() eric5.Plugins.DocumentationPlugins.Ericapi.EricapiConfigDialog.EricapiConfigDialog.on_addButton_clicked?4() @@ -4001,6 +4117,8 @@ eric5.Plugins.PluginAbout.version?7 eric5.Plugins.PluginCodeStyleChecker.CodeStyleCheckerPlugin.activate?4() eric5.Plugins.PluginCodeStyleChecker.CodeStyleCheckerPlugin.deactivate?4() +eric5.Plugins.PluginCodeStyleChecker.CodeStyleCheckerPlugin.styleCheck?4(lang, filename, source, args) +eric5.Plugins.PluginCodeStyleChecker.CodeStyleCheckerPlugin.styleChecked?7 eric5.Plugins.PluginCodeStyleChecker.CodeStyleCheckerPlugin?1(ui) eric5.Plugins.PluginCodeStyleChecker.author?7 eric5.Plugins.PluginCodeStyleChecker.autoactivate?7 @@ -4059,6 +4177,8 @@ eric5.Plugins.PluginSyntaxChecker.version?7 eric5.Plugins.PluginTabnanny.TabnannyPlugin.activate?4() eric5.Plugins.PluginTabnanny.TabnannyPlugin.deactivate?4() +eric5.Plugins.PluginTabnanny.TabnannyPlugin.indentCheck?4(lang, filename, source) +eric5.Plugins.PluginTabnanny.TabnannyPlugin.indentChecked?7 eric5.Plugins.PluginTabnanny.TabnannyPlugin?1(ui) eric5.Plugins.PluginTabnanny.author?7 eric5.Plugins.PluginTabnanny.autoactivate?7 @@ -6745,6 +6865,7 @@ eric5.QScintilla.Editor.Editor.getLexer?4() eric5.QScintilla.Editor.Editor.getMenu?4(menuName) eric5.QScintilla.Editor.Editor.getNoName?4() +eric5.QScintilla.Editor.Editor.getPyVersion?4() eric5.QScintilla.Editor.Editor.getSearchText?4(selectionOnly=False) eric5.QScintilla.Editor.Editor.getSharingStatus?4() eric5.QScintilla.Editor.Editor.getSyntaxErrors?4() @@ -6850,7 +6971,7 @@ eric5.QScintilla.Editor.Editor.toggleBookmark?4(line) eric5.QScintilla.Editor.Editor.toggleCommentBlock?4() eric5.QScintilla.Editor.Editor.toggleSyntaxError?4(line, index, error, msg="", show=False) -eric5.QScintilla.Editor.Editor.toggleWarning?4(line, warning, msg="", warningType=WarningCode) +eric5.QScintilla.Editor.Editor.toggleWarning?4(line, col, warning, msg="", warningType=WarningCode) eric5.QScintilla.Editor.Editor.uncommentLine?4() eric5.QScintilla.Editor.Editor.uncommentLineOrSelection?4() eric5.QScintilla.Editor.Editor.uncommentSelection?4() @@ -8066,6 +8187,17 @@ eric5.Utilities.AutoSaver.AutoSaver.saveIfNeccessary?4() eric5.Utilities.AutoSaver.AutoSaver.timerEvent?4(evt) eric5.Utilities.AutoSaver.AutoSaver?1(parent, save) +eric5.Utilities.BackgroundClient.BackgroundClient.backgroundClient?7 +eric5.Utilities.BackgroundClient.BackgroundClient.run?4() +eric5.Utilities.BackgroundClient.BackgroundClient?1(host, port) +eric5.Utilities.BackgroundService.BackgroundService.enqueueRequest?4(fx, lang, fn, data) +eric5.Utilities.BackgroundService.BackgroundService.on_disconnectSocket?4(lang) +eric5.Utilities.BackgroundService.BackgroundService.on_newConnection?4() +eric5.Utilities.BackgroundService.BackgroundService.serviceConnect?4(fx, lang, modulepath, module, callback, onErrorCallback=None) +eric5.Utilities.BackgroundService.BackgroundService.serviceDisconnect?4(fx, lang) +eric5.Utilities.BackgroundService.BackgroundService.serviceNotAvailable?7 +eric5.Utilities.BackgroundService.BackgroundService.shutdown?4() +eric5.Utilities.BackgroundService.BackgroundService?1() eric5.Utilities.ClassBrowsers.ClbrBaseClasses.Attribute.addAssignment?4(lineno) eric5.Utilities.ClassBrowsers.ClbrBaseClasses.Attribute?1(module, name, file, lineno) eric5.Utilities.ClassBrowsers.ClbrBaseClasses.Class?1(module, name, super, file, lineno) @@ -8216,13 +8348,6 @@ eric5.Utilities.PasswordChecker.PasswordChecker.Status_Passed?7 eric5.Utilities.PasswordChecker.PasswordChecker.checkPassword?4(password) eric5.Utilities.PasswordChecker.PasswordChecker?1() -eric5.Utilities.SyntaxCheck.codingBytes_regexps?7 -eric5.Utilities.SyntaxCheck.compile_and_check?4(file_, codestring="", checkFlakes=True, ignoreStarImportWarnings=False) -eric5.Utilities.SyntaxCheck.decode?4(text) -eric5.Utilities.SyntaxCheck.extractLineFlags?4(line, startComment=") -eric5.Utilities.SyntaxCheck.get_codingBytes?4(text) -eric5.Utilities.SyntaxCheck.normalizeCode?4(codestring) -eric5.Utilities.SyntaxCheck.readEncodedFile?4(filename) eric5.Utilities._escape?8 eric5.Utilities._escape_map?8 eric5.Utilities._percentReplacementFunc?5(matchobj) @@ -8288,6 +8413,7 @@ eric5.Utilities.binplistlib.writePlist?4(rootObject, pathOrFile, binary=True) eric5.Utilities.binplistlib.writePlistToBytes?4(rootObject, binary=True) eric5.Utilities.checkPyside?4() +eric5.Utilities.codingBytes_regexps?7 eric5.Utilities.coding_regexps?7 eric5.Utilities.compactPath?4(path, width, measure=len) eric5.Utilities.compatibility_fixes.File.fp?7 @@ -8298,8 +8424,6 @@ eric5.Utilities.compatibility_fixes.File.write?4(txt) eric5.Utilities.compatibility_fixes.File?1(filein, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) eric5.Utilities.compatibility_fixes.open?4(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True) -eric5.Utilities.compile?4(file, codestring="", isPy2=False) -eric5.Utilities.compile_extern?4(file, isPy2, checkFlakes=True, ignoreStarImportWarnings=False) eric5.Utilities.configDir?7 eric5.Utilities.convertLineEnds?4(text, eol) eric5.Utilities.crypto.CryptoMarker?7 @@ -8337,14 +8461,17 @@ eric5.Utilities.crypto.py3PBKDF2.pbkdf2?4(password, salt, iterations, digestMod) eric5.Utilities.crypto.py3PBKDF2.rehashPassword?4(password, hashParameters) eric5.Utilities.crypto.py3PBKDF2.verifyPassword?4(password, hash) +eric5.Utilities.decode?4(text) eric5.Utilities.decodeBytes?4(buffer) eric5.Utilities.decodeString?4(text) +eric5.Utilities.determinePythonVersion?4(filename, source, editor=None) eric5.Utilities.direntries?4(path, filesonly=False, pattern=None, followsymlinks=True, checkStop=None) eric5.Utilities.encode?4(text, orig_coding) eric5.Utilities.escape_entities?4(m, map=_escape_map) eric5.Utilities.escape_uentities?4(m) eric5.Utilities.extractFlags?4(text) eric5.Utilities.extractFlagsFromFile?4(filename) +eric5.Utilities.extractLineFlags?4(line, startComment=") eric5.Utilities.fromNativeSeparators?4(path) eric5.Utilities.generateDistroInfo?4(linesep='\n') eric5.Utilities.generatePluginsVersionInfo?4(linesep='\n') @@ -8365,6 +8492,7 @@ eric5.Utilities.getTestFileName?4(fn) eric5.Utilities.getUserName?4() eric5.Utilities.get_coding?4(text) +eric5.Utilities.get_codingBytes?4(text) eric5.Utilities.hasEnvironmentEntry?4(key) eric5.Utilities.html_encode?4(text, pattern=_escape) eric5.Utilities.html_udecode?4(text, pattern=_uunescape) @@ -8382,185 +8510,8 @@ eric5.Utilities.parseOptionString?4(s) eric5.Utilities.parseString?4(s, rx) eric5.Utilities.prepareQtMacBundle?4(toolname, version, args) -eric5.Utilities.py2flakes.checker.Binding?1(name, source) -eric5.Utilities.py2flakes.checker.Checker.AND?7 -eric5.Utilities.py2flakes.checker.Checker.ASSIGN?4(node) -eric5.Utilities.py2flakes.checker.Checker.AUGASSIGN?4(node) -eric5.Utilities.py2flakes.checker.Checker.BOOLOP?7 -eric5.Utilities.py2flakes.checker.Checker.CLASSDEF?4(node) -eric5.Utilities.py2flakes.checker.Checker.COMPREHENSION?7 -eric5.Utilities.py2flakes.checker.Checker.CONTINUE?7 -eric5.Utilities.py2flakes.checker.Checker.DICTCOMP?4(node) -eric5.Utilities.py2flakes.checker.Checker.EXCEPTHANDLER?4(node) -eric5.Utilities.py2flakes.checker.Checker.FOR?4(node) -eric5.Utilities.py2flakes.checker.Checker.FUNCTIONDEF?4(node) -eric5.Utilities.py2flakes.checker.Checker.GENERATOREXP?7 -eric5.Utilities.py2flakes.checker.Checker.GLOBAL?4(node) -eric5.Utilities.py2flakes.checker.Checker.IMPORT?4(node) -eric5.Utilities.py2flakes.checker.Checker.IMPORTFROM?4(node) -eric5.Utilities.py2flakes.checker.Checker.LAMBDA?4(node) -eric5.Utilities.py2flakes.checker.Checker.LISTCOMP?4(node) -eric5.Utilities.py2flakes.checker.Checker.LOAD?7 -eric5.Utilities.py2flakes.checker.Checker.NAME?4(node) -eric5.Utilities.py2flakes.checker.Checker.NONLOCAL?7 -eric5.Utilities.py2flakes.checker.Checker.NUM?7 -eric5.Utilities.py2flakes.checker.Checker.RETURN?7 -eric5.Utilities.py2flakes.checker.Checker.SLICE?7 -eric5.Utilities.py2flakes.checker.Checker.addArgs?4() -eric5.Utilities.py2flakes.checker.Checker.addBinding?4(node, value, reportRedef=True) -eric5.Utilities.py2flakes.checker.Checker.builtIns?7 -eric5.Utilities.py2flakes.checker.Checker.checkDeadScopes?4() -eric5.Utilities.py2flakes.checker.Checker.checkUnusedAssignments?4() -eric5.Utilities.py2flakes.checker.Checker.collectLoopVars?4() -eric5.Utilities.py2flakes.checker.Checker.deferAssignment?4(callable) -eric5.Utilities.py2flakes.checker.Checker.deferFunction?4(callable) -eric5.Utilities.py2flakes.checker.Checker.descendantOf?4(node, ancestors, stop=None) -eric5.Utilities.py2flakes.checker.Checker.differentForks?4(lnode, rnode) -eric5.Utilities.py2flakes.checker.Checker.getCommonAncestor?4(lnode, rnode, stop=None) -eric5.Utilities.py2flakes.checker.Checker.handleChildren?4(tree) -eric5.Utilities.py2flakes.checker.Checker.handleNode?4(node, parent) -eric5.Utilities.py2flakes.checker.Checker.handleNodeDelete?4(node) -eric5.Utilities.py2flakes.checker.Checker.handleNodeLoad?4(node) -eric5.Utilities.py2flakes.checker.Checker.handleNodeStore?4(node) -eric5.Utilities.py2flakes.checker.Checker.hasParent?4(node, kind) -eric5.Utilities.py2flakes.checker.Checker.ignore?4(node) -eric5.Utilities.py2flakes.checker.Checker.isDocstring?4(node) -eric5.Utilities.py2flakes.checker.Checker.nodeDepth?7 -eric5.Utilities.py2flakes.checker.Checker.onFork?4(parent, lnode, rnode, items) -eric5.Utilities.py2flakes.checker.Checker.popScope?4() -eric5.Utilities.py2flakes.checker.Checker.pushClassScope?4() -eric5.Utilities.py2flakes.checker.Checker.pushFunctionScope?4() -eric5.Utilities.py2flakes.checker.Checker.report?4(messageClass, *args, **kwargs) -eric5.Utilities.py2flakes.checker.Checker.runDeferred?4(deferred) -eric5.Utilities.py2flakes.checker.Checker.runFunction?4() -eric5.Utilities.py2flakes.checker.Checker.scope?4() -eric5.Utilities.py2flakes.checker.Checker.traceTree?7 -eric5.Utilities.py2flakes.checker.Checker?1(tree, filename='(none)', builtins=None) -eric5.Utilities.py2flakes.checker.ExportBinding.names?4() -eric5.Utilities.py2flakes.checker.FunctionScope?1() -eric5.Utilities.py2flakes.checker.Importation?1(name, source) -eric5.Utilities.py2flakes.checker.Scope.importStarred?7 -eric5.Utilities.py2flakes.checker.Scope.usesLocals?7 -eric5.Utilities.py2flakes.checker._MAGIC_GLOBALS?8 -eric5.Utilities.py2flakes.checker.getNodeName?4(node) -eric5.Utilities.py2flakes.checker.iter_child_nodes?4(node, astcls=ast.AST) -eric5.Utilities.py2flakes.messages.DuplicateArgument.message?7 -eric5.Utilities.py2flakes.messages.DuplicateArgument?1(filename, lineno, name) -eric5.Utilities.py2flakes.messages.ImportShadowedByLoopVar.message?7 -eric5.Utilities.py2flakes.messages.ImportShadowedByLoopVar?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py2flakes.messages.ImportStarUsed.message?7 -eric5.Utilities.py2flakes.messages.ImportStarUsed?1(filename, lineno, modname) -eric5.Utilities.py2flakes.messages.LateFutureImport.message?7 -eric5.Utilities.py2flakes.messages.LateFutureImport?1(filename, lineno, names) -eric5.Utilities.py2flakes.messages.Message.getMessageData?4() -eric5.Utilities.py2flakes.messages.Message.message?7 -eric5.Utilities.py2flakes.messages.Message.message_args?7 -eric5.Utilities.py2flakes.messages.Message?1(filename, lineno) -eric5.Utilities.py2flakes.messages.QT_TRANSLATE_NOOP?4(mod, txt) -eric5.Utilities.py2flakes.messages.Redefined.message?7 -eric5.Utilities.py2flakes.messages.Redefined?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py2flakes.messages.RedefinedInListComp.message?7 -eric5.Utilities.py2flakes.messages.RedefinedInListComp?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py2flakes.messages.RedefinedWhileUnused.message?7 -eric5.Utilities.py2flakes.messages.RedefinedWhileUnused?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py2flakes.messages.UndefinedExport.message?7 -eric5.Utilities.py2flakes.messages.UndefinedExport?1(filename, lineno, name) -eric5.Utilities.py2flakes.messages.UndefinedLocal.message?7 -eric5.Utilities.py2flakes.messages.UndefinedLocal?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py2flakes.messages.UndefinedName.message?7 -eric5.Utilities.py2flakes.messages.UndefinedName?1(filename, lineno, name) -eric5.Utilities.py2flakes.messages.UnusedImport.message?7 -eric5.Utilities.py2flakes.messages.UnusedImport?1(filename, lineno, name) -eric5.Utilities.py2flakes.messages.UnusedVariable.message?7 -eric5.Utilities.py2flakes.messages.UnusedVariable?1(filename, lineno, names) -eric5.Utilities.py3flakes.checker.Binding?1(name, source) -eric5.Utilities.py3flakes.checker.Checker.ASSIGN?4(node) -eric5.Utilities.py3flakes.checker.Checker.ATTRIBUTES?7 -eric5.Utilities.py3flakes.checker.Checker.AUGASSIGN?4(node) -eric5.Utilities.py3flakes.checker.Checker.BOOLOP?7 -eric5.Utilities.py3flakes.checker.Checker.CALL?7 -eric5.Utilities.py3flakes.checker.Checker.CLASSDEF?4(node) -eric5.Utilities.py3flakes.checker.Checker.COMPREHENSION?7 -eric5.Utilities.py3flakes.checker.Checker.DICTCOMP?4(node) -eric5.Utilities.py3flakes.checker.Checker.EXCEPTHANDLER?4(node) -eric5.Utilities.py3flakes.checker.Checker.FOR?4(node) -eric5.Utilities.py3flakes.checker.Checker.FUNCTIONDEF?4(node) -eric5.Utilities.py3flakes.checker.Checker.GLOBAL?4(node) -eric5.Utilities.py3flakes.checker.Checker.IMPORT?4(node) -eric5.Utilities.py3flakes.checker.Checker.IMPORTFROM?4(node) -eric5.Utilities.py3flakes.checker.Checker.INVERT?7 -eric5.Utilities.py3flakes.checker.Checker.ISNOT?7 -eric5.Utilities.py3flakes.checker.Checker.LAMBDA?4(node) -eric5.Utilities.py3flakes.checker.Checker.LISTCOMP?4(node) -eric5.Utilities.py3flakes.checker.Checker.LOAD?7 -eric5.Utilities.py3flakes.checker.Checker.MOD?7 -eric5.Utilities.py3flakes.checker.Checker.NAME?4(node) -eric5.Utilities.py3flakes.checker.Checker.NONLOCAL?7 -eric5.Utilities.py3flakes.checker.Checker.PASS?7 -eric5.Utilities.py3flakes.checker.Checker.RETURN?7 -eric5.Utilities.py3flakes.checker.Checker.SETCOMP?7 -eric5.Utilities.py3flakes.checker.Checker.SLICE?7 -eric5.Utilities.py3flakes.checker.Checker.STARRED?4(node) -eric5.Utilities.py3flakes.checker.Checker.TRY?7 -eric5.Utilities.py3flakes.checker.Checker._runDeferred?5(deferred) -eric5.Utilities.py3flakes.checker.Checker.addArgs?4() -eric5.Utilities.py3flakes.checker.Checker.addBinding?4(lineno, value, reportRedef=True) -eric5.Utilities.py3flakes.checker.Checker.checkUnusedAssignments?4() -eric5.Utilities.py3flakes.checker.Checker.check_dead_scopes?4() -eric5.Utilities.py3flakes.checker.Checker.collectLoopVars?4() -eric5.Utilities.py3flakes.checker.Checker.deferAssignment?4(callable) -eric5.Utilities.py3flakes.checker.Checker.deferFunction?4(callable) -eric5.Utilities.py3flakes.checker.Checker.handleAssignName?4(node) -eric5.Utilities.py3flakes.checker.Checker.handleBody?4(tree) -eric5.Utilities.py3flakes.checker.Checker.handleChildren?4(tree) -eric5.Utilities.py3flakes.checker.Checker.handleNode?4(node, parent) -eric5.Utilities.py3flakes.checker.Checker.ignore?4(node) -eric5.Utilities.py3flakes.checker.Checker.isDocstring?4(node) -eric5.Utilities.py3flakes.checker.Checker.nodeDepth?7 -eric5.Utilities.py3flakes.checker.Checker.popScope?4() -eric5.Utilities.py3flakes.checker.Checker.pushClassScope?4() -eric5.Utilities.py3flakes.checker.Checker.pushFunctionScope?4() -eric5.Utilities.py3flakes.checker.Checker.report?4(messageClass, *args, **kwargs) -eric5.Utilities.py3flakes.checker.Checker.runFunction?4() -eric5.Utilities.py3flakes.checker.Checker.scope?4() -eric5.Utilities.py3flakes.checker.Checker.scope?7 -eric5.Utilities.py3flakes.checker.Checker.traceTree?7 -eric5.Utilities.py3flakes.checker.Checker?1(module, filename='(none)') -eric5.Utilities.py3flakes.checker.ExportBinding.names?4() -eric5.Utilities.py3flakes.checker.FunctionDefinition.is_property?7 -eric5.Utilities.py3flakes.checker.FunctionScope?1() -eric5.Utilities.py3flakes.checker.Importation?1(name, source) -eric5.Utilities.py3flakes.checker.Scope.importStarred?7 -eric5.Utilities.py3flakes.checker.Scope?1() -eric5.Utilities.py3flakes.checker._MAGIC_GLOBALS?8 -eric5.Utilities.py3flakes.messages.DuplicateArgument.message?7 -eric5.Utilities.py3flakes.messages.DuplicateArgument?1(filename, lineno, name) -eric5.Utilities.py3flakes.messages.ImportShadowedByLoopVar.message?7 -eric5.Utilities.py3flakes.messages.ImportShadowedByLoopVar?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py3flakes.messages.ImportStarUsed.message?7 -eric5.Utilities.py3flakes.messages.ImportStarUsed?1(filename, lineno, modname) -eric5.Utilities.py3flakes.messages.LateFutureImport.message?7 -eric5.Utilities.py3flakes.messages.LateFutureImport?1(filename, lineno, names) -eric5.Utilities.py3flakes.messages.Message.getMessageData?4() -eric5.Utilities.py3flakes.messages.Message.message?7 -eric5.Utilities.py3flakes.messages.Message.message_args?7 -eric5.Utilities.py3flakes.messages.Message?1(filename, lineno) -eric5.Utilities.py3flakes.messages.QT_TRANSLATE_NOOP?4(mod, txt) -eric5.Utilities.py3flakes.messages.RedefinedFunction.message?7 -eric5.Utilities.py3flakes.messages.RedefinedFunction?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py3flakes.messages.RedefinedWhileUnused.message?7 -eric5.Utilities.py3flakes.messages.RedefinedWhileUnused?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py3flakes.messages.UndefinedExport.message?7 -eric5.Utilities.py3flakes.messages.UndefinedExport?1(filename, lineno, name) -eric5.Utilities.py3flakes.messages.UndefinedLocal.message?7 -eric5.Utilities.py3flakes.messages.UndefinedLocal?1(filename, lineno, name, orig_lineno) -eric5.Utilities.py3flakes.messages.UndefinedName.message?7 -eric5.Utilities.py3flakes.messages.UndefinedName?1(filename, lineno, name) -eric5.Utilities.py3flakes.messages.UnusedImport.message?7 -eric5.Utilities.py3flakes.messages.UnusedImport?1(filename, lineno, name) -eric5.Utilities.py3flakes.messages.UnusedVariable.message?7 -eric5.Utilities.py3flakes.messages.UnusedVariable?1(filename, lineno, name) eric5.Utilities.quote?4(url) +eric5.Utilities.readEncodedFile?4(filename) eric5.Utilities.readEncodedFileWithHash?4(filename) eric5.Utilities.readStringFromStream?4(stream) eric5.Utilities.relpath?4(path, start=os.path.curdir) @@ -8579,152 +8530,6 @@ eric5.Utilities.win32_Kill?4(pid) eric5.Utilities.win32_getRealName?4() eric5.Utilities.writeEncodedFile?4(filename, text, orig_coding) -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.docType?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.error_args?4(line_number, offset, code, check, *args) -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.filename?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.hang_closing?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.ignore?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.max_line_length?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.repeat?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport.select?7 -eric5.UtilitiesPython2.CodeStyleChecker.CodeStyleReport?1(options) -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleChecker.Codes?7 -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleChecker.run?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleChecker.unpackArgs?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleChecker?1(source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257") -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.contextType?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.end?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.indent?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.source?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.ssource?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext.start?4() -eric5.UtilitiesPython2.DocStyleCheckerPy2.DocStyleContext?1(source, startLine, contextType) -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.CamelcaseRegexp?7 -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.Codes?7 -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.LowercaseRegex?7 -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.MixedcaseRegexp?7 -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.UppercaseRegexp?7 -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.run?4() -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker.unpackArgs?4() -eric5.UtilitiesPython2.NamingStyleCheckerPy2.NamingStyleChecker?1(tree, filename, options) -eric5.UtilitiesPython2.Tools.coding_regexps?7 -eric5.UtilitiesPython2.Tools.decode?4(text) -eric5.UtilitiesPython2.Tools.extractLineFlags?4(line, startComment=") -eric5.UtilitiesPython2.Tools.get_coding?4(text) -eric5.UtilitiesPython2.Tools.normalizeCode?4(codestring) -eric5.UtilitiesPython2.Tools.readEncodedFile?4(filename) -eric5.UtilitiesPython2.pep8.ARITHMETIC_OP?7 -eric5.UtilitiesPython2.pep8.BENCHMARK_KEYS?7 -eric5.UtilitiesPython2.pep8.BaseReport.error?4(line_number, offset, text, check) -eric5.UtilitiesPython2.pep8.BaseReport.error_args?4(line_number, offset, code, check, *args) -eric5.UtilitiesPython2.pep8.BaseReport.get_count?4(prefix='') -eric5.UtilitiesPython2.pep8.BaseReport.get_file_results?4() -eric5.UtilitiesPython2.pep8.BaseReport.get_statistics?4(prefix='') -eric5.UtilitiesPython2.pep8.BaseReport.increment_logical_line?4() -eric5.UtilitiesPython2.pep8.BaseReport.init_file?4(filename, lines, expected, line_offset) -eric5.UtilitiesPython2.pep8.BaseReport.print_benchmark?4() -eric5.UtilitiesPython2.pep8.BaseReport.print_filename?7 -eric5.UtilitiesPython2.pep8.BaseReport.print_statistics?4(prefix='') -eric5.UtilitiesPython2.pep8.BaseReport.start?4() -eric5.UtilitiesPython2.pep8.BaseReport.stop?4() -eric5.UtilitiesPython2.pep8.BaseReport?1(options) -eric5.UtilitiesPython2.pep8.COMMENT_WITH_NL?7 -eric5.UtilitiesPython2.pep8.COMPARE_SINGLETON_REGEX?7 -eric5.UtilitiesPython2.pep8.COMPARE_TYPE_REGEX?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_ast?4() -eric5.UtilitiesPython2.pep8.Checker.check_logical?4() -eric5.UtilitiesPython2.pep8.Checker.check_physical?4(line) -eric5.UtilitiesPython2.pep8.Checker.generate_tokens?4() -eric5.UtilitiesPython2.pep8.Checker.readline?4() -eric5.UtilitiesPython2.pep8.Checker.readline_check_physical?4() -eric5.UtilitiesPython2.pep8.Checker.report_invalid_syntax?4() -eric5.UtilitiesPython2.pep8.Checker.run_check?4(check, argument_names) -eric5.UtilitiesPython2.pep8.Checker?1(filename=None, lines=None, options=None, report=None, **kwargs) -eric5.UtilitiesPython2.pep8.DEFAULT_EXCLUDE?7 -eric5.UtilitiesPython2.pep8.DEFAULT_IGNORE?7 -eric5.UtilitiesPython2.pep8.DOCSTRING_REGEX?7 -eric5.UtilitiesPython2.pep8.DiffReport.error?4(line_number, offset, text, check) -eric5.UtilitiesPython2.pep8.DiffReport?1(options) -eric5.UtilitiesPython2.pep8.ERRORCODE_REGEX?7 -eric5.UtilitiesPython2.pep8.EXTRANEOUS_WHITESPACE_REGEX?7 -eric5.UtilitiesPython2.pep8.FileReport.print_filename?7 -eric5.UtilitiesPython2.pep8.HUNK_REGEX?7 -eric5.UtilitiesPython2.pep8.INDENT_REGEX?7 -eric5.UtilitiesPython2.pep8.KEYWORDS?7 -eric5.UtilitiesPython2.pep8.KEYWORD_REGEX?7 -eric5.UtilitiesPython2.pep8.LAMBDA_REGEX?7 -eric5.UtilitiesPython2.pep8.MAX_LINE_LENGTH?7 -eric5.UtilitiesPython2.pep8.OPERATOR_REGEX?7 -eric5.UtilitiesPython2.pep8.PROJECT_CONFIG?7 -eric5.UtilitiesPython2.pep8.PyCF_ONLY_AST?7 -eric5.UtilitiesPython2.pep8.RAISE_COMMA_REGEX?7 -eric5.UtilitiesPython2.pep8.REPORT_FORMAT?7 -eric5.UtilitiesPython2.pep8.RERAISE_COMMA_REGEX?7 -eric5.UtilitiesPython2.pep8.SINGLETONS?7 -eric5.UtilitiesPython2.pep8.SKIP_TOKENS?7 -eric5.UtilitiesPython2.pep8.StandardReport.error?4(line_number, offset, text, check) -eric5.UtilitiesPython2.pep8.StandardReport.error_args?4(line_number, offset, code, check, *args) -eric5.UtilitiesPython2.pep8.StandardReport.get_file_results?4() -eric5.UtilitiesPython2.pep8.StandardReport.init_file?4(filename, lines, expected, line_offset) -eric5.UtilitiesPython2.pep8.StandardReport?1(options) -eric5.UtilitiesPython2.pep8.StyleGuide.check_files?4(paths=None) -eric5.UtilitiesPython2.pep8.StyleGuide.excluded?4(filename, parent=None) -eric5.UtilitiesPython2.pep8.StyleGuide.get_checks?4(argument_name) -eric5.UtilitiesPython2.pep8.StyleGuide.ignore_code?4(code) -eric5.UtilitiesPython2.pep8.StyleGuide.init_report?4(reporter=None) -eric5.UtilitiesPython2.pep8.StyleGuide.input_dir?4(dirname) -eric5.UtilitiesPython2.pep8.StyleGuide.input_file?4(filename, lines=None, expected=None, line_offset=0) -eric5.UtilitiesPython2.pep8.StyleGuide?1(*args, **kwargs) -eric5.UtilitiesPython2.pep8.TESTSUITE_PATH?7 -eric5.UtilitiesPython2.pep8.UNARY_OPERATORS?7 -eric5.UtilitiesPython2.pep8.WHITESPACE?7 -eric5.UtilitiesPython2.pep8.WHITESPACE_AFTER_COMMA_REGEX?7 -eric5.UtilitiesPython2.pep8.WS_NEEDED_OPERATORS?7 -eric5.UtilitiesPython2.pep8.WS_OPTIONAL_OPERATORS?7 -eric5.UtilitiesPython2.pep8._add_check?5(check, kind, codes, args) -eric5.UtilitiesPython2.pep8._checks?8 -eric5.UtilitiesPython2.pep8._main?5() -eric5.UtilitiesPython2.pep8.blank_lines?4(logical_line, blank_lines, indent_level, line_number, previous_logical, previous_indent_level) -eric5.UtilitiesPython2.pep8.comparison_to_singleton?4(logical_line, noqa) -eric5.UtilitiesPython2.pep8.comparison_type?4(logical_line) -eric5.UtilitiesPython2.pep8.compound_statements?4(logical_line) -eric5.UtilitiesPython2.pep8.continued_indentation?4(logical_line, tokens, indent_level, hang_closing, noqa, verbose) -eric5.UtilitiesPython2.pep8.expand_indent?4(line) -eric5.UtilitiesPython2.pep8.explicit_line_join?4(logical_line, tokens) -eric5.UtilitiesPython2.pep8.extraneous_whitespace?4(logical_line) -eric5.UtilitiesPython2.pep8.filename_match?4(filename, patterns, default=True) -eric5.UtilitiesPython2.pep8.get_parser?4(prog='pep8', version=__version__) -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.init_checks_registry?4() -eric5.UtilitiesPython2.pep8.maximum_line_length?4(physical_line, max_line_length) -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.noqa?7 -eric5.UtilitiesPython2.pep8.parse_udiff?4(diff, patterns=None, parent='.') -eric5.UtilitiesPython2.pep8.process_options?4(arglist=None, parse_argv=False, config_file=None, parser=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.read_config?4(options, args, arglist, parser) -eric5.UtilitiesPython2.pep8.readlines?4(filename) -eric5.UtilitiesPython2.pep8.register_check?4(check, codes=None) -eric5.UtilitiesPython2.pep8.stdin_get_value?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_keywords?4(logical_line) -eric5.UtilitiesPython2.pep8.whitespace_around_named_parameter_equals?4(logical_line, tokens) -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/APIs/Python3/eric5.bas Sun Jan 05 23:22:17 2014 +0100 +++ b/APIs/Python3/eric5.bas Sun Mar 30 22:00:14 2014 +0200 @@ -30,6 +30,7 @@ Attribute ClbrBaseClasses.Attribute VisibilityMixin AuthenticationDialog QDialog Ui_AuthenticationDialog AutoSaver QObject +BackgroundService QTcpServer BinaryModel QAbstractTableModel BookmarkActionSelectionDialog QDialog Ui_BookmarkActionSelectionDialog BookmarkInfoDialog QDialog Ui_BookmarkInfoDialog @@ -78,8 +79,6 @@ CodeStyleCheckerPlugin QObject CodeStyleCheckerReport pep8.BaseReport CodeStyleCodeSelectionDialog QDialog Ui_CodeStyleCodeSelectionDialog -CodeStyleFixer QObject -CodeStyleReport pep8.BaseReport CodeStyleStatisticsDialog QDialog Ui_CodeStyleStatisticsDialog Coding ClbrBase CodingError Exception @@ -134,6 +133,7 @@ DiffReport StandardReport DiffWindow E5MainWindow DirectorySyncHandler SyncHandler +DoctestSyntaxError Message DownloadAskActionDialog QDialog Ui_DownloadAskActionDialog DownloadItem QWidget Ui_DownloadItem DownloadManager QDialog Ui_DownloadManager @@ -261,8 +261,9 @@ FtpReply QNetworkReply FtpSyncHandler SyncHandler Function ClbrBaseClasses.Function VisibilityMixin -FunctionDefinition Binding +FunctionDefinition Definition FunctionScope Scope +GeneratorScope Scope GotoDialog QDialog Ui_GotoDialog Gpg HgExtension GpgProjectHelper HgExtensionProjectHelper @@ -575,7 +576,6 @@ RebaseProjectHelper HgExtensionProjectHelper RecursionError OverflowError ValueError Redefined Message -RedefinedFunction Message RedefinedInListComp Message RedefinedWhileUnused Message Redirector QObject @@ -669,6 +669,7 @@ SyncHandler QObject SyncHostTypePage QWizardPage Ui_SyncHostTypePage SyncManager QObject +SyntaxCheckService QObject SyntaxCheckerDialog QDialog Ui_SyntaxCheckerDialog SyntaxCheckerPlugin QObject TRPreviewer E5MainWindow @@ -713,7 +714,6 @@ UMLItem QGraphicsRectItem UMLSceneSizeDialog QDialog Ui_UMLSceneSizeDialog Uid int -UnBinding Binding UndefinedExport Message UndefinedLocal Message UndefinedName Message
--- a/Debugger/DebugUI.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Debugger/DebugUI.py Sun Mar 30 22:00:14 2014 +0200 @@ -871,7 +871,7 @@ if editor is None: return - if editor.isPy3File() or editor.isPy2File() or editor.isRubyFile(): + if editor.getPyVersion() or editor.isRubyFile(): if editor.curLineHasBreakpoint(): self.dbgEditBpAct.setEnabled(True) else:
--- a/Documentation/Help/source.qhp Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Help/source.qhp Sun Mar 30 22:00:14 2014 +0200 @@ -462,8 +462,15 @@ <section title="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html" /> <section title="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html" /> <section title="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html" /> + <section title="eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html" /> </section> <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker" ref="index-eric5.Plugins.CheckerPlugins.SyntaxChecker.html"> + <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes" ref="index-eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.html"> + <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html" /> + <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html" /> + </section> + <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html" /> + <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html" /> <section title="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html" /> </section> <section title="eric5.Plugins.CheckerPlugins.Tabnanny" ref="index-eric5.Plugins.CheckerPlugins.Tabnanny.html"> @@ -953,32 +960,18 @@ <section title="eric5.Utilities.crypto.py3AES" ref="eric5.Utilities.crypto.py3AES.html" /> <section title="eric5.Utilities.crypto.py3PBKDF2" ref="eric5.Utilities.crypto.py3PBKDF2.html" /> </section> - <section title="eric5.Utilities.py2flakes" ref="index-eric5.Utilities.py2flakes.html"> - <section title="eric5.Utilities.py2flakes.checker" ref="eric5.Utilities.py2flakes.checker.html" /> - <section title="eric5.Utilities.py2flakes.messages" ref="eric5.Utilities.py2flakes.messages.html" /> - </section> - <section title="eric5.Utilities.py3flakes" ref="index-eric5.Utilities.py3flakes.html"> - <section title="eric5.Utilities.py3flakes.checker" ref="eric5.Utilities.py3flakes.checker.html" /> - <section title="eric5.Utilities.py3flakes.messages" ref="eric5.Utilities.py3flakes.messages.html" /> - </section> <section title="eric5.Utilities.AutoSaver" ref="eric5.Utilities.AutoSaver.html" /> + <section title="eric5.Utilities.BackgroundClient" ref="eric5.Utilities.BackgroundClient.html" /> + <section title="eric5.Utilities.BackgroundService" ref="eric5.Utilities.BackgroundService.html" /> <section title="eric5.Utilities.FtpUtilities" ref="eric5.Utilities.FtpUtilities.html" /> <section title="eric5.Utilities.ModuleParser" ref="eric5.Utilities.ModuleParser.html" /> <section title="eric5.Utilities.PasswordChecker" ref="eric5.Utilities.PasswordChecker.html" /> <section title="eric5.Utilities.PySideImporter" ref="eric5.Utilities.PySideImporter.html" /> - <section title="eric5.Utilities.SyntaxCheck" ref="eric5.Utilities.SyntaxCheck.html" /> <section title="eric5.Utilities.__init__" ref="eric5.Utilities.__init__.html" /> <section title="eric5.Utilities.binplistlib" ref="eric5.Utilities.binplistlib.html" /> <section title="eric5.Utilities.compatibility_fixes" ref="eric5.Utilities.compatibility_fixes.html" /> <section title="eric5.Utilities.uic" ref="eric5.Utilities.uic.html" /> </section> - <section title="eric5.UtilitiesPython2" ref="index-eric5.UtilitiesPython2.html"> - <section title="eric5.UtilitiesPython2.CodeStyleChecker" ref="eric5.UtilitiesPython2.CodeStyleChecker.html" /> - <section title="eric5.UtilitiesPython2.DocStyleCheckerPy2" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html" /> - <section title="eric5.UtilitiesPython2.NamingStyleCheckerPy2" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.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" /> <section title="eric5.VCS.ProjectBrowserHelper" ref="eric5.VCS.ProjectBrowserHelper.html" /> @@ -1337,8 +1330,7 @@ <keyword name="ApplicationPage (Constructor)" id="ApplicationPage (Constructor)" ref="eric5.Preferences.ConfigurationPages.ApplicationPage.html#ApplicationPage.__init__" /> <keyword name="ApplicationPage (Module)" id="ApplicationPage (Module)" ref="eric5.Preferences.ConfigurationPages.ApplicationPage.html" /> <keyword name="ApplicationPage.save" id="ApplicationPage.save" ref="eric5.Preferences.ConfigurationPages.ApplicationPage.html#ApplicationPage.save" /> - <keyword name="Argument" id="Argument" ref="eric5.Utilities.py2flakes.checker.html#Argument" /> - <keyword name="Argument" id="Argument" ref="eric5.Utilities.py3flakes.checker.html#Argument" /> + <keyword name="Argument" id="Argument" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Argument" /> <keyword name="ArgumentsError" id="ArgumentsError" ref="eric5.E5Gui.E5Action.html#ArgumentsError" /> <keyword name="ArgumentsError (Constructor)" id="ArgumentsError (Constructor)" ref="eric5.E5Gui.E5Action.html#ArgumentsError.__init__" /> <keyword name="ArgumentsError.__repr__" id="ArgumentsError.__repr__" ref="eric5.E5Gui.E5Action.html#ArgumentsError.__repr__" /> @@ -1346,8 +1338,7 @@ <keyword name="ArrayElementVarItem" id="ArrayElementVarItem" ref="eric5.Debugger.VariablesViewer.html#ArrayElementVarItem" /> <keyword name="ArrayElementVarItem (Constructor)" id="ArrayElementVarItem (Constructor)" ref="eric5.Debugger.VariablesViewer.html#ArrayElementVarItem.__init__" /> <keyword name="ArrayElementVarItem.key" id="ArrayElementVarItem.key" ref="eric5.Debugger.VariablesViewer.html#ArrayElementVarItem.key" /> - <keyword name="Assignment" id="Assignment" ref="eric5.Utilities.py2flakes.checker.html#Assignment" /> - <keyword name="Assignment" id="Assignment" ref="eric5.Utilities.py3flakes.checker.html#Assignment" /> + <keyword name="Assignment" id="Assignment" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Assignment" /> <keyword name="AssociationItem" id="AssociationItem" ref="eric5.Graphics.AssociationItem.html#AssociationItem" /> <keyword name="AssociationItem (Constructor)" id="AssociationItem (Constructor)" ref="eric5.Graphics.AssociationItem.html#AssociationItem.__init__" /> <keyword name="AssociationItem (Module)" id="AssociationItem (Module)" ref="eric5.Graphics.AssociationItem.html" /> @@ -1464,32 +1455,40 @@ <keyword name="AutoSaver.changeOccurred" id="AutoSaver.changeOccurred" ref="eric5.Utilities.AutoSaver.html#AutoSaver.changeOccurred" /> <keyword name="AutoSaver.saveIfNeccessary" id="AutoSaver.saveIfNeccessary" ref="eric5.Utilities.AutoSaver.html#AutoSaver.saveIfNeccessary" /> <keyword name="AutoSaver.timerEvent" id="AutoSaver.timerEvent" ref="eric5.Utilities.AutoSaver.html#AutoSaver.timerEvent" /> + <keyword name="BackgroundClient" id="BackgroundClient" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient" /> + <keyword name="BackgroundClient (Constructor)" id="BackgroundClient (Constructor)" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient.__init__" /> + <keyword name="BackgroundClient (Module)" id="BackgroundClient (Module)" ref="eric5.Utilities.BackgroundClient.html" /> + <keyword name="BackgroundClient.__initClientService" id="BackgroundClient.__initClientService" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient.__initClientService" /> + <keyword name="BackgroundClient.__receive" id="BackgroundClient.__receive" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient.__receive" /> + <keyword name="BackgroundClient.__send" id="BackgroundClient.__send" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient.__send" /> + <keyword name="BackgroundClient.run" id="BackgroundClient.run" ref="eric5.Utilities.BackgroundClient.html#BackgroundClient.run" /> + <keyword name="BackgroundService" id="BackgroundService" ref="eric5.Utilities.BackgroundService.html#BackgroundService" /> + <keyword name="BackgroundService (Constructor)" id="BackgroundService (Constructor)" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__init__" /> + <keyword name="BackgroundService (Module)" id="BackgroundService (Module)" ref="eric5.Utilities.BackgroundService.html" /> + <keyword name="BackgroundService.__processQueue" id="BackgroundService.__processQueue" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__processQueue" /> + <keyword name="BackgroundService.__receive" id="BackgroundService.__receive" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__receive" /> + <keyword name="BackgroundService.__send" id="BackgroundService.__send" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__send" /> + <keyword name="BackgroundService.__startExternalClient" id="BackgroundService.__startExternalClient" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__startExternalClient" /> + <keyword name="BackgroundService.__startInternalClient" id="BackgroundService.__startInternalClient" ref="eric5.Utilities.BackgroundService.html#BackgroundService.__startInternalClient" /> + <keyword name="BackgroundService.enqueueRequest" id="BackgroundService.enqueueRequest" ref="eric5.Utilities.BackgroundService.html#BackgroundService.enqueueRequest" /> + <keyword name="BackgroundService.on_disconnectSocket" id="BackgroundService.on_disconnectSocket" ref="eric5.Utilities.BackgroundService.html#BackgroundService.on_disconnectSocket" /> + <keyword name="BackgroundService.on_newConnection" id="BackgroundService.on_newConnection" ref="eric5.Utilities.BackgroundService.html#BackgroundService.on_newConnection" /> + <keyword name="BackgroundService.serviceConnect" id="BackgroundService.serviceConnect" ref="eric5.Utilities.BackgroundService.html#BackgroundService.serviceConnect" /> + <keyword name="BackgroundService.serviceDisconnect" id="BackgroundService.serviceDisconnect" ref="eric5.Utilities.BackgroundService.html#BackgroundService.serviceDisconnect" /> + <keyword name="BackgroundService.shutdown" id="BackgroundService.shutdown" ref="eric5.Utilities.BackgroundService.html#BackgroundService.shutdown" /> <keyword name="BaseReport" id="BaseReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport" /> - <keyword name="BaseReport" id="BaseReport" ref="eric5.UtilitiesPython2.pep8.html#BaseReport" /> <keyword name="BaseReport (Constructor)" id="BaseReport (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.__init__" /> - <keyword name="BaseReport (Constructor)" id="BaseReport (Constructor)" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.__init__" /> <keyword name="BaseReport.error" id="BaseReport.error" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.error" /> - <keyword name="BaseReport.error" id="BaseReport.error" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.error" /> <keyword name="BaseReport.error_args" id="BaseReport.error_args" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.error_args" /> - <keyword name="BaseReport.error_args" id="BaseReport.error_args" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.error_args" /> <keyword name="BaseReport.get_count" id="BaseReport.get_count" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.get_count" /> - <keyword name="BaseReport.get_count" id="BaseReport.get_count" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.get_count" /> <keyword name="BaseReport.get_file_results" id="BaseReport.get_file_results" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.get_file_results" /> - <keyword name="BaseReport.get_file_results" id="BaseReport.get_file_results" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.get_file_results" /> <keyword name="BaseReport.get_statistics" id="BaseReport.get_statistics" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.get_statistics" /> - <keyword name="BaseReport.get_statistics" id="BaseReport.get_statistics" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.get_statistics" /> <keyword name="BaseReport.increment_logical_line" id="BaseReport.increment_logical_line" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.increment_logical_line" /> - <keyword name="BaseReport.increment_logical_line" id="BaseReport.increment_logical_line" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.increment_logical_line" /> <keyword name="BaseReport.init_file" id="BaseReport.init_file" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.init_file" /> - <keyword name="BaseReport.init_file" id="BaseReport.init_file" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.init_file" /> <keyword name="BaseReport.print_benchmark" id="BaseReport.print_benchmark" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.print_benchmark" /> - <keyword name="BaseReport.print_benchmark" id="BaseReport.print_benchmark" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.print_benchmark" /> <keyword name="BaseReport.print_statistics" id="BaseReport.print_statistics" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.print_statistics" /> - <keyword name="BaseReport.print_statistics" id="BaseReport.print_statistics" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.print_statistics" /> <keyword name="BaseReport.start" id="BaseReport.start" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.start" /> - <keyword name="BaseReport.start" id="BaseReport.start" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.start" /> <keyword name="BaseReport.stop" id="BaseReport.stop" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#BaseReport.stop" /> - <keyword name="BaseReport.stop" id="BaseReport.stop" ref="eric5.UtilitiesPython2.pep8.html#BaseReport.stop" /> <keyword name="BinaryModel" id="BinaryModel" ref="eric5.UI.NumbersWidget.html#BinaryModel" /> <keyword name="BinaryModel (Constructor)" id="BinaryModel (Constructor)" ref="eric5.UI.NumbersWidget.html#BinaryModel.__init__" /> <keyword name="BinaryModel.columnCount" id="BinaryModel.columnCount" ref="eric5.UI.NumbersWidget.html#BinaryModel.columnCount" /> @@ -1502,14 +1501,7 @@ <keyword name="BinaryModel.setBitsAndValue" id="BinaryModel.setBitsAndValue" ref="eric5.UI.NumbersWidget.html#BinaryModel.setBitsAndValue" /> <keyword name="BinaryModel.setData" id="BinaryModel.setData" ref="eric5.UI.NumbersWidget.html#BinaryModel.setData" /> <keyword name="BinaryModel.setValue" id="BinaryModel.setValue" ref="eric5.UI.NumbersWidget.html#BinaryModel.setValue" /> - <keyword name="Binding" id="Binding" ref="eric5.Utilities.py2flakes.checker.html#Binding" /> - <keyword name="Binding" id="Binding" ref="eric5.Utilities.py3flakes.checker.html#Binding" /> - <keyword name="Binding (Constructor)" id="Binding (Constructor)" ref="eric5.Utilities.py2flakes.checker.html#Binding.__init__" /> - <keyword name="Binding (Constructor)" id="Binding (Constructor)" ref="eric5.Utilities.py3flakes.checker.html#Binding.__init__" /> - <keyword name="Binding.__repr__" id="Binding.__repr__" ref="eric5.Utilities.py2flakes.checker.html#Binding.__repr__" /> - <keyword name="Binding.__repr__" id="Binding.__repr__" ref="eric5.Utilities.py3flakes.checker.html#Binding.__repr__" /> - <keyword name="Binding.__str__" id="Binding.__str__" ref="eric5.Utilities.py2flakes.checker.html#Binding.__str__" /> - <keyword name="Binding.__str__" id="Binding.__str__" ref="eric5.Utilities.py3flakes.checker.html#Binding.__str__" /> + <keyword name="Binding" id="Binding" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Binding" /> <keyword name="BookmarkActionSelectionDialog" id="BookmarkActionSelectionDialog" ref="eric5.Helpviewer.UrlBar.BookmarkActionSelectionDialog.html#BookmarkActionSelectionDialog" /> <keyword name="BookmarkActionSelectionDialog (Constructor)" id="BookmarkActionSelectionDialog (Constructor)" ref="eric5.Helpviewer.UrlBar.BookmarkActionSelectionDialog.html#BookmarkActionSelectionDialog.__init__" /> <keyword name="BookmarkActionSelectionDialog (Module)" id="BookmarkActionSelectionDialog (Module)" ref="eric5.Helpviewer.UrlBar.BookmarkActionSelectionDialog.html" /> @@ -1974,106 +1966,64 @@ <keyword name="ChatWidget.preferencesChanged" id="ChatWidget.preferencesChanged" ref="eric5.Cooperation.ChatWidget.html#ChatWidget.preferencesChanged" /> <keyword name="ChatWidget.shutdown" id="ChatWidget.shutdown" ref="eric5.Cooperation.ChatWidget.html#ChatWidget.shutdown" /> <keyword name="Checker" id="Checker" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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" id="Checker" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker" /> <keyword name="Checker (Constructor)" id="Checker (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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" /> - <keyword name="Checker.AUGASSIGN" id="Checker.AUGASSIGN" ref="eric5.Utilities.py3flakes.checker.html#Checker.AUGASSIGN" /> - <keyword name="Checker.CLASSDEF" id="Checker.CLASSDEF" ref="eric5.Utilities.py2flakes.checker.html#Checker.CLASSDEF" /> - <keyword name="Checker.CLASSDEF" id="Checker.CLASSDEF" ref="eric5.Utilities.py3flakes.checker.html#Checker.CLASSDEF" /> - <keyword name="Checker.DICTCOMP" id="Checker.DICTCOMP" ref="eric5.Utilities.py2flakes.checker.html#Checker.DICTCOMP" /> - <keyword name="Checker.DICTCOMP" id="Checker.DICTCOMP" ref="eric5.Utilities.py3flakes.checker.html#Checker.DICTCOMP" /> - <keyword name="Checker.EXCEPTHANDLER" id="Checker.EXCEPTHANDLER" ref="eric5.Utilities.py2flakes.checker.html#Checker.EXCEPTHANDLER" /> - <keyword name="Checker.EXCEPTHANDLER" id="Checker.EXCEPTHANDLER" ref="eric5.Utilities.py3flakes.checker.html#Checker.EXCEPTHANDLER" /> - <keyword name="Checker.FOR" id="Checker.FOR" ref="eric5.Utilities.py2flakes.checker.html#Checker.FOR" /> - <keyword name="Checker.FOR" id="Checker.FOR" ref="eric5.Utilities.py3flakes.checker.html#Checker.FOR" /> - <keyword name="Checker.FUNCTIONDEF" id="Checker.FUNCTIONDEF" ref="eric5.Utilities.py2flakes.checker.html#Checker.FUNCTIONDEF" /> - <keyword name="Checker.FUNCTIONDEF" id="Checker.FUNCTIONDEF" ref="eric5.Utilities.py3flakes.checker.html#Checker.FUNCTIONDEF" /> - <keyword name="Checker.GLOBAL" id="Checker.GLOBAL" ref="eric5.Utilities.py2flakes.checker.html#Checker.GLOBAL" /> - <keyword name="Checker.GLOBAL" id="Checker.GLOBAL" ref="eric5.Utilities.py3flakes.checker.html#Checker.GLOBAL" /> - <keyword name="Checker.IMPORT" id="Checker.IMPORT" ref="eric5.Utilities.py2flakes.checker.html#Checker.IMPORT" /> - <keyword name="Checker.IMPORT" id="Checker.IMPORT" ref="eric5.Utilities.py3flakes.checker.html#Checker.IMPORT" /> - <keyword name="Checker.IMPORTFROM" id="Checker.IMPORTFROM" ref="eric5.Utilities.py2flakes.checker.html#Checker.IMPORTFROM" /> - <keyword name="Checker.IMPORTFROM" id="Checker.IMPORTFROM" ref="eric5.Utilities.py3flakes.checker.html#Checker.IMPORTFROM" /> - <keyword name="Checker.LAMBDA" id="Checker.LAMBDA" ref="eric5.Utilities.py2flakes.checker.html#Checker.LAMBDA" /> - <keyword name="Checker.LAMBDA" id="Checker.LAMBDA" ref="eric5.Utilities.py3flakes.checker.html#Checker.LAMBDA" /> - <keyword name="Checker.LISTCOMP" id="Checker.LISTCOMP" ref="eric5.Utilities.py2flakes.checker.html#Checker.LISTCOMP" /> - <keyword name="Checker.LISTCOMP" id="Checker.LISTCOMP" ref="eric5.Utilities.py3flakes.checker.html#Checker.LISTCOMP" /> - <keyword name="Checker.NAME" id="Checker.NAME" ref="eric5.Utilities.py2flakes.checker.html#Checker.NAME" /> - <keyword name="Checker.NAME" id="Checker.NAME" ref="eric5.Utilities.py3flakes.checker.html#Checker.NAME" /> - <keyword name="Checker.STARRED" id="Checker.STARRED" ref="eric5.Utilities.py3flakes.checker.html#Checker.STARRED" /> - <keyword name="Checker._runDeferred" id="Checker._runDeferred" ref="eric5.Utilities.py3flakes.checker.html#Checker._runDeferred" /> - <keyword name="Checker.addArgs" id="Checker.addArgs" ref="eric5.Utilities.py2flakes.checker.html#Checker.addArgs" /> - <keyword name="Checker.addArgs" id="Checker.addArgs" ref="eric5.Utilities.py3flakes.checker.html#Checker.addArgs" /> - <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 (Constructor)" id="Checker (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.__init__" /> + <keyword name="Checker.ASSIGN" id="Checker.ASSIGN" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.ASSIGN" /> + <keyword name="Checker.AUGASSIGN" id="Checker.AUGASSIGN" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.AUGASSIGN" /> + <keyword name="Checker.CLASSDEF" id="Checker.CLASSDEF" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.CLASSDEF" /> + <keyword name="Checker.DICTCOMP" id="Checker.DICTCOMP" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.DICTCOMP" /> + <keyword name="Checker.EXCEPTHANDLER" id="Checker.EXCEPTHANDLER" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.EXCEPTHANDLER" /> + <keyword name="Checker.FOR" id="Checker.FOR" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.FOR" /> + <keyword name="Checker.FUNCTIONDEF" id="Checker.FUNCTIONDEF" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.FUNCTIONDEF" /> + <keyword name="Checker.GENERATOREXP" id="Checker.GENERATOREXP" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.GENERATOREXP" /> + <keyword name="Checker.GLOBAL" id="Checker.GLOBAL" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.GLOBAL" /> + <keyword name="Checker.IMPORT" id="Checker.IMPORT" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.IMPORT" /> + <keyword name="Checker.IMPORTFROM" id="Checker.IMPORTFROM" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.IMPORTFROM" /> + <keyword name="Checker.LAMBDA" id="Checker.LAMBDA" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.LAMBDA" /> + <keyword name="Checker.LISTCOMP" id="Checker.LISTCOMP" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.LISTCOMP" /> + <keyword name="Checker.NAME" id="Checker.NAME" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.NAME" /> + <keyword name="Checker.TRY" id="Checker.TRY" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.TRY" /> + <keyword name="Checker.addArgs" id="Checker.addArgs" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.addArgs" /> + <keyword name="Checker.addBinding" id="Checker.addBinding" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.addBinding" /> <keyword name="Checker.build_tokens_line" id="Checker.build_tokens_line" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.checkDeadScopes" id="Checker.checkDeadScopes" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.checkDeadScopes" /> + <keyword name="Checker.checkUnusedAssignments" id="Checker.checkUnusedAssignments" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.checkUnusedAssignments" /> <keyword name="Checker.check_all" id="Checker.check_all" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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_ast" id="Checker.check_ast" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.check_ast" /> - <keyword name="Checker.check_ast" id="Checker.check_ast" ref="eric5.UtilitiesPython2.pep8.html#Checker.check_ast" /> - <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.CodeStyleChecker.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.CodeStyleChecker.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" /> - <keyword name="Checker.deferAssignment" id="Checker.deferAssignment" ref="eric5.Utilities.py3flakes.checker.html#Checker.deferAssignment" /> - <keyword name="Checker.deferFunction" id="Checker.deferFunction" ref="eric5.Utilities.py2flakes.checker.html#Checker.deferFunction" /> - <keyword name="Checker.deferFunction" id="Checker.deferFunction" ref="eric5.Utilities.py3flakes.checker.html#Checker.deferFunction" /> - <keyword name="Checker.descendantOf" id="Checker.descendantOf" ref="eric5.Utilities.py2flakes.checker.html#Checker.descendantOf" /> - <keyword name="Checker.differentForks" id="Checker.differentForks" ref="eric5.Utilities.py2flakes.checker.html#Checker.differentForks" /> + <keyword name="Checker.collectLoopVars" id="Checker.collectLoopVars" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.collectLoopVars" /> + <keyword name="Checker.deferAssignment" id="Checker.deferAssignment" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.deferAssignment" /> + <keyword name="Checker.deferFunction" id="Checker.deferFunction" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.deferFunction" /> + <keyword name="Checker.descendantOf" id="Checker.descendantOf" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.descendantOf" /> + <keyword name="Checker.differentForks" id="Checker.differentForks" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.differentForks" /> <keyword name="Checker.generate_tokens" id="Checker.generate_tokens" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.generate_tokens" /> - <keyword name="Checker.generate_tokens" id="Checker.generate_tokens" ref="eric5.UtilitiesPython2.pep8.html#Checker.generate_tokens" /> - <keyword name="Checker.getCommonAncestor" id="Checker.getCommonAncestor" ref="eric5.Utilities.py2flakes.checker.html#Checker.getCommonAncestor" /> - <keyword name="Checker.handleAssignName" id="Checker.handleAssignName" ref="eric5.Utilities.py3flakes.checker.html#Checker.handleAssignName" /> - <keyword name="Checker.handleBody" id="Checker.handleBody" ref="eric5.Utilities.py3flakes.checker.html#Checker.handleBody" /> - <keyword name="Checker.handleChildren" id="Checker.handleChildren" ref="eric5.Utilities.py2flakes.checker.html#Checker.handleChildren" /> - <keyword name="Checker.handleChildren" id="Checker.handleChildren" ref="eric5.Utilities.py3flakes.checker.html#Checker.handleChildren" /> - <keyword name="Checker.handleNode" id="Checker.handleNode" ref="eric5.Utilities.py2flakes.checker.html#Checker.handleNode" /> - <keyword name="Checker.handleNode" id="Checker.handleNode" ref="eric5.Utilities.py3flakes.checker.html#Checker.handleNode" /> - <keyword name="Checker.handleNodeDelete" id="Checker.handleNodeDelete" ref="eric5.Utilities.py2flakes.checker.html#Checker.handleNodeDelete" /> - <keyword name="Checker.handleNodeLoad" id="Checker.handleNodeLoad" ref="eric5.Utilities.py2flakes.checker.html#Checker.handleNodeLoad" /> - <keyword name="Checker.handleNodeStore" id="Checker.handleNodeStore" ref="eric5.Utilities.py2flakes.checker.html#Checker.handleNodeStore" /> - <keyword name="Checker.hasParent" id="Checker.hasParent" ref="eric5.Utilities.py2flakes.checker.html#Checker.hasParent" /> - <keyword name="Checker.ignore" id="Checker.ignore" ref="eric5.Utilities.py2flakes.checker.html#Checker.ignore" /> - <keyword name="Checker.ignore" id="Checker.ignore" ref="eric5.Utilities.py3flakes.checker.html#Checker.ignore" /> - <keyword name="Checker.isDocstring" id="Checker.isDocstring" ref="eric5.Utilities.py2flakes.checker.html#Checker.isDocstring" /> - <keyword name="Checker.isDocstring" id="Checker.isDocstring" ref="eric5.Utilities.py3flakes.checker.html#Checker.isDocstring" /> - <keyword name="Checker.onFork" id="Checker.onFork" ref="eric5.Utilities.py2flakes.checker.html#Checker.onFork" /> - <keyword name="Checker.popScope" id="Checker.popScope" ref="eric5.Utilities.py2flakes.checker.html#Checker.popScope" /> - <keyword name="Checker.popScope" id="Checker.popScope" ref="eric5.Utilities.py3flakes.checker.html#Checker.popScope" /> - <keyword name="Checker.pushClassScope" id="Checker.pushClassScope" ref="eric5.Utilities.py2flakes.checker.html#Checker.pushClassScope" /> - <keyword name="Checker.pushClassScope" id="Checker.pushClassScope" ref="eric5.Utilities.py3flakes.checker.html#Checker.pushClassScope" /> - <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.getCommonAncestor" id="Checker.getCommonAncestor" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.getCommonAncestor" /> + <keyword name="Checker.getDocstring" id="Checker.getDocstring" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.getDocstring" /> + <keyword name="Checker.getNodeHandler" id="Checker.getNodeHandler" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.getNodeHandler" /> + <keyword name="Checker.handleChildren" id="Checker.handleChildren" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleChildren" /> + <keyword name="Checker.handleDoctests" id="Checker.handleDoctests" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleDoctests" /> + <keyword name="Checker.handleNode" id="Checker.handleNode" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleNode" /> + <keyword name="Checker.handleNodeDelete" id="Checker.handleNodeDelete" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleNodeDelete" /> + <keyword name="Checker.handleNodeLoad" id="Checker.handleNodeLoad" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleNodeLoad" /> + <keyword name="Checker.handleNodeStore" id="Checker.handleNodeStore" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.handleNodeStore" /> + <keyword name="Checker.hasParent" id="Checker.hasParent" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.hasParent" /> + <keyword name="Checker.ignore" id="Checker.ignore" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.ignore" /> + <keyword name="Checker.isDocstring" id="Checker.isDocstring" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.isDocstring" /> + <keyword name="Checker.onFork" id="Checker.onFork" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.onFork" /> + <keyword name="Checker.popScope" id="Checker.popScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.popScope" /> + <keyword name="Checker.pushClassScope" id="Checker.pushClassScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.pushClassScope" /> + <keyword name="Checker.pushFunctionScope" id="Checker.pushFunctionScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.pushFunctionScope" /> + <keyword name="Checker.pushScope" id="Checker.pushScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.pushScope" /> <keyword name="Checker.readline" id="Checker.readline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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" id="Checker.report" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.report" /> <keyword name="Checker.report_invalid_syntax" id="Checker.report_invalid_syntax" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.report_invalid_syntax" /> - <keyword name="Checker.report_invalid_syntax" id="Checker.report_invalid_syntax" ref="eric5.UtilitiesPython2.pep8.html#Checker.report_invalid_syntax" /> - <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.runDeferred" id="Checker.runDeferred" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.runDeferred" /> + <keyword name="Checker.runFunction" id="Checker.runFunction" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.runFunction" /> <keyword name="Checker.run_check" id="Checker.run_check" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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="Checker.scope" id="Checker.scope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Checker.scope" /> <keyword name="CheckerPlugins (Package)" id="CheckerPlugins (Package)" ref="index-eric5.Plugins.CheckerPlugins.html" /> <keyword name="ChromeImporter" id="ChromeImporter" ref="eric5.Helpviewer.Bookmarks.BookmarksImporters.ChromeImporter.html#ChromeImporter" /> <keyword name="ChromeImporter (Constructor)" id="ChromeImporter (Constructor)" ref="eric5.Helpviewer.Bookmarks.BookmarksImporters.ChromeImporter.html#ChromeImporter.__init__" /> @@ -2100,7 +2050,7 @@ <keyword name="Class.getMethod" id="Class.getMethod" ref="eric5.Utilities.ModuleParser.html#Class.getMethod" /> <keyword name="Class.setEndLine" id="Class.setEndLine" ref="eric5.Utilities.ModuleParser.html#Class.setEndLine" /> <keyword name="ClassBrowsers (Package)" id="ClassBrowsers (Package)" ref="index-eric5.Utilities.ClassBrowsers.html" /> - <keyword name="ClassDefinition" id="ClassDefinition" ref="eric5.Utilities.py2flakes.checker.html#ClassDefinition" /> + <keyword name="ClassDefinition" id="ClassDefinition" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#ClassDefinition" /> <keyword name="ClassItem" id="ClassItem" ref="eric5.Graphics.ClassItem.html#ClassItem" /> <keyword name="ClassItem (Constructor)" id="ClassItem (Constructor)" ref="eric5.Graphics.ClassItem.html#ClassItem.__init__" /> <keyword name="ClassItem (Module)" id="ClassItem (Module)" ref="eric5.Graphics.ClassItem.html" /> @@ -2117,8 +2067,7 @@ <keyword name="ClassModel.addMethod" id="ClassModel.addMethod" ref="eric5.Graphics.ClassItem.html#ClassModel.addMethod" /> <keyword name="ClassModel.getAttributes" id="ClassModel.getAttributes" ref="eric5.Graphics.ClassItem.html#ClassModel.getAttributes" /> <keyword name="ClassModel.getMethods" id="ClassModel.getMethods" ref="eric5.Graphics.ClassItem.html#ClassModel.getMethods" /> - <keyword name="ClassScope" id="ClassScope" ref="eric5.Utilities.py2flakes.checker.html#ClassScope" /> - <keyword name="ClassScope" id="ClassScope" ref="eric5.Utilities.py3flakes.checker.html#ClassScope" /> + <keyword name="ClassScope" id="ClassScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#ClassScope" /> <keyword name="ClbrBase" id="ClbrBase" ref="eric5.Utilities.ClassBrowsers.ClbrBaseClasses.html#ClbrBase" /> <keyword name="ClbrBase (Constructor)" id="ClbrBase (Constructor)" ref="eric5.Utilities.ClassBrowsers.ClbrBaseClasses.html#ClbrBase.__init__" /> <keyword name="ClbrBase._addattribute" id="ClbrBase._addattribute" ref="eric5.Utilities.ClassBrowsers.ClbrBaseClasses.html#ClbrBase._addattribute" /> @@ -2214,7 +2163,6 @@ <keyword name="CodeMetricsDialog.prepare" id="CodeMetricsDialog.prepare" ref="eric5.DataViews.CodeMetricsDialog.html#CodeMetricsDialog.prepare" /> <keyword name="CodeMetricsDialog.start" id="CodeMetricsDialog.start" ref="eric5.DataViews.CodeMetricsDialog.html#CodeMetricsDialog.start" /> <keyword name="CodeStyleChecker (Module)" id="CodeStyleChecker (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html" /> - <keyword name="CodeStyleChecker (Module)" id="CodeStyleChecker (Module)" ref="eric5.UtilitiesPython2.CodeStyleChecker.html" /> <keyword name="CodeStyleChecker (Package)" id="CodeStyleChecker (Package)" ref="index-eric5.Plugins.CheckerPlugins.CodeStyleChecker.html" /> <keyword name="CodeStyleCheckerDialog" id="CodeStyleCheckerDialog" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog" /> <keyword name="CodeStyleCheckerDialog (Constructor)" id="CodeStyleCheckerDialog (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__init__" /> @@ -2222,14 +2170,17 @@ <keyword name="CodeStyleCheckerDialog.__clearErrors" id="CodeStyleCheckerDialog.__clearErrors" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__clearErrors" /> <keyword name="CodeStyleCheckerDialog.__createResultItem" id="CodeStyleCheckerDialog.__createResultItem" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__createResultItem" /> <keyword name="CodeStyleCheckerDialog.__finish" id="CodeStyleCheckerDialog.__finish" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__finish" /> + <keyword name="CodeStyleCheckerDialog.__getEol" id="CodeStyleCheckerDialog.__getEol" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__getEol" /> <keyword name="CodeStyleCheckerDialog.__getSelectedFixableItems" id="CodeStyleCheckerDialog.__getSelectedFixableItems" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__getSelectedFixableItems" /> <keyword name="CodeStyleCheckerDialog.__itemFixable" id="CodeStyleCheckerDialog.__itemFixable" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__itemFixable" /> <keyword name="CodeStyleCheckerDialog.__modifyFixedResultItem" id="CodeStyleCheckerDialog.__modifyFixedResultItem" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__modifyFixedResultItem" /> + <keyword name="CodeStyleCheckerDialog.__processResult" id="CodeStyleCheckerDialog.__processResult" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__processResult" /> <keyword name="CodeStyleCheckerDialog.__resetStatistics" id="CodeStyleCheckerDialog.__resetStatistics" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__resetStatistics" /> <keyword name="CodeStyleCheckerDialog.__resort" id="CodeStyleCheckerDialog.__resort" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__resort" /> <keyword name="CodeStyleCheckerDialog.__selectCodes" id="CodeStyleCheckerDialog.__selectCodes" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__selectCodes" /> <keyword name="CodeStyleCheckerDialog.__updateFixerStatistics" id="CodeStyleCheckerDialog.__updateFixerStatistics" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__updateFixerStatistics" /> <keyword name="CodeStyleCheckerDialog.__updateStatistics" id="CodeStyleCheckerDialog.__updateStatistics" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.__updateStatistics" /> + <keyword name="CodeStyleCheckerDialog.check" id="CodeStyleCheckerDialog.check" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.check" /> <keyword name="CodeStyleCheckerDialog.on_buttonBox_clicked" id="CodeStyleCheckerDialog.on_buttonBox_clicked" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.on_buttonBox_clicked" /> <keyword name="CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked" id="CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.on_excludeMessagesSelectButton_clicked" /> <keyword name="CodeStyleCheckerDialog.on_fixButton_clicked" id="CodeStyleCheckerDialog.on_fixButton_clicked" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerDialog.on_fixButton_clicked" /> @@ -2257,13 +2208,13 @@ <keyword name="CodeStyleCheckerPlugin.__projectBrowserShowMenu" id="CodeStyleCheckerPlugin.__projectBrowserShowMenu" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.__projectBrowserShowMenu" /> <keyword name="CodeStyleCheckerPlugin.__projectCodeStyleCheck" id="CodeStyleCheckerPlugin.__projectCodeStyleCheck" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.__projectCodeStyleCheck" /> <keyword name="CodeStyleCheckerPlugin.__projectShowMenu" id="CodeStyleCheckerPlugin.__projectShowMenu" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.__projectShowMenu" /> + <keyword name="CodeStyleCheckerPlugin.__translateStyleCheck" id="CodeStyleCheckerPlugin.__translateStyleCheck" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.__translateStyleCheck" /> <keyword name="CodeStyleCheckerPlugin.activate" id="CodeStyleCheckerPlugin.activate" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.activate" /> <keyword name="CodeStyleCheckerPlugin.deactivate" id="CodeStyleCheckerPlugin.deactivate" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.deactivate" /> - <keyword name="CodeStyleCheckerPy2" id="CodeStyleCheckerPy2" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#CodeStyleCheckerPy2" /> - <keyword name="CodeStyleCheckerPy2 (Constructor)" id="CodeStyleCheckerPy2 (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#CodeStyleCheckerPy2.__init__" /> - <keyword name="CodeStyleCheckerReport" id="CodeStyleCheckerReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerReport" /> - <keyword name="CodeStyleCheckerReport (Constructor)" id="CodeStyleCheckerReport (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerReport.__init__" /> - <keyword name="CodeStyleCheckerReport.error_args" id="CodeStyleCheckerReport.error_args" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html#CodeStyleCheckerReport.error_args" /> + <keyword name="CodeStyleCheckerPlugin.styleCheck" id="CodeStyleCheckerPlugin.styleCheck" ref="eric5.Plugins.PluginCodeStyleChecker.html#CodeStyleCheckerPlugin.styleCheck" /> + <keyword name="CodeStyleCheckerReport" id="CodeStyleCheckerReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#CodeStyleCheckerReport" /> + <keyword name="CodeStyleCheckerReport (Constructor)" id="CodeStyleCheckerReport (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#CodeStyleCheckerReport.__init__" /> + <keyword name="CodeStyleCheckerReport.error_args" id="CodeStyleCheckerReport.error_args" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#CodeStyleCheckerReport.error_args" /> <keyword name="CodeStyleCodeSelectionDialog" id="CodeStyleCodeSelectionDialog" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCodeSelectionDialog.html#CodeStyleCodeSelectionDialog" /> <keyword name="CodeStyleCodeSelectionDialog (Constructor)" id="CodeStyleCodeSelectionDialog (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCodeSelectionDialog.html#CodeStyleCodeSelectionDialog.__init__" /> <keyword name="CodeStyleCodeSelectionDialog (Module)" id="CodeStyleCodeSelectionDialog (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCodeSelectionDialog.html" /> @@ -2275,7 +2226,6 @@ <keyword name="CodeStyleFixer.__findLogical" id="CodeStyleFixer.__findLogical" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__findLogical" /> <keyword name="CodeStyleFixer.__fixD111" id="CodeStyleFixer.__fixD111" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD111" /> <keyword name="CodeStyleFixer.__fixD112" id="CodeStyleFixer.__fixD112" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD112" /> - <keyword name="CodeStyleFixer.__fixD121" id="CodeStyleFixer.__fixD121" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD121" /> <keyword name="CodeStyleFixer.__fixD131" id="CodeStyleFixer.__fixD131" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD131" /> <keyword name="CodeStyleFixer.__fixD141" id="CodeStyleFixer.__fixD141" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD141" /> <keyword name="CodeStyleFixer.__fixD142" id="CodeStyleFixer.__fixD142" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixD142" /> @@ -2316,7 +2266,6 @@ <keyword name="CodeStyleFixer.__fixW391" id="CodeStyleFixer.__fixW391" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixW391" /> <keyword name="CodeStyleFixer.__fixW603" id="CodeStyleFixer.__fixW603" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixW603" /> <keyword name="CodeStyleFixer.__fixWhitespace" id="CodeStyleFixer.__fixWhitespace" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__fixWhitespace" /> - <keyword name="CodeStyleFixer.__getEol" id="CodeStyleFixer.__getEol" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__getEol" /> <keyword name="CodeStyleFixer.__getID" id="CodeStyleFixer.__getID" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__getID" /> <keyword name="CodeStyleFixer.__getIndent" id="CodeStyleFixer.__getIndent" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__getIndent" /> <keyword name="CodeStyleFixer.__getIndentWord" id="CodeStyleFixer.__getIndentWord" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.__getIndentWord" /> @@ -2326,9 +2275,6 @@ <keyword name="CodeStyleFixer.fixIssue" id="CodeStyleFixer.fixIssue" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.fixIssue" /> <keyword name="CodeStyleFixer.mutualStartswith" id="CodeStyleFixer.mutualStartswith" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.mutualStartswith" /> <keyword name="CodeStyleFixer.saveFile" id="CodeStyleFixer.saveFile" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html#CodeStyleFixer.saveFile" /> - <keyword name="CodeStyleReport" id="CodeStyleReport" ref="eric5.UtilitiesPython2.CodeStyleChecker.html#CodeStyleReport" /> - <keyword name="CodeStyleReport (Constructor)" id="CodeStyleReport (Constructor)" ref="eric5.UtilitiesPython2.CodeStyleChecker.html#CodeStyleReport.__init__" /> - <keyword name="CodeStyleReport.error_args" id="CodeStyleReport.error_args" ref="eric5.UtilitiesPython2.CodeStyleChecker.html#CodeStyleReport.error_args" /> <keyword name="CodeStyleStatisticsDialog" id="CodeStyleStatisticsDialog" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.html#CodeStyleStatisticsDialog" /> <keyword name="CodeStyleStatisticsDialog (Constructor)" id="CodeStyleStatisticsDialog (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.html#CodeStyleStatisticsDialog.__init__" /> <keyword name="CodeStyleStatisticsDialog (Module)" id="CodeStyleStatisticsDialog (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleStatisticsDialog.html" /> @@ -3389,7 +3335,7 @@ <keyword name="DebuggerRubyPage.on_rubyInterpreterButton_clicked" id="DebuggerRubyPage.on_rubyInterpreterButton_clicked" ref="eric5.Preferences.ConfigurationPages.DebuggerRubyPage.html#DebuggerRubyPage.on_rubyInterpreterButton_clicked" /> <keyword name="DebuggerRubyPage.save" id="DebuggerRubyPage.save" ref="eric5.Preferences.ConfigurationPages.DebuggerRubyPage.html#DebuggerRubyPage.save" /> <keyword name="DefaultSearchEngines (Package)" id="DefaultSearchEngines (Package)" ref="index-eric5.Helpviewer.OpenSearch.DefaultSearchEngines.html" /> - <keyword name="Definition" id="Definition" ref="eric5.Utilities.py2flakes.checker.html#Definition" /> + <keyword name="Definition" id="Definition" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Definition" /> <keyword name="DeleteFilesConfirmationDialog" id="DeleteFilesConfirmationDialog" ref="eric5.UI.DeleteFilesConfirmationDialog.html#DeleteFilesConfirmationDialog" /> <keyword name="DeleteFilesConfirmationDialog (Constructor)" id="DeleteFilesConfirmationDialog (Constructor)" ref="eric5.UI.DeleteFilesConfirmationDialog.html#DeleteFilesConfirmationDialog.__init__" /> <keyword name="DeleteFilesConfirmationDialog (Module)" id="DeleteFilesConfirmationDialog (Module)" ref="eric5.UI.DeleteFilesConfirmationDialog.html" /> @@ -3409,11 +3355,8 @@ <keyword name="DiffDialog.on_saveButton_clicked" id="DiffDialog.on_saveButton_clicked" ref="eric5.UI.DiffDialog.html#DiffDialog.on_saveButton_clicked" /> <keyword name="DiffDialog.show" id="DiffDialog.show" ref="eric5.UI.DiffDialog.html#DiffDialog.show" /> <keyword name="DiffReport" id="DiffReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#DiffReport" /> - <keyword name="DiffReport" id="DiffReport" ref="eric5.UtilitiesPython2.pep8.html#DiffReport" /> <keyword name="DiffReport (Constructor)" id="DiffReport (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#DiffReport.__init__" /> - <keyword name="DiffReport (Constructor)" id="DiffReport (Constructor)" ref="eric5.UtilitiesPython2.pep8.html#DiffReport.__init__" /> <keyword name="DiffReport.error" id="DiffReport.error" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#DiffReport.error" /> - <keyword name="DiffReport.error" id="DiffReport.error" ref="eric5.UtilitiesPython2.pep8.html#DiffReport.error" /> <keyword name="DiffWindow" id="DiffWindow" ref="eric5.UI.DiffDialog.html#DiffWindow" /> <keyword name="DiffWindow (Constructor)" id="DiffWindow (Constructor)" ref="eric5.UI.DiffDialog.html#DiffWindow.__init__" /> <keyword name="DiffWindow.eventFilter" id="DiffWindow.eventFilter" ref="eric5.UI.DiffDialog.html#DiffWindow.eventFilter" /> @@ -3433,113 +3376,61 @@ <keyword name="DirectorySyncHandler.syncSpeedDial" id="DirectorySyncHandler.syncSpeedDial" ref="eric5.Helpviewer.Sync.DirectorySyncHandler.html#DirectorySyncHandler.syncSpeedDial" /> <keyword name="DirectorySyncHandler.syncUserAgents" id="DirectorySyncHandler.syncUserAgents" ref="eric5.Helpviewer.Sync.DirectorySyncHandler.html#DirectorySyncHandler.syncUserAgents" /> <keyword name="DocStyleChecker" id="DocStyleChecker" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker" /> - <keyword name="DocStyleChecker" id="DocStyleChecker" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker" /> <keyword name="DocStyleChecker (Constructor)" id="DocStyleChecker (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__init__" /> - <keyword name="DocStyleChecker (Constructor)" id="DocStyleChecker (Constructor)" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__init__" /> <keyword name="DocStyleChecker (Module)" id="DocStyleChecker (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html" /> <keyword name="DocStyleChecker.__checkBackslashes" id="DocStyleChecker.__checkBackslashes" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkBackslashes" /> - <keyword name="DocStyleChecker.__checkBackslashes" id="DocStyleChecker.__checkBackslashes" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkBackslashes" /> <keyword name="DocStyleChecker.__checkBlankAfterLastParagraph" id="DocStyleChecker.__checkBlankAfterLastParagraph" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkBlankAfterLastParagraph" /> - <keyword name="DocStyleChecker.__checkBlankAfterLastParagraph" id="DocStyleChecker.__checkBlankAfterLastParagraph" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkBlankAfterLastParagraph" /> <keyword name="DocStyleChecker.__checkBlankAfterSummary" id="DocStyleChecker.__checkBlankAfterSummary" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkBlankAfterSummary" /> - <keyword name="DocStyleChecker.__checkBlankAfterSummary" id="DocStyleChecker.__checkBlankAfterSummary" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkBlankAfterSummary" /> <keyword name="DocStyleChecker.__checkBlankBeforeAndAfterClass" id="DocStyleChecker.__checkBlankBeforeAndAfterClass" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkBlankBeforeAndAfterClass" /> - <keyword name="DocStyleChecker.__checkBlankBeforeAndAfterClass" id="DocStyleChecker.__checkBlankBeforeAndAfterClass" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkBlankBeforeAndAfterClass" /> <keyword name="DocStyleChecker.__checkClassDocstring" id="DocStyleChecker.__checkClassDocstring" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkClassDocstring" /> - <keyword name="DocStyleChecker.__checkClassDocstring" id="DocStyleChecker.__checkClassDocstring" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkClassDocstring" /> <keyword name="DocStyleChecker.__checkEndsWithPeriod" id="DocStyleChecker.__checkEndsWithPeriod" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEndsWithPeriod" /> - <keyword name="DocStyleChecker.__checkEndsWithPeriod" id="DocStyleChecker.__checkEndsWithPeriod" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEndsWithPeriod" /> <keyword name="DocStyleChecker.__checkEricBlankAfterSummary" id="DocStyleChecker.__checkEricBlankAfterSummary" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricBlankAfterSummary" /> - <keyword name="DocStyleChecker.__checkEricBlankAfterSummary" id="DocStyleChecker.__checkEricBlankAfterSummary" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricBlankAfterSummary" /> <keyword name="DocStyleChecker.__checkEricEndsWithPeriod" id="DocStyleChecker.__checkEricEndsWithPeriod" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricEndsWithPeriod" /> - <keyword name="DocStyleChecker.__checkEricEndsWithPeriod" id="DocStyleChecker.__checkEricEndsWithPeriod" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricEndsWithPeriod" /> <keyword name="DocStyleChecker.__checkEricException" id="DocStyleChecker.__checkEricException" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricException" /> - <keyword name="DocStyleChecker.__checkEricException" id="DocStyleChecker.__checkEricException" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricException" /> <keyword name="DocStyleChecker.__checkEricFunctionArguments" id="DocStyleChecker.__checkEricFunctionArguments" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricFunctionArguments" /> - <keyword name="DocStyleChecker.__checkEricFunctionArguments" id="DocStyleChecker.__checkEricFunctionArguments" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricFunctionArguments" /> <keyword name="DocStyleChecker.__checkEricNBlankAfterLastParagraph" id="DocStyleChecker.__checkEricNBlankAfterLastParagraph" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricNBlankAfterLastParagraph" /> - <keyword name="DocStyleChecker.__checkEricNBlankAfterLastParagraph" id="DocStyleChecker.__checkEricNBlankAfterLastParagraph" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricNBlankAfterLastParagraph" /> <keyword name="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" id="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" /> - <keyword name="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" id="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" /> <keyword name="DocStyleChecker.__checkEricQuotesOnSeparateLines" id="DocStyleChecker.__checkEricQuotesOnSeparateLines" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricQuotesOnSeparateLines" /> - <keyword name="DocStyleChecker.__checkEricQuotesOnSeparateLines" id="DocStyleChecker.__checkEricQuotesOnSeparateLines" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricQuotesOnSeparateLines" /> <keyword name="DocStyleChecker.__checkEricReturn" id="DocStyleChecker.__checkEricReturn" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkEricReturn" /> - <keyword name="DocStyleChecker.__checkEricReturn" id="DocStyleChecker.__checkEricReturn" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkEricReturn" /> <keyword name="DocStyleChecker.__checkFunctionDocstring" id="DocStyleChecker.__checkFunctionDocstring" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkFunctionDocstring" /> - <keyword name="DocStyleChecker.__checkFunctionDocstring" id="DocStyleChecker.__checkFunctionDocstring" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkFunctionDocstring" /> <keyword name="DocStyleChecker.__checkImperativeMood" id="DocStyleChecker.__checkImperativeMood" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkImperativeMood" /> - <keyword name="DocStyleChecker.__checkImperativeMood" id="DocStyleChecker.__checkImperativeMood" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkImperativeMood" /> <keyword name="DocStyleChecker.__checkIndent" id="DocStyleChecker.__checkIndent" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkIndent" /> - <keyword name="DocStyleChecker.__checkIndent" id="DocStyleChecker.__checkIndent" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkIndent" /> <keyword name="DocStyleChecker.__checkModulesDocstrings" id="DocStyleChecker.__checkModulesDocstrings" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkModulesDocstrings" /> - <keyword name="DocStyleChecker.__checkModulesDocstrings" id="DocStyleChecker.__checkModulesDocstrings" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkModulesDocstrings" /> <keyword name="DocStyleChecker.__checkNoBlankLineBefore" id="DocStyleChecker.__checkNoBlankLineBefore" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkNoBlankLineBefore" /> - <keyword name="DocStyleChecker.__checkNoBlankLineBefore" id="DocStyleChecker.__checkNoBlankLineBefore" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkNoBlankLineBefore" /> <keyword name="DocStyleChecker.__checkNoSignature" id="DocStyleChecker.__checkNoSignature" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkNoSignature" /> - <keyword name="DocStyleChecker.__checkNoSignature" id="DocStyleChecker.__checkNoSignature" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkNoSignature" /> <keyword name="DocStyleChecker.__checkOneLiner" id="DocStyleChecker.__checkOneLiner" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkOneLiner" /> - <keyword name="DocStyleChecker.__checkOneLiner" id="DocStyleChecker.__checkOneLiner" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkOneLiner" /> <keyword name="DocStyleChecker.__checkReturnType" id="DocStyleChecker.__checkReturnType" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkReturnType" /> - <keyword name="DocStyleChecker.__checkReturnType" id="DocStyleChecker.__checkReturnType" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkReturnType" /> <keyword name="DocStyleChecker.__checkSummary" id="DocStyleChecker.__checkSummary" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkSummary" /> - <keyword name="DocStyleChecker.__checkSummary" id="DocStyleChecker.__checkSummary" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkSummary" /> <keyword name="DocStyleChecker.__checkTripleDoubleQuotes" id="DocStyleChecker.__checkTripleDoubleQuotes" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkTripleDoubleQuotes" /> - <keyword name="DocStyleChecker.__checkTripleDoubleQuotes" id="DocStyleChecker.__checkTripleDoubleQuotes" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkTripleDoubleQuotes" /> <keyword name="DocStyleChecker.__checkUnicode" id="DocStyleChecker.__checkUnicode" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__checkUnicode" /> - <keyword name="DocStyleChecker.__checkUnicode" id="DocStyleChecker.__checkUnicode" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__checkUnicode" /> <keyword name="DocStyleChecker.__error" id="DocStyleChecker.__error" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__error" /> - <keyword name="DocStyleChecker.__error" id="DocStyleChecker.__error" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__error" /> <keyword name="DocStyleChecker.__getArgNames" id="DocStyleChecker.__getArgNames" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__getArgNames" /> - <keyword name="DocStyleChecker.__getArgNames" id="DocStyleChecker.__getArgNames" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__getArgNames" /> <keyword name="DocStyleChecker.__getSummaryLine" id="DocStyleChecker.__getSummaryLine" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__getSummaryLine" /> - <keyword name="DocStyleChecker.__getSummaryLine" id="DocStyleChecker.__getSummaryLine" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__getSummaryLine" /> <keyword name="DocStyleChecker.__getSummaryLines" id="DocStyleChecker.__getSummaryLines" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__getSummaryLines" /> - <keyword name="DocStyleChecker.__getSummaryLines" id="DocStyleChecker.__getSummaryLines" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__getSummaryLines" /> <keyword name="DocStyleChecker.__ignoreCode" id="DocStyleChecker.__ignoreCode" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__ignoreCode" /> - <keyword name="DocStyleChecker.__ignoreCode" id="DocStyleChecker.__ignoreCode" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__ignoreCode" /> <keyword name="DocStyleChecker.__parseClasses" id="DocStyleChecker.__parseClasses" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseClasses" /> - <keyword name="DocStyleChecker.__parseClasses" id="DocStyleChecker.__parseClasses" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseClasses" /> <keyword name="DocStyleChecker.__parseContexts" id="DocStyleChecker.__parseContexts" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseContexts" /> - <keyword name="DocStyleChecker.__parseContexts" id="DocStyleChecker.__parseContexts" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseContexts" /> <keyword name="DocStyleChecker.__parseDocstring" id="DocStyleChecker.__parseDocstring" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseDocstring" /> - <keyword name="DocStyleChecker.__parseDocstring" id="DocStyleChecker.__parseDocstring" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseDocstring" /> <keyword name="DocStyleChecker.__parseFunctions" id="DocStyleChecker.__parseFunctions" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseFunctions" /> - <keyword name="DocStyleChecker.__parseFunctions" id="DocStyleChecker.__parseFunctions" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseFunctions" /> <keyword name="DocStyleChecker.__parseMethods" id="DocStyleChecker.__parseMethods" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseMethods" /> - <keyword name="DocStyleChecker.__parseMethods" id="DocStyleChecker.__parseMethods" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseMethods" /> <keyword name="DocStyleChecker.__parseModuleDocstring" id="DocStyleChecker.__parseModuleDocstring" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseModuleDocstring" /> - <keyword name="DocStyleChecker.__parseModuleDocstring" id="DocStyleChecker.__parseModuleDocstring" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseModuleDocstring" /> <keyword name="DocStyleChecker.__parseTopLevel" id="DocStyleChecker.__parseTopLevel" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__parseTopLevel" /> - <keyword name="DocStyleChecker.__parseTopLevel" id="DocStyleChecker.__parseTopLevel" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__parseTopLevel" /> <keyword name="DocStyleChecker.__readline" id="DocStyleChecker.__readline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__readline" /> - <keyword name="DocStyleChecker.__readline" id="DocStyleChecker.__readline" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__readline" /> <keyword name="DocStyleChecker.__reportInvalidSyntax" id="DocStyleChecker.__reportInvalidSyntax" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__reportInvalidSyntax" /> <keyword name="DocStyleChecker.__resetReadline" id="DocStyleChecker.__resetReadline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__resetReadline" /> - <keyword name="DocStyleChecker.__resetReadline" id="DocStyleChecker.__resetReadline" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__resetReadline" /> <keyword name="DocStyleChecker.__skipIndentedBlock" id="DocStyleChecker.__skipIndentedBlock" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__skipIndentedBlock" /> - <keyword name="DocStyleChecker.__skipIndentedBlock" id="DocStyleChecker.__skipIndentedBlock" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.__skipIndentedBlock" /> - <keyword name="DocStyleChecker.getMessage" id="DocStyleChecker.getMessage" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.getMessage" /> <keyword name="DocStyleChecker.run" id="DocStyleChecker.run" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.run" /> - <keyword name="DocStyleChecker.run" id="DocStyleChecker.run" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.run" /> <keyword name="DocStyleChecker.unpackArgs" id="DocStyleChecker.unpackArgs" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.unpackArgs" /> - <keyword name="DocStyleChecker.unpackArgs" id="DocStyleChecker.unpackArgs" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleChecker.unpackArgs" /> - <keyword name="DocStyleCheckerPy2 (Module)" id="DocStyleCheckerPy2 (Module)" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html" /> <keyword name="DocStyleContext" id="DocStyleContext" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext" /> - <keyword name="DocStyleContext" id="DocStyleContext" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext" /> <keyword name="DocStyleContext (Constructor)" id="DocStyleContext (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.__init__" /> - <keyword name="DocStyleContext (Constructor)" id="DocStyleContext (Constructor)" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.__init__" /> <keyword name="DocStyleContext.contextType" id="DocStyleContext.contextType" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.contextType" /> - <keyword name="DocStyleContext.contextType" id="DocStyleContext.contextType" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.contextType" /> <keyword name="DocStyleContext.end" id="DocStyleContext.end" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.end" /> - <keyword name="DocStyleContext.end" id="DocStyleContext.end" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.end" /> <keyword name="DocStyleContext.indent" id="DocStyleContext.indent" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.indent" /> - <keyword name="DocStyleContext.indent" id="DocStyleContext.indent" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.indent" /> <keyword name="DocStyleContext.source" id="DocStyleContext.source" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.source" /> - <keyword name="DocStyleContext.source" id="DocStyleContext.source" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.source" /> <keyword name="DocStyleContext.ssource" id="DocStyleContext.ssource" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.ssource" /> - <keyword name="DocStyleContext.ssource" id="DocStyleContext.ssource" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.ssource" /> <keyword name="DocStyleContext.start" id="DocStyleContext.start" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleContext.start" /> - <keyword name="DocStyleContext.start" id="DocStyleContext.start" ref="eric5.UtilitiesPython2.DocStyleCheckerPy2.html#DocStyleContext.start" /> + <keyword name="DoctestSyntaxError" id="DoctestSyntaxError" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#DoctestSyntaxError" /> + <keyword name="DoctestSyntaxError (Constructor)" id="DoctestSyntaxError (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#DoctestSyntaxError.__init__" /> <keyword name="DocumentationPlugins (Package)" id="DocumentationPlugins (Package)" ref="index-eric5.Plugins.DocumentationPlugins.html" /> <keyword name="DocumentationTools (Package)" id="DocumentationTools (Package)" ref="index-eric5.DocumentationTools.html" /> <keyword name="Download (Package)" id="Download (Package)" ref="index-eric5.Helpviewer.Download.html" /> @@ -3626,10 +3517,8 @@ <keyword name="DownloadModel.removeRows" id="DownloadModel.removeRows" ref="eric5.Helpviewer.Download.DownloadModel.html#DownloadModel.removeRows" /> <keyword name="DownloadModel.rowCount" id="DownloadModel.rowCount" ref="eric5.Helpviewer.Download.DownloadModel.html#DownloadModel.rowCount" /> <keyword name="DownloadUtilities (Module)" id="DownloadUtilities (Module)" ref="eric5.Helpviewer.Download.DownloadUtilities.html" /> - <keyword name="DuplicateArgument" id="DuplicateArgument" ref="eric5.Utilities.py2flakes.messages.html#DuplicateArgument" /> - <keyword name="DuplicateArgument" id="DuplicateArgument" ref="eric5.Utilities.py3flakes.messages.html#DuplicateArgument" /> - <keyword name="DuplicateArgument (Constructor)" id="DuplicateArgument (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#DuplicateArgument.__init__" /> - <keyword name="DuplicateArgument (Constructor)" id="DuplicateArgument (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#DuplicateArgument.__init__" /> + <keyword name="DuplicateArgument" id="DuplicateArgument" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#DuplicateArgument" /> + <keyword name="DuplicateArgument (Constructor)" id="DuplicateArgument (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#DuplicateArgument.__init__" /> <keyword name="E5Action" id="E5Action" ref="eric5.E5Gui.E5Action.html#E5Action" /> <keyword name="E5Action (Constructor)" id="E5Action (Constructor)" ref="eric5.E5Gui.E5Action.html#E5Action.__init__" /> <keyword name="E5Action (Module)" id="E5Action (Module)" ref="eric5.E5Gui.E5Action.html" /> @@ -4329,6 +4218,7 @@ <keyword name="Editor.__processEndEditCommand" id="Editor.__processEndEditCommand" ref="eric5.QScintilla.Editor.html#Editor.__processEndEditCommand" /> <keyword name="Editor.__processFlags" id="Editor.__processFlags" ref="eric5.QScintilla.Editor.html#Editor.__processFlags" /> <keyword name="Editor.__processRequestSyncCommand" id="Editor.__processRequestSyncCommand" ref="eric5.QScintilla.Editor.html#Editor.__processRequestSyncCommand" /> + <keyword name="Editor.__processResult" id="Editor.__processResult" ref="eric5.QScintilla.Editor.html#Editor.__processResult" /> <keyword name="Editor.__processStartEditCommand" id="Editor.__processStartEditCommand" ref="eric5.QScintilla.Editor.html#Editor.__processStartEditCommand" /> <keyword name="Editor.__processSyncCommand" id="Editor.__processSyncCommand" ref="eric5.QScintilla.Editor.html#Editor.__processSyncCommand" /> <keyword name="Editor.__projectPropertiesChanged" id="Editor.__projectPropertiesChanged" ref="eric5.QScintilla.Editor.html#Editor.__projectPropertiesChanged" /> @@ -4446,6 +4336,7 @@ <keyword name="Editor.getLexer" id="Editor.getLexer" ref="eric5.QScintilla.Editor.html#Editor.getLexer" /> <keyword name="Editor.getMenu" id="Editor.getMenu" ref="eric5.QScintilla.Editor.html#Editor.getMenu" /> <keyword name="Editor.getNoName" id="Editor.getNoName" ref="eric5.QScintilla.Editor.html#Editor.getNoName" /> + <keyword name="Editor.getPyVersion" id="Editor.getPyVersion" ref="eric5.QScintilla.Editor.html#Editor.getPyVersion" /> <keyword name="Editor.getSearchText" id="Editor.getSearchText" ref="eric5.QScintilla.Editor.html#Editor.getSearchText" /> <keyword name="Editor.getSharingStatus" id="Editor.getSharingStatus" ref="eric5.QScintilla.Editor.html#Editor.getSharingStatus" /> <keyword name="Editor.getSyntaxErrors" id="Editor.getSyntaxErrors" ref="eric5.QScintilla.Editor.html#Editor.getSyntaxErrors" /> @@ -4831,10 +4722,7 @@ <keyword name="ExceptionsFilterDialog.on_deleteButton_clicked" id="ExceptionsFilterDialog.on_deleteButton_clicked" ref="eric5.Debugger.ExceptionsFilterDialog.html#ExceptionsFilterDialog.on_deleteButton_clicked" /> <keyword name="ExceptionsFilterDialog.on_exceptionEdit_textChanged" id="ExceptionsFilterDialog.on_exceptionEdit_textChanged" ref="eric5.Debugger.ExceptionsFilterDialog.html#ExceptionsFilterDialog.on_exceptionEdit_textChanged" /> <keyword name="ExceptionsFilterDialog.on_exceptionList_itemSelectionChanged" id="ExceptionsFilterDialog.on_exceptionList_itemSelectionChanged" ref="eric5.Debugger.ExceptionsFilterDialog.html#ExceptionsFilterDialog.on_exceptionList_itemSelectionChanged" /> - <keyword name="ExportBinding" id="ExportBinding" ref="eric5.Utilities.py2flakes.checker.html#ExportBinding" /> - <keyword name="ExportBinding" id="ExportBinding" ref="eric5.Utilities.py3flakes.checker.html#ExportBinding" /> - <keyword name="ExportBinding.names" id="ExportBinding.names" ref="eric5.Utilities.py2flakes.checker.html#ExportBinding.names" /> - <keyword name="ExportBinding.names" id="ExportBinding.names" ref="eric5.Utilities.py3flakes.checker.html#ExportBinding.names" /> + <keyword name="ExportBinding" id="ExportBinding" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#ExportBinding" /> <keyword name="ExporterBase" id="ExporterBase" ref="eric5.QScintilla.Exporters.ExporterBase.html#ExporterBase" /> <keyword name="ExporterBase (Constructor)" id="ExporterBase (Constructor)" ref="eric5.QScintilla.Exporters.ExporterBase.html#ExporterBase.__init__" /> <keyword name="ExporterBase (Module)" id="ExporterBase (Module)" ref="eric5.QScintilla.Exporters.ExporterBase.html" /> @@ -4961,7 +4849,6 @@ <keyword name="FileReply.isSequential" id="FileReply.isSequential" ref="eric5.Helpviewer.Network.FileReply.html#FileReply.isSequential" /> <keyword name="FileReply.readData" id="FileReply.readData" ref="eric5.Helpviewer.Network.FileReply.html#FileReply.readData" /> <keyword name="FileReport" id="FileReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#FileReport" /> - <keyword name="FileReport" id="FileReport" ref="eric5.UtilitiesPython2.pep8.html#FileReport" /> <keyword name="FiletypeAssociationDialog" id="FiletypeAssociationDialog" ref="eric5.Project.FiletypeAssociationDialog.html#FiletypeAssociationDialog" /> <keyword name="FiletypeAssociationDialog (Constructor)" id="FiletypeAssociationDialog (Constructor)" ref="eric5.Project.FiletypeAssociationDialog.html#FiletypeAssociationDialog.__init__" /> <keyword name="FiletypeAssociationDialog (Module)" id="FiletypeAssociationDialog (Module)" ref="eric5.Project.FiletypeAssociationDialog.html" /> @@ -5121,12 +5008,9 @@ <keyword name="Function (Constructor)" id="Function (Constructor)" ref="eric5.Utilities.ModuleParser.html#Function.__init__" /> <keyword name="Function.addDescription" id="Function.addDescription" ref="eric5.Utilities.ModuleParser.html#Function.addDescription" /> <keyword name="Function.setEndLine" id="Function.setEndLine" ref="eric5.Utilities.ModuleParser.html#Function.setEndLine" /> - <keyword name="FunctionDefinition" id="FunctionDefinition" ref="eric5.Utilities.py2flakes.checker.html#FunctionDefinition" /> - <keyword name="FunctionDefinition" id="FunctionDefinition" ref="eric5.Utilities.py3flakes.checker.html#FunctionDefinition" /> - <keyword name="FunctionScope" id="FunctionScope" ref="eric5.Utilities.py2flakes.checker.html#FunctionScope" /> - <keyword name="FunctionScope" id="FunctionScope" ref="eric5.Utilities.py3flakes.checker.html#FunctionScope" /> - <keyword name="FunctionScope (Constructor)" id="FunctionScope (Constructor)" ref="eric5.Utilities.py2flakes.checker.html#FunctionScope.__init__" /> - <keyword name="FunctionScope (Constructor)" id="FunctionScope (Constructor)" ref="eric5.Utilities.py3flakes.checker.html#FunctionScope.__init__" /> + <keyword name="FunctionDefinition" id="FunctionDefinition" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#FunctionDefinition" /> + <keyword name="FunctionScope" id="FunctionScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#FunctionScope" /> + <keyword name="GeneratorScope" id="GeneratorScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#GeneratorScope" /> <keyword name="Globals (Package)" id="Globals (Package)" ref="index-eric5.Globals.html" /> <keyword name="GotoDialog" id="GotoDialog" ref="eric5.QScintilla.GotoDialog.html#GotoDialog" /> <keyword name="GotoDialog (Constructor)" id="GotoDialog (Constructor)" ref="eric5.QScintilla.GotoDialog.html#GotoDialog.__init__" /> @@ -6839,18 +6723,11 @@ <keyword name="IconsPreviewDialog" id="IconsPreviewDialog" ref="eric5.Preferences.ConfigurationPages.IconsPreviewDialog.html#IconsPreviewDialog" /> <keyword name="IconsPreviewDialog (Constructor)" id="IconsPreviewDialog (Constructor)" ref="eric5.Preferences.ConfigurationPages.IconsPreviewDialog.html#IconsPreviewDialog.__init__" /> <keyword name="IconsPreviewDialog (Module)" id="IconsPreviewDialog (Module)" ref="eric5.Preferences.ConfigurationPages.IconsPreviewDialog.html" /> - <keyword name="ImportShadowedByLoopVar" id="ImportShadowedByLoopVar" ref="eric5.Utilities.py2flakes.messages.html#ImportShadowedByLoopVar" /> - <keyword name="ImportShadowedByLoopVar" id="ImportShadowedByLoopVar" ref="eric5.Utilities.py3flakes.messages.html#ImportShadowedByLoopVar" /> - <keyword name="ImportShadowedByLoopVar (Constructor)" id="ImportShadowedByLoopVar (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#ImportShadowedByLoopVar.__init__" /> - <keyword name="ImportShadowedByLoopVar (Constructor)" id="ImportShadowedByLoopVar (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#ImportShadowedByLoopVar.__init__" /> - <keyword name="ImportStarUsed" id="ImportStarUsed" ref="eric5.Utilities.py2flakes.messages.html#ImportStarUsed" /> - <keyword name="ImportStarUsed" id="ImportStarUsed" ref="eric5.Utilities.py3flakes.messages.html#ImportStarUsed" /> - <keyword name="ImportStarUsed (Constructor)" id="ImportStarUsed (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#ImportStarUsed.__init__" /> - <keyword name="ImportStarUsed (Constructor)" id="ImportStarUsed (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#ImportStarUsed.__init__" /> - <keyword name="Importation" id="Importation" ref="eric5.Utilities.py2flakes.checker.html#Importation" /> - <keyword name="Importation" id="Importation" ref="eric5.Utilities.py3flakes.checker.html#Importation" /> - <keyword name="Importation (Constructor)" id="Importation (Constructor)" ref="eric5.Utilities.py2flakes.checker.html#Importation.__init__" /> - <keyword name="Importation (Constructor)" id="Importation (Constructor)" ref="eric5.Utilities.py3flakes.checker.html#Importation.__init__" /> + <keyword name="ImportShadowedByLoopVar" id="ImportShadowedByLoopVar" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#ImportShadowedByLoopVar" /> + <keyword name="ImportShadowedByLoopVar (Constructor)" id="ImportShadowedByLoopVar (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#ImportShadowedByLoopVar.__init__" /> + <keyword name="ImportStarUsed" id="ImportStarUsed" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#ImportStarUsed" /> + <keyword name="ImportStarUsed (Constructor)" id="ImportStarUsed (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#ImportStarUsed.__init__" /> + <keyword name="Importation" id="Importation" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Importation" /> <keyword name="ImportsDiagramBuilder" id="ImportsDiagramBuilder" ref="eric5.Graphics.ImportsDiagramBuilder.html#ImportsDiagramBuilder" /> <keyword name="ImportsDiagramBuilder (Constructor)" id="ImportsDiagramBuilder (Constructor)" ref="eric5.Graphics.ImportsDiagramBuilder.html#ImportsDiagramBuilder.__init__" /> <keyword name="ImportsDiagramBuilder (Module)" id="ImportsDiagramBuilder (Module)" ref="eric5.Graphics.ImportsDiagramBuilder.html" /> @@ -7233,10 +7110,8 @@ <keyword name="JavaScriptExternalObject (Constructor)" id="JavaScriptExternalObject (Constructor)" ref="eric5.Helpviewer.HelpBrowserWV.html#JavaScriptExternalObject.__init__" /> <keyword name="JavaScriptExternalObject.AddSearchProvider" id="JavaScriptExternalObject.AddSearchProvider" ref="eric5.Helpviewer.HelpBrowserWV.html#JavaScriptExternalObject.AddSearchProvider" /> <keyword name="JavaScriptResources (Module)" id="JavaScriptResources (Module)" ref="eric5.Helpviewer.JavaScriptResources.html" /> - <keyword name="LateFutureImport" id="LateFutureImport" ref="eric5.Utilities.py2flakes.messages.html#LateFutureImport" /> - <keyword name="LateFutureImport" id="LateFutureImport" ref="eric5.Utilities.py3flakes.messages.html#LateFutureImport" /> - <keyword name="LateFutureImport (Constructor)" id="LateFutureImport (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#LateFutureImport.__init__" /> - <keyword name="LateFutureImport (Constructor)" id="LateFutureImport (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#LateFutureImport.__init__" /> + <keyword name="LateFutureImport" id="LateFutureImport" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#LateFutureImport" /> + <keyword name="LateFutureImport (Constructor)" id="LateFutureImport (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#LateFutureImport.__init__" /> <keyword name="Lexer" id="Lexer" ref="eric5.QScintilla.Lexers.Lexer.html#Lexer" /> <keyword name="Lexer (Constructor)" id="Lexer (Constructor)" ref="eric5.QScintilla.Lexers.Lexer.html#Lexer.__init__" /> <keyword name="Lexer (Module)" id="Lexer (Module)" ref="eric5.QScintilla.Lexers.Lexer.html" /> @@ -7610,14 +7485,10 @@ <keyword name="MercurialUserDataDialog (Constructor)" id="MercurialUserDataDialog (Constructor)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialUserDataDialog.html#MercurialUserDataDialog.__init__" /> <keyword name="MercurialUserDataDialog (Module)" id="MercurialUserDataDialog (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialUserDataDialog.html" /> <keyword name="MercurialUserDataDialog.getData" id="MercurialUserDataDialog.getData" ref="eric5.Plugins.VcsPlugins.vcsMercurial.ConfigurationPage.MercurialUserDataDialog.html#MercurialUserDataDialog.getData" /> - <keyword name="Message" id="Message" ref="eric5.Utilities.py2flakes.messages.html#Message" /> - <keyword name="Message" id="Message" ref="eric5.Utilities.py3flakes.messages.html#Message" /> - <keyword name="Message (Constructor)" id="Message (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#Message.__init__" /> - <keyword name="Message (Constructor)" id="Message (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#Message.__init__" /> - <keyword name="Message.__str__" id="Message.__str__" ref="eric5.Utilities.py2flakes.messages.html#Message.__str__" /> - <keyword name="Message.__str__" id="Message.__str__" ref="eric5.Utilities.py3flakes.messages.html#Message.__str__" /> - <keyword name="Message.getMessageData" id="Message.getMessageData" ref="eric5.Utilities.py2flakes.messages.html#Message.getMessageData" /> - <keyword name="Message.getMessageData" id="Message.getMessageData" ref="eric5.Utilities.py3flakes.messages.html#Message.getMessageData" /> + <keyword name="Message" id="Message" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Message" /> + <keyword name="Message (Constructor)" id="Message (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Message.__init__" /> + <keyword name="Message.__str__" id="Message.__str__" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Message.__str__" /> + <keyword name="Message.getMessageData" id="Message.getMessageData" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Message.getMessageData" /> <keyword name="MessageBoxWizard" id="MessageBoxWizard" ref="eric5.Plugins.PluginWizardQMessageBox.html#MessageBoxWizard" /> <keyword name="MessageBoxWizard (Constructor)" id="MessageBoxWizard (Constructor)" ref="eric5.Plugins.PluginWizardQMessageBox.html#MessageBoxWizard.__init__" /> <keyword name="MessageBoxWizard (Package)" id="MessageBoxWizard (Package)" ref="index-eric5.Plugins.WizardPlugins.MessageBoxWizard.html" /> @@ -7782,8 +7653,7 @@ <keyword name="ModuleModel.addClass" id="ModuleModel.addClass" ref="eric5.Graphics.ModuleItem.html#ModuleModel.addClass" /> <keyword name="ModuleModel.getClasses" id="ModuleModel.getClasses" ref="eric5.Graphics.ModuleItem.html#ModuleModel.getClasses" /> <keyword name="ModuleParser (Module)" id="ModuleParser (Module)" ref="eric5.Utilities.ModuleParser.html" /> - <keyword name="ModuleScope" id="ModuleScope" ref="eric5.Utilities.py2flakes.checker.html#ModuleScope" /> - <keyword name="ModuleScope" id="ModuleScope" ref="eric5.Utilities.py3flakes.checker.html#ModuleScope" /> + <keyword name="ModuleScope" id="ModuleScope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#ModuleScope" /> <keyword name="MultiProject" id="MultiProject" ref="eric5.MultiProject.MultiProject.html#MultiProject" /> <keyword name="MultiProject (Constructor)" id="MultiProject (Constructor)" ref="eric5.MultiProject.MultiProject.html#MultiProject.__init__" /> <keyword name="MultiProject (Module)" id="MultiProject (Module)" ref="eric5.MultiProject.MultiProject.html" /> @@ -7864,43 +7734,24 @@ <keyword name="MultiProjectWriter (Module)" id="MultiProjectWriter (Module)" ref="eric5.E5XML.MultiProjectWriter.html" /> <keyword name="MultiProjectWriter.writeXML" id="MultiProjectWriter.writeXML" ref="eric5.E5XML.MultiProjectWriter.html#MultiProjectWriter.writeXML" /> <keyword name="NamingStyleChecker" id="NamingStyleChecker" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker" /> - <keyword name="NamingStyleChecker" id="NamingStyleChecker" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker" /> <keyword name="NamingStyleChecker (Constructor)" id="NamingStyleChecker (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__init__" /> - <keyword name="NamingStyleChecker (Constructor)" id="NamingStyleChecker (Constructor)" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__init__" /> <keyword name="NamingStyleChecker (Module)" id="NamingStyleChecker (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html" /> <keyword name="NamingStyleChecker.__checkClassName" id="NamingStyleChecker.__checkClassName" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkClassName" /> - <keyword name="NamingStyleChecker.__checkClassName" id="NamingStyleChecker.__checkClassName" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkClassName" /> <keyword name="NamingStyleChecker.__checkFunctionArgumentNames" id="NamingStyleChecker.__checkFunctionArgumentNames" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkFunctionArgumentNames" /> - <keyword name="NamingStyleChecker.__checkFunctionArgumentNames" id="NamingStyleChecker.__checkFunctionArgumentNames" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkFunctionArgumentNames" /> <keyword name="NamingStyleChecker.__checkFuntionName" id="NamingStyleChecker.__checkFuntionName" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkFuntionName" /> - <keyword name="NamingStyleChecker.__checkFuntionName" id="NamingStyleChecker.__checkFuntionName" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkFuntionName" /> <keyword name="NamingStyleChecker.__checkImportAs" id="NamingStyleChecker.__checkImportAs" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkImportAs" /> - <keyword name="NamingStyleChecker.__checkImportAs" id="NamingStyleChecker.__checkImportAs" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkImportAs" /> <keyword name="NamingStyleChecker.__checkModule" id="NamingStyleChecker.__checkModule" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkModule" /> - <keyword name="NamingStyleChecker.__checkModule" id="NamingStyleChecker.__checkModule" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkModule" /> <keyword name="NamingStyleChecker.__checkNameToBeAvoided" id="NamingStyleChecker.__checkNameToBeAvoided" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkNameToBeAvoided" /> - <keyword name="NamingStyleChecker.__checkNameToBeAvoided" id="NamingStyleChecker.__checkNameToBeAvoided" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkNameToBeAvoided" /> <keyword name="NamingStyleChecker.__checkVariablesInFunction" id="NamingStyleChecker.__checkVariablesInFunction" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__checkVariablesInFunction" /> - <keyword name="NamingStyleChecker.__checkVariablesInFunction" id="NamingStyleChecker.__checkVariablesInFunction" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__checkVariablesInFunction" /> <keyword name="NamingStyleChecker.__error" id="NamingStyleChecker.__error" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__error" /> - <keyword name="NamingStyleChecker.__error" id="NamingStyleChecker.__error" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__error" /> <keyword name="NamingStyleChecker.__findGlobalDefs" id="NamingStyleChecker.__findGlobalDefs" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__findGlobalDefs" /> - <keyword name="NamingStyleChecker.__findGlobalDefs" id="NamingStyleChecker.__findGlobalDefs" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__findGlobalDefs" /> <keyword name="NamingStyleChecker.__getArgNames" id="NamingStyleChecker.__getArgNames" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__getArgNames" /> - <keyword name="NamingStyleChecker.__getArgNames" id="NamingStyleChecker.__getArgNames" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__getArgNames" /> <keyword name="NamingStyleChecker.__isNameToBeAvoided" id="NamingStyleChecker.__isNameToBeAvoided" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__isNameToBeAvoided" /> - <keyword name="NamingStyleChecker.__isNameToBeAvoided" id="NamingStyleChecker.__isNameToBeAvoided" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__isNameToBeAvoided" /> <keyword name="NamingStyleChecker.__tagClassFunctions" id="NamingStyleChecker.__tagClassFunctions" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__tagClassFunctions" /> - <keyword name="NamingStyleChecker.__tagClassFunctions" id="NamingStyleChecker.__tagClassFunctions" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__tagClassFunctions" /> <keyword name="NamingStyleChecker.__visitNode" id="NamingStyleChecker.__visitNode" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__visitNode" /> - <keyword name="NamingStyleChecker.__visitNode" id="NamingStyleChecker.__visitNode" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__visitNode" /> <keyword name="NamingStyleChecker.__visitTree" id="NamingStyleChecker.__visitTree" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.__visitTree" /> - <keyword name="NamingStyleChecker.__visitTree" id="NamingStyleChecker.__visitTree" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.__visitTree" /> - <keyword name="NamingStyleChecker.getMessage" id="NamingStyleChecker.getMessage" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.getMessage" /> <keyword name="NamingStyleChecker.run" id="NamingStyleChecker.run" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.run" /> - <keyword name="NamingStyleChecker.run" id="NamingStyleChecker.run" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.run" /> - <keyword name="NamingStyleChecker.unpackArgs" id="NamingStyleChecker.unpackArgs" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html#NamingStyleChecker.unpackArgs" /> - <keyword name="NamingStyleCheckerPy2 (Module)" id="NamingStyleCheckerPy2 (Module)" ref="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html" /> + <keyword name="NamingStyleChecker.unpackArgs" id="NamingStyleChecker.unpackArgs" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html#NamingStyleChecker.unpackArgs" /> <keyword name="NannyNag" id="NannyNag" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#NannyNag" /> <keyword name="NannyNag (Constructor)" id="NannyNag (Constructor)" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#NannyNag.__init__" /> <keyword name="NannyNag.get_line" id="NannyNag.get_line" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#NannyNag.get_line" /> @@ -9370,8 +9221,6 @@ <keyword name="QRegularExpressionWizardWindow.closeEvent" id="QRegularExpressionWizardWindow.closeEvent" ref="eric5.Plugins.WizardPlugins.QRegularExpressionWizard.QRegularExpressionWizardDialog.html#QRegularExpressionWizardWindow.closeEvent" /> <keyword name="QSCINTILLA_VERSION" id="QSCINTILLA_VERSION" ref="eric5.QScintilla.QsciScintillaCompat.html#QSCINTILLA_VERSION" /> <keyword name="QScintilla (Package)" id="QScintilla (Package)" ref="index-eric5.QScintilla.html" /> - <keyword name="QT_TRANSLATE_NOOP" id="QT_TRANSLATE_NOOP" ref="eric5.Utilities.py2flakes.messages.html#QT_TRANSLATE_NOOP" /> - <keyword name="QT_TRANSLATE_NOOP" id="QT_TRANSLATE_NOOP" ref="eric5.Utilities.py3flakes.messages.html#QT_TRANSLATE_NOOP" /> <keyword name="QsciScintillaCompat" id="QsciScintillaCompat" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat" /> <keyword name="QsciScintillaCompat (Constructor)" id="QsciScintillaCompat (Constructor)" ref="eric5.QScintilla.QsciScintillaCompat.html#QsciScintillaCompat.__init__" /> <keyword name="QsciScintillaCompat (Module)" id="QsciScintillaCompat (Module)" ref="eric5.QScintilla.QsciScintillaCompat.html" /> @@ -9621,16 +9470,12 @@ <keyword name="RebaseProjectHelper.initMenu" id="RebaseProjectHelper.initMenu" ref="eric5.Plugins.VcsPlugins.vcsMercurial.RebaseExtension.ProjectHelper.html#RebaseProjectHelper.initMenu" /> <keyword name="RebaseProjectHelper.menuTitle" id="RebaseProjectHelper.menuTitle" ref="eric5.Plugins.VcsPlugins.vcsMercurial.RebaseExtension.ProjectHelper.html#RebaseProjectHelper.menuTitle" /> <keyword name="RecursionError" id="RecursionError" ref="eric5.Graphics.GraphicsUtilities.html#RecursionError" /> - <keyword name="Redefined" id="Redefined" ref="eric5.Utilities.py2flakes.messages.html#Redefined" /> - <keyword name="Redefined (Constructor)" id="Redefined (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#Redefined.__init__" /> - <keyword name="RedefinedFunction" id="RedefinedFunction" ref="eric5.Utilities.py3flakes.messages.html#RedefinedFunction" /> - <keyword name="RedefinedFunction (Constructor)" id="RedefinedFunction (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#RedefinedFunction.__init__" /> - <keyword name="RedefinedInListComp" id="RedefinedInListComp" ref="eric5.Utilities.py2flakes.messages.html#RedefinedInListComp" /> - <keyword name="RedefinedInListComp (Constructor)" id="RedefinedInListComp (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#RedefinedInListComp.__init__" /> - <keyword name="RedefinedWhileUnused" id="RedefinedWhileUnused" ref="eric5.Utilities.py2flakes.messages.html#RedefinedWhileUnused" /> - <keyword name="RedefinedWhileUnused" id="RedefinedWhileUnused" ref="eric5.Utilities.py3flakes.messages.html#RedefinedWhileUnused" /> - <keyword name="RedefinedWhileUnused (Constructor)" id="RedefinedWhileUnused (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#RedefinedWhileUnused.__init__" /> - <keyword name="RedefinedWhileUnused (Constructor)" id="RedefinedWhileUnused (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#RedefinedWhileUnused.__init__" /> + <keyword name="Redefined" id="Redefined" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Redefined" /> + <keyword name="Redefined (Constructor)" id="Redefined (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#Redefined.__init__" /> + <keyword name="RedefinedInListComp" id="RedefinedInListComp" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#RedefinedInListComp" /> + <keyword name="RedefinedInListComp (Constructor)" id="RedefinedInListComp (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#RedefinedInListComp.__init__" /> + <keyword name="RedefinedWhileUnused" id="RedefinedWhileUnused" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#RedefinedWhileUnused" /> + <keyword name="RedefinedWhileUnused (Constructor)" id="RedefinedWhileUnused (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#RedefinedWhileUnused.__init__" /> <keyword name="Redirector" id="Redirector" ref="eric5.UI.UserInterface.html#Redirector" /> <keyword name="Redirector (Constructor)" id="Redirector (Constructor)" ref="eric5.UI.UserInterface.html#Redirector.__init__" /> <keyword name="Redirector.__bufferedWrite" id="Redirector.__bufferedWrite" ref="eric5.UI.UserInterface.html#Redirector.__bufferedWrite" /> @@ -9664,11 +9509,7 @@ <keyword name="SchemeAccessHandler (Constructor)" id="SchemeAccessHandler (Constructor)" ref="eric5.Helpviewer.Network.SchemeAccessHandler.html#SchemeAccessHandler.__init__" /> <keyword name="SchemeAccessHandler (Module)" id="SchemeAccessHandler (Module)" ref="eric5.Helpviewer.Network.SchemeAccessHandler.html" /> <keyword name="SchemeAccessHandler.createRequest" id="SchemeAccessHandler.createRequest" ref="eric5.Helpviewer.Network.SchemeAccessHandler.html#SchemeAccessHandler.createRequest" /> - <keyword name="Scope" id="Scope" ref="eric5.Utilities.py2flakes.checker.html#Scope" /> - <keyword name="Scope" id="Scope" ref="eric5.Utilities.py3flakes.checker.html#Scope" /> - <keyword name="Scope (Constructor)" id="Scope (Constructor)" ref="eric5.Utilities.py3flakes.checker.html#Scope.__init__" /> - <keyword name="Scope.__repr__" id="Scope.__repr__" ref="eric5.Utilities.py2flakes.checker.html#Scope.__repr__" /> - <keyword name="Scope.__repr__" id="Scope.__repr__" ref="eric5.Utilities.py3flakes.checker.html#Scope.__repr__" /> + <keyword name="Scope" id="Scope" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#Scope" /> <keyword name="SearchReplaceSlidingWidget" id="SearchReplaceSlidingWidget" ref="eric5.QScintilla.SearchReplaceWidget.html#SearchReplaceSlidingWidget" /> <keyword name="SearchReplaceSlidingWidget (Constructor)" id="SearchReplaceSlidingWidget (Constructor)" ref="eric5.QScintilla.SearchReplaceWidget.html#SearchReplaceSlidingWidget.__init__" /> <keyword name="SearchReplaceSlidingWidget.__enableScrollerButtons" id="SearchReplaceSlidingWidget.__enableScrollerButtons" ref="eric5.QScintilla.SearchReplaceWidget.html#SearchReplaceSlidingWidget.__enableScrollerButtons" /> @@ -10204,17 +10045,11 @@ <keyword name="StackedWidget.setCurrentIndex" id="StackedWidget.setCurrentIndex" ref="eric5.Plugins.ViewManagerPlugins.Listspace.Listspace.html#StackedWidget.setCurrentIndex" /> <keyword name="StackedWidget.setCurrentWidget" id="StackedWidget.setCurrentWidget" ref="eric5.Plugins.ViewManagerPlugins.Listspace.Listspace.html#StackedWidget.setCurrentWidget" /> <keyword name="StandardReport" id="StandardReport" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport" /> - <keyword name="StandardReport" id="StandardReport" ref="eric5.UtilitiesPython2.pep8.html#StandardReport" /> <keyword name="StandardReport (Constructor)" id="StandardReport (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport.__init__" /> - <keyword name="StandardReport (Constructor)" id="StandardReport (Constructor)" ref="eric5.UtilitiesPython2.pep8.html#StandardReport.__init__" /> <keyword name="StandardReport.error" id="StandardReport.error" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport.error" /> - <keyword name="StandardReport.error" id="StandardReport.error" ref="eric5.UtilitiesPython2.pep8.html#StandardReport.error" /> <keyword name="StandardReport.error_args" id="StandardReport.error_args" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport.error_args" /> - <keyword name="StandardReport.error_args" id="StandardReport.error_args" ref="eric5.UtilitiesPython2.pep8.html#StandardReport.error_args" /> <keyword name="StandardReport.get_file_results" id="StandardReport.get_file_results" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport.get_file_results" /> - <keyword name="StandardReport.get_file_results" id="StandardReport.get_file_results" ref="eric5.UtilitiesPython2.pep8.html#StandardReport.get_file_results" /> <keyword name="StandardReport.init_file" id="StandardReport.init_file" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StandardReport.init_file" /> - <keyword name="StandardReport.init_file" id="StandardReport.init_file" ref="eric5.UtilitiesPython2.pep8.html#StandardReport.init_file" /> <keyword name="StartDialog" id="StartDialog" ref="eric5.Debugger.StartDialog.html#StartDialog" /> <keyword name="StartDialog (Constructor)" id="StartDialog (Constructor)" ref="eric5.Debugger.StartDialog.html#StartDialog.__init__" /> <keyword name="StartDialog (Module)" id="StartDialog (Module)" ref="eric5.Debugger.StartDialog.html" /> @@ -10240,23 +10075,14 @@ <keyword name="StatusMonitorLed._showContextMenu" id="StatusMonitorLed._showContextMenu" ref="eric5.VCS.StatusMonitorLed.html#StatusMonitorLed._showContextMenu" /> <keyword name="StatusMonitorThread (Module)" id="StatusMonitorThread (Module)" ref="eric5.VCS.StatusMonitorThread.html" /> <keyword name="StyleGuide" id="StyleGuide" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide" /> - <keyword name="StyleGuide" id="StyleGuide" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide" /> <keyword name="StyleGuide (Constructor)" id="StyleGuide (Constructor)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.__init__" /> - <keyword name="StyleGuide (Constructor)" id="StyleGuide (Constructor)" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.__init__" /> <keyword name="StyleGuide.check_files" id="StyleGuide.check_files" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.check_files" /> - <keyword name="StyleGuide.check_files" id="StyleGuide.check_files" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.check_files" /> <keyword name="StyleGuide.excluded" id="StyleGuide.excluded" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.excluded" /> - <keyword name="StyleGuide.excluded" id="StyleGuide.excluded" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.excluded" /> <keyword name="StyleGuide.get_checks" id="StyleGuide.get_checks" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.get_checks" /> - <keyword name="StyleGuide.get_checks" id="StyleGuide.get_checks" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.get_checks" /> <keyword name="StyleGuide.ignore_code" id="StyleGuide.ignore_code" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.ignore_code" /> - <keyword name="StyleGuide.ignore_code" id="StyleGuide.ignore_code" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.ignore_code" /> <keyword name="StyleGuide.init_report" id="StyleGuide.init_report" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.init_report" /> - <keyword name="StyleGuide.init_report" id="StyleGuide.init_report" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.init_report" /> <keyword name="StyleGuide.input_dir" id="StyleGuide.input_dir" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.input_dir" /> - <keyword name="StyleGuide.input_dir" id="StyleGuide.input_dir" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.input_dir" /> <keyword name="StyleGuide.input_file" id="StyleGuide.input_file" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#StyleGuide.input_file" /> - <keyword name="StyleGuide.input_file" id="StyleGuide.input_file" ref="eric5.UtilitiesPython2.pep8.html#StyleGuide.input_file" /> <keyword name="Subversion" id="Subversion" ref="eric5.Plugins.VcsPlugins.vcsPySvn.subversion.html#Subversion" /> <keyword name="Subversion" id="Subversion" ref="eric5.Plugins.VcsPlugins.vcsSubversion.subversion.html#Subversion" /> <keyword name="Subversion (Constructor)" id="Subversion (Constructor)" ref="eric5.Plugins.VcsPlugins.vcsPySvn.subversion.html#Subversion.__init__" /> @@ -11182,7 +11008,16 @@ <keyword name="SyncManager.loadSettings" id="SyncManager.loadSettings" ref="eric5.Helpviewer.Sync.SyncManager.html#SyncManager.loadSettings" /> <keyword name="SyncManager.showSyncDialog" id="SyncManager.showSyncDialog" ref="eric5.Helpviewer.Sync.SyncManager.html#SyncManager.showSyncDialog" /> <keyword name="SyncManager.syncEnabled" id="SyncManager.syncEnabled" ref="eric5.Helpviewer.Sync.SyncManager.html#SyncManager.syncEnabled" /> - <keyword name="SyntaxCheck (Module)" id="SyntaxCheck (Module)" ref="eric5.Utilities.SyntaxCheck.html" /> + <keyword name="SyntaxCheck (Module)" id="SyntaxCheck (Module)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html" /> + <keyword name="SyntaxCheckService" id="SyntaxCheckService" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService" /> + <keyword name="SyntaxCheckService (Constructor)" id="SyntaxCheckService (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.__init__" /> + <keyword name="SyntaxCheckService (Module)" id="SyntaxCheckService (Module)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html" /> + <keyword name="SyntaxCheckService.__determineLanguage" id="SyntaxCheckService.__determineLanguage" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.__determineLanguage" /> + <keyword name="SyntaxCheckService.addLanguage" id="SyntaxCheckService.addLanguage" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.addLanguage" /> + <keyword name="SyntaxCheckService.getExtensions" id="SyntaxCheckService.getExtensions" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.getExtensions" /> + <keyword name="SyntaxCheckService.getLanguages" id="SyntaxCheckService.getLanguages" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.getLanguages" /> + <keyword name="SyntaxCheckService.removeLanguage" id="SyntaxCheckService.removeLanguage" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.removeLanguage" /> + <keyword name="SyntaxCheckService.syntaxCheck" id="SyntaxCheckService.syntaxCheck" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html#SyntaxCheckService.syntaxCheck" /> <keyword name="SyntaxChecker (Package)" id="SyntaxChecker (Package)" ref="index-eric5.Plugins.CheckerPlugins.SyntaxChecker.html" /> <keyword name="SyntaxCheckerDialog" id="SyntaxCheckerDialog" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog" /> <keyword name="SyntaxCheckerDialog (Constructor)" id="SyntaxCheckerDialog (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__init__" /> @@ -11190,7 +11025,9 @@ <keyword name="SyntaxCheckerDialog.__clearErrors" id="SyntaxCheckerDialog.__clearErrors" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__clearErrors" /> <keyword name="SyntaxCheckerDialog.__createResultItem" id="SyntaxCheckerDialog.__createResultItem" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__createResultItem" /> <keyword name="SyntaxCheckerDialog.__finish" id="SyntaxCheckerDialog.__finish" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__finish" /> + <keyword name="SyntaxCheckerDialog.__processResult" id="SyntaxCheckerDialog.__processResult" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__processResult" /> <keyword name="SyntaxCheckerDialog.__resort" id="SyntaxCheckerDialog.__resort" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.__resort" /> + <keyword name="SyntaxCheckerDialog.check" id="SyntaxCheckerDialog.check" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.check" /> <keyword name="SyntaxCheckerDialog.on_buttonBox_clicked" id="SyntaxCheckerDialog.on_buttonBox_clicked" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.on_buttonBox_clicked" /> <keyword name="SyntaxCheckerDialog.on_resultList_itemActivated" id="SyntaxCheckerDialog.on_resultList_itemActivated" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.on_resultList_itemActivated" /> <keyword name="SyntaxCheckerDialog.on_showButton_clicked" id="SyntaxCheckerDialog.on_showButton_clicked" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html#SyntaxCheckerDialog.on_showButton_clicked" /> @@ -11203,11 +11040,13 @@ <keyword name="SyntaxCheckerPlugin.__editorOpened" id="SyntaxCheckerPlugin.__editorOpened" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__editorOpened" /> <keyword name="SyntaxCheckerPlugin.__editorShowMenu" id="SyntaxCheckerPlugin.__editorShowMenu" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__editorShowMenu" /> <keyword name="SyntaxCheckerPlugin.__editorSyntaxCheck" id="SyntaxCheckerPlugin.__editorSyntaxCheck" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__editorSyntaxCheck" /> + <keyword name="SyntaxCheckerPlugin.__getPythonOptions" id="SyntaxCheckerPlugin.__getPythonOptions" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__getPythonOptions" /> <keyword name="SyntaxCheckerPlugin.__initialize" id="SyntaxCheckerPlugin.__initialize" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__initialize" /> <keyword name="SyntaxCheckerPlugin.__projectBrowserShowMenu" id="SyntaxCheckerPlugin.__projectBrowserShowMenu" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__projectBrowserShowMenu" /> <keyword name="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck" id="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__projectBrowserSyntaxCheck" /> <keyword name="SyntaxCheckerPlugin.__projectShowMenu" id="SyntaxCheckerPlugin.__projectShowMenu" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__projectShowMenu" /> <keyword name="SyntaxCheckerPlugin.__projectSyntaxCheck" id="SyntaxCheckerPlugin.__projectSyntaxCheck" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__projectSyntaxCheck" /> + <keyword name="SyntaxCheckerPlugin.__translateSyntaxCheck" id="SyntaxCheckerPlugin.__translateSyntaxCheck" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.__translateSyntaxCheck" /> <keyword name="SyntaxCheckerPlugin.activate" id="SyntaxCheckerPlugin.activate" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.activate" /> <keyword name="SyntaxCheckerPlugin.deactivate" id="SyntaxCheckerPlugin.deactivate" ref="eric5.Plugins.PluginSyntaxChecker.html#SyntaxCheckerPlugin.deactivate" /> <keyword name="TRPreviewer" id="TRPreviewer" ref="eric5.Tools.TRPreviewer.html#TRPreviewer" /> @@ -11285,7 +11124,9 @@ <keyword name="TabnannyDialog (Module)" id="TabnannyDialog (Module)" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html" /> <keyword name="TabnannyDialog.__createResultItem" id="TabnannyDialog.__createResultItem" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.__createResultItem" /> <keyword name="TabnannyDialog.__finish" id="TabnannyDialog.__finish" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.__finish" /> + <keyword name="TabnannyDialog.__processResult" id="TabnannyDialog.__processResult" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.__processResult" /> <keyword name="TabnannyDialog.__resort" id="TabnannyDialog.__resort" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.__resort" /> + <keyword name="TabnannyDialog.check" id="TabnannyDialog.check" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.check" /> <keyword name="TabnannyDialog.on_buttonBox_clicked" id="TabnannyDialog.on_buttonBox_clicked" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.on_buttonBox_clicked" /> <keyword name="TabnannyDialog.on_resultList_itemActivated" id="TabnannyDialog.on_resultList_itemActivated" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.on_resultList_itemActivated" /> <keyword name="TabnannyDialog.on_startButton_clicked" id="TabnannyDialog.on_startButton_clicked" ref="eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html#TabnannyDialog.on_startButton_clicked" /> @@ -11304,6 +11145,7 @@ <keyword name="TabnannyPlugin.__projectTabnanny" id="TabnannyPlugin.__projectTabnanny" ref="eric5.Plugins.PluginTabnanny.html#TabnannyPlugin.__projectTabnanny" /> <keyword name="TabnannyPlugin.activate" id="TabnannyPlugin.activate" ref="eric5.Plugins.PluginTabnanny.html#TabnannyPlugin.activate" /> <keyword name="TabnannyPlugin.deactivate" id="TabnannyPlugin.deactivate" ref="eric5.Plugins.PluginTabnanny.html#TabnannyPlugin.deactivate" /> + <keyword name="TabnannyPlugin.indentCheck" id="TabnannyPlugin.indentCheck" ref="eric5.Plugins.PluginTabnanny.html#TabnannyPlugin.indentCheck" /> <keyword name="Tabview" id="Tabview" ref="eric5.Plugins.ViewManagerPlugins.Tabview.Tabview.html#Tabview" /> <keyword name="Tabview (Constructor)" id="Tabview (Constructor)" ref="eric5.Plugins.ViewManagerPlugins.Tabview.Tabview.html#Tabview.__init__" /> <keyword name="Tabview (Module)" id="Tabview (Module)" ref="eric5.Plugins.ViewManagerPlugins.Tabview.Tabview.html" /> @@ -11543,7 +11385,6 @@ <keyword name="ToolGroupConfigurationDialog.on_newButton_clicked" id="ToolGroupConfigurationDialog.on_newButton_clicked" ref="eric5.Preferences.ToolGroupConfigurationDialog.html#ToolGroupConfigurationDialog.on_newButton_clicked" /> <keyword name="ToolGroupConfigurationDialog.on_upButton_clicked" id="ToolGroupConfigurationDialog.on_upButton_clicked" ref="eric5.Preferences.ToolGroupConfigurationDialog.html#ToolGroupConfigurationDialog.on_upButton_clicked" /> <keyword name="Toolbox (Package)" id="Toolbox (Package)" ref="index-eric5.Toolbox.html" /> - <keyword name="Tools (Module)" id="Tools (Module)" ref="eric5.UtilitiesPython2.Tools.html" /> <keyword name="Tools (Package)" id="Tools (Package)" ref="index-eric5.Tools.html" /> <keyword name="Translation" id="Translation" ref="eric5.Tools.TRPreviewer.html#Translation" /> <keyword name="Translation (Constructor)" id="Translation (Constructor)" ref="eric5.Tools.TRPreviewer.html#Translation.__init__" /> @@ -11751,20 +11592,12 @@ <keyword name="UMLSceneSizeDialog.getData" id="UMLSceneSizeDialog.getData" ref="eric5.Graphics.UMLSceneSizeDialog.html#UMLSceneSizeDialog.getData" /> <keyword name="Uid" id="Uid" ref="eric5.Utilities.binplistlib.html#Uid" /> <keyword name="Uid.__repr__" id="Uid.__repr__" ref="eric5.Utilities.binplistlib.html#Uid.__repr__" /> - <keyword name="UnBinding" id="UnBinding" ref="eric5.Utilities.py2flakes.checker.html#UnBinding" /> - <keyword name="UnBinding" id="UnBinding" ref="eric5.Utilities.py3flakes.checker.html#UnBinding" /> - <keyword name="UndefinedExport" id="UndefinedExport" ref="eric5.Utilities.py2flakes.messages.html#UndefinedExport" /> - <keyword name="UndefinedExport" id="UndefinedExport" ref="eric5.Utilities.py3flakes.messages.html#UndefinedExport" /> - <keyword name="UndefinedExport (Constructor)" id="UndefinedExport (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#UndefinedExport.__init__" /> - <keyword name="UndefinedExport (Constructor)" id="UndefinedExport (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#UndefinedExport.__init__" /> - <keyword name="UndefinedLocal" id="UndefinedLocal" ref="eric5.Utilities.py2flakes.messages.html#UndefinedLocal" /> - <keyword name="UndefinedLocal" id="UndefinedLocal" ref="eric5.Utilities.py3flakes.messages.html#UndefinedLocal" /> - <keyword name="UndefinedLocal (Constructor)" id="UndefinedLocal (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#UndefinedLocal.__init__" /> - <keyword name="UndefinedLocal (Constructor)" id="UndefinedLocal (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#UndefinedLocal.__init__" /> - <keyword name="UndefinedName" id="UndefinedName" ref="eric5.Utilities.py2flakes.messages.html#UndefinedName" /> - <keyword name="UndefinedName" id="UndefinedName" ref="eric5.Utilities.py3flakes.messages.html#UndefinedName" /> - <keyword name="UndefinedName (Constructor)" id="UndefinedName (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#UndefinedName.__init__" /> - <keyword name="UndefinedName (Constructor)" id="UndefinedName (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#UndefinedName.__init__" /> + <keyword name="UndefinedExport" id="UndefinedExport" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedExport" /> + <keyword name="UndefinedExport (Constructor)" id="UndefinedExport (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedExport.__init__" /> + <keyword name="UndefinedLocal" id="UndefinedLocal" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedLocal" /> + <keyword name="UndefinedLocal (Constructor)" id="UndefinedLocal (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedLocal.__init__" /> + <keyword name="UndefinedName" id="UndefinedName" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedName" /> + <keyword name="UndefinedName (Constructor)" id="UndefinedName (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UndefinedName.__init__" /> <keyword name="UnittestDialog" id="UnittestDialog" ref="eric5.PyUnit.UnittestDialog.html#UnittestDialog" /> <keyword name="UnittestDialog (Constructor)" id="UnittestDialog (Constructor)" ref="eric5.PyUnit.UnittestDialog.html#UnittestDialog.__init__" /> <keyword name="UnittestDialog (Module)" id="UnittestDialog (Module)" ref="eric5.PyUnit.UnittestDialog.html" /> @@ -11794,14 +11627,10 @@ <keyword name="UnittestWindow" id="UnittestWindow" ref="eric5.PyUnit.UnittestDialog.html#UnittestWindow" /> <keyword name="UnittestWindow (Constructor)" id="UnittestWindow (Constructor)" ref="eric5.PyUnit.UnittestDialog.html#UnittestWindow.__init__" /> <keyword name="UnittestWindow.eventFilter" id="UnittestWindow.eventFilter" ref="eric5.PyUnit.UnittestDialog.html#UnittestWindow.eventFilter" /> - <keyword name="UnusedImport" id="UnusedImport" ref="eric5.Utilities.py2flakes.messages.html#UnusedImport" /> - <keyword name="UnusedImport" id="UnusedImport" ref="eric5.Utilities.py3flakes.messages.html#UnusedImport" /> - <keyword name="UnusedImport (Constructor)" id="UnusedImport (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#UnusedImport.__init__" /> - <keyword name="UnusedImport (Constructor)" id="UnusedImport (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#UnusedImport.__init__" /> - <keyword name="UnusedVariable" id="UnusedVariable" ref="eric5.Utilities.py2flakes.messages.html#UnusedVariable" /> - <keyword name="UnusedVariable" id="UnusedVariable" ref="eric5.Utilities.py3flakes.messages.html#UnusedVariable" /> - <keyword name="UnusedVariable (Constructor)" id="UnusedVariable (Constructor)" ref="eric5.Utilities.py2flakes.messages.html#UnusedVariable.__init__" /> - <keyword name="UnusedVariable (Constructor)" id="UnusedVariable (Constructor)" ref="eric5.Utilities.py3flakes.messages.html#UnusedVariable.__init__" /> + <keyword name="UnusedImport" id="UnusedImport" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UnusedImport" /> + <keyword name="UnusedImport (Constructor)" id="UnusedImport (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UnusedImport.__init__" /> + <keyword name="UnusedVariable" id="UnusedVariable" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UnusedVariable" /> + <keyword name="UnusedVariable (Constructor)" id="UnusedVariable (Constructor)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html#UnusedVariable.__init__" /> <keyword name="UrlBar" id="UrlBar" ref="eric5.Helpviewer.UrlBar.UrlBar.html#UrlBar" /> <keyword name="UrlBar (Constructor)" id="UrlBar (Constructor)" ref="eric5.Helpviewer.UrlBar.UrlBar.html#UrlBar.__init__" /> <keyword name="UrlBar (Module)" id="UrlBar (Module)" ref="eric5.Helpviewer.UrlBar.UrlBar.html" /> @@ -12085,7 +11914,6 @@ <keyword name="UserPropertiesDialog (Module)" id="UserPropertiesDialog (Module)" ref="eric5.Project.UserPropertiesDialog.html" /> <keyword name="UserPropertiesDialog.storeData" id="UserPropertiesDialog.storeData" ref="eric5.Project.UserPropertiesDialog.html#UserPropertiesDialog.storeData" /> <keyword name="Utilities (Package)" id="Utilities (Package)" ref="index-eric5.Utilities.html" /> - <keyword name="UtilitiesPython2 (Package)" id="UtilitiesPython2 (Package)" ref="index-eric5.UtilitiesPython2.html" /> <keyword name="VCS (Package)" id="VCS (Package)" ref="index-eric5.VCS.html" /> <keyword name="VariableDetailDialog" id="VariableDetailDialog" ref="eric5.Debugger.VariableDetailDialog.html#VariableDetailDialog" /> <keyword name="VariableDetailDialog (Constructor)" id="VariableDetailDialog (Constructor)" ref="eric5.Debugger.VariableDetailDialog.html#VariableDetailDialog.__init__" /> @@ -12758,15 +12586,20 @@ <keyword name="__getMasterPassword" id="__getMasterPassword" ref="eric5.Utilities.crypto.__init__.html#__getMasterPassword" /> <keyword name="__getPygmentsLexer" id="__getPygmentsLexer" ref="eric5.QScintilla.Lexers.__init__.html#__getPygmentsLexer" /> <keyword name="__initChannelModesDict" id="__initChannelModesDict" ref="eric5.Network.IRC.IrcUtilities.html#__initChannelModesDict" /> + <keyword name="__init__" id="__init__" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__init__" /> + <keyword name="__init___1" id="__init___1" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__init___1" /> + <keyword name="__init___2" id="__init___2" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__init___2" /> <keyword name="__messageBox" id="__messageBox" ref="eric5.E5Gui.E5MessageBox.html#__messageBox" /> <keyword name="__readShortcut" id="__readShortcut" ref="eric5.Preferences.Shortcuts.html#__readShortcut" /> <keyword name="__render" id="__render" ref="eric5.Helpviewer.HelpSnap.html#__render" /> <keyword name="__reorderFilter" id="__reorderFilter" ref="eric5.E5Gui.E5FileDialog.html#__reorderFilter" /> + <keyword name="__repr__" id="__repr__" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__repr__" /> + <keyword name="__repr___1" id="__repr___1" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__repr___1" /> <keyword name="__saveShortcut" id="__saveShortcut" ref="eric5.Preferences.Shortcuts.html#__saveShortcut" /> <keyword name="__setAction" id="__setAction" ref="eric5.Preferences.Shortcuts.html#__setAction" /> <keyword name="__showwarning" id="__showwarning" ref="eric5.Utilities.__init__.html#__showwarning" /> + <keyword name="__str__" id="__str__" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#__str__" /> <keyword name="_add_check" id="_add_check" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#_add_check" /> - <keyword name="_add_check" id="_add_check" ref="eric5.UtilitiesPython2.pep8.html#_add_check" /> <keyword name="_buildChildrenLists" id="_buildChildrenLists" ref="eric5.Graphics.GraphicsUtilities.html#_buildChildrenLists" /> <keyword name="_debugclient_start_new_thread" id="_debugclient_start_new_thread" ref="eric5.DebugClients.Python.DebugClientThreads.html#_debugclient_start_new_thread" /> <keyword name="_debugclient_start_new_thread" id="_debugclient_start_new_thread" ref="eric5.DebugClients.Python3.DebugClientThreads.html#_debugclient_start_new_thread" /> @@ -12774,7 +12607,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.CodeStyleChecker.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" /> @@ -12784,23 +12616,19 @@ <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.CodeStyleChecker.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" /> <keyword name="checkBlacklistedVersions" id="checkBlacklistedVersions" ref="eric5.Globals.__init__.html#checkBlacklistedVersions" /> <keyword name="checkPyside" id="checkPyside" ref="eric5.Utilities.__init__.html#checkPyside" /> - <keyword name="checker (Module)" id="checker (Module)" ref="eric5.Utilities.py2flakes.checker.html" /> - <keyword name="checker (Module)" id="checker (Module)" ref="eric5.Utilities.py3flakes.checker.html" /> + <keyword name="checker (Module)" id="checker (Module)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html" /> <keyword name="cleanUp" id="cleanUp" ref="eric5.install.html#cleanUp" /> <keyword name="close" id="close" ref="eric5.DebugClients.Ruby.AsyncFile.html#close" /> + <keyword name="codeStyleCheck" id="codeStyleCheck" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#codeStyleCheck" /> <keyword name="compactPath" id="compactPath" ref="eric5.Utilities.__init__.html#compactPath" /> <keyword name="comparison_to_singleton" id="comparison_to_singleton" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#comparison_to_singleton" /> - <keyword name="comparison_to_singleton" id="comparison_to_singleton" ref="eric5.UtilitiesPython2.pep8.html#comparison_to_singleton" /> <keyword name="comparison_type" id="comparison_type" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#comparison_type" /> - <keyword name="comparison_type" id="comparison_type" ref="eric5.UtilitiesPython2.pep8.html#comparison_type" /> <keyword name="compatibility_fixes (Module)" id="compatibility_fixes (Module)" ref="eric5.Utilities.compatibility_fixes.html" /> - <keyword name="compile" id="compile" ref="eric5.Utilities.__init__.html#compile" /> <keyword name="compileUiDir" id="compileUiDir" ref="eric5.Utilities.uic.html#compileUiDir" /> <keyword name="compileUiDir" id="compileUiDir" ref="eric5.compileUiFiles.html#compileUiDir" /> <keyword name="compileUiDir" id="compileUiDir" ref="eric5.install.html#compileUiDir" /> @@ -12808,18 +12636,14 @@ <keyword name="compileUiFiles" id="compileUiFiles" ref="eric5.compileUiFiles.html#compileUiFiles" /> <keyword name="compileUiFiles" id="compileUiFiles" ref="eric5.install.html#compileUiFiles" /> <keyword name="compileUiFiles (Module)" id="compileUiFiles (Module)" ref="eric5.compileUiFiles.html" /> - <keyword name="compile_and_check" id="compile_and_check" ref="eric5.Utilities.SyntaxCheck.html#compile_and_check" /> - <keyword name="compile_extern" id="compile_extern" ref="eric5.Utilities.__init__.html#compile_extern" /> <keyword name="compile_ui" id="compile_ui" ref="eric5.Utilities.uic.html#compile_ui" /> <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.CodeStyleChecker.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" /> <keyword name="continued_indentation" id="continued_indentation" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#continued_indentation" /> - <keyword name="continued_indentation" id="continued_indentation" ref="eric5.UtilitiesPython2.pep8.html#continued_indentation" /> <keyword name="convertLineEnds" id="convertLineEnds" ref="eric5.Utilities.__init__.html#convertLineEnds" /> <keyword name="convertPasswords" id="convertPasswords" ref="eric5.Preferences.__init__.html#convertPasswords" /> <keyword name="copyToFile" id="copyToFile" ref="eric5.install.html#copyToFile" /> @@ -12913,11 +12737,11 @@ <keyword name="dataString" id="dataString" ref="eric5.Helpviewer.Download.DownloadUtilities.html#dataString" /> <keyword name="dateFromTime_t" id="dateFromTime_t" ref="eric5.Plugins.VcsPlugins.vcsPySvn.SvnUtilities.html#dateFromTime_t" /> <keyword name="debug_thread_info" id="debug_thread_info" ref="eric5.DebugClients.Ruby.Debuggee.html#debug_thread_info" /> - <keyword name="decode" id="decode" ref="eric5.Utilities.SyntaxCheck.html#decode" /> - <keyword name="decode" id="decode" ref="eric5.UtilitiesPython2.Tools.html#decode" /> + <keyword name="decode" id="decode" ref="eric5.Utilities.__init__.html#decode" /> <keyword name="decodeBytes" id="decodeBytes" ref="eric5.Utilities.__init__.html#decodeBytes" /> <keyword name="decodeString" id="decodeString" ref="eric5.Utilities.__init__.html#decodeString" /> <keyword name="decryptData" id="decryptData" ref="eric5.Utilities.crypto.py3AES.html#decryptData" /> + <keyword name="determinePythonVersion" id="determinePythonVersion" ref="eric5.Utilities.__init__.html#determinePythonVersion" /> <keyword name="direntries" id="direntries" ref="eric5.Utilities.__init__.html#direntries" /> <keyword name="displayString" id="displayString" ref="eric5.Plugins.PluginVcsMercurial.html#displayString" /> <keyword name="displayString" id="displayString" ref="eric5.Plugins.PluginVcsPySvn.html#displayString" /> @@ -12967,22 +12791,19 @@ <keyword name="exit" id="exit" ref="eric5.install.html#exit" /> <keyword name="exit" id="exit" ref="eric5.uninstall.html#exit" /> <keyword name="expand_indent" id="expand_indent" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#expand_indent" /> - <keyword name="expand_indent" id="expand_indent" ref="eric5.UtilitiesPython2.pep8.html#expand_indent" /> <keyword name="explicit_line_join" id="explicit_line_join" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#explicit_line_join" /> - <keyword name="explicit_line_join" id="explicit_line_join" ref="eric5.UtilitiesPython2.pep8.html#explicit_line_join" /> <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" /> <keyword name="extractFlagsFromFile" id="extractFlagsFromFile" ref="eric5.Utilities.__init__.html#extractFlagsFromFile" /> - <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.Utilities.SyntaxCheck.html#extractLineFlags" /> - <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.UtilitiesPython2.Tools.html#extractLineFlags" /> + <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#extractLineFlags" /> + <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#extractLineFlags" /> + <keyword name="extractLineFlags" id="extractLineFlags" ref="eric5.Utilities.__init__.html#extractLineFlags" /> <keyword name="extraneous_whitespace" id="extraneous_whitespace" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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" /> @@ -13049,9 +12870,10 @@ <keyword name="getIrc" id="getIrc" ref="eric5.Preferences.__init__.html#getIrc" /> <keyword name="getLanguageIcon" id="getLanguageIcon" ref="eric5.QScintilla.Lexers.__init__.html#getLanguageIcon" /> <keyword name="getLexer" id="getLexer" ref="eric5.QScintilla.Lexers.__init__.html#getLexer" /> - <keyword name="getMessage" id="getMessage" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#getMessage" /> <keyword name="getMultiProject" id="getMultiProject" ref="eric5.Preferences.__init__.html#getMultiProject" /> - <keyword name="getNodeName" id="getNodeName" ref="eric5.Utilities.py2flakes.checker.html#getNodeName" /> + <keyword name="getNodeName" id="getNodeName" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#getNodeName" /> + <keyword name="getNodeType" id="getNodeType" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#getNodeType" /> + <keyword name="getNodeType_1" id="getNodeType_1" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#getNodeType_1" /> <keyword name="getOpenFileFiltersList" id="getOpenFileFiltersList" ref="eric5.QScintilla.Lexers.__init__.html#getOpenFileFiltersList" /> <keyword name="getOpenFileName" id="getOpenFileName" ref="eric5.E5Gui.E5FileDialog.html#getOpenFileName" /> <keyword name="getOpenFileNameAndFilter" id="getOpenFileNameAndFilter" ref="eric5.E5Gui.E5FileDialog.html#getOpenFileNameAndFilter" /> @@ -13095,6 +12917,7 @@ <keyword name="getTasks" id="getTasks" ref="eric5.Preferences.__init__.html#getTasks" /> <keyword name="getTemplates" id="getTemplates" ref="eric5.Preferences.__init__.html#getTemplates" /> <keyword name="getTestFileName" id="getTestFileName" ref="eric5.Utilities.__init__.html#getTestFileName" /> + <keyword name="getTranslatedMessage" id="getTranslatedMessage" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html#getTranslatedMessage" /> <keyword name="getTrayStarter" id="getTrayStarter" ref="eric5.Preferences.__init__.html#getTrayStarter" /> <keyword name="getTypeFromTypeName" id="getTypeFromTypeName" ref="eric5.Utilities.ModuleParser.html#getTypeFromTypeName" /> <keyword name="getUI" id="getUI" ref="eric5.Preferences.__init__.html#getUI" /> @@ -13111,10 +12934,8 @@ <keyword name="get_class_members" id="get_class_members" ref="eric5.DebugClients.Python.FlexCompleter.html#get_class_members" /> <keyword name="get_class_members" id="get_class_members" ref="eric5.DebugClients.Python3.FlexCompleter.html#get_class_members" /> <keyword name="get_coding" id="get_coding" ref="eric5.Utilities.__init__.html#get_coding" /> - <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_codingBytes" id="get_codingBytes" ref="eric5.Utilities.__init__.html#get_codingBytes" /> <keyword name="get_parser" id="get_parser" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#get_parser" /> - <keyword name="get_parser" id="get_parser" ref="eric5.UtilitiesPython2.pep8.html#get_parser" /> <keyword name="get_thread" id="get_thread" ref="eric5.DebugClients.Ruby.Debuggee.html#get_thread" /> <keyword name="getpass" id="getpass" ref="eric5.DebugClients.Python.getpass.html#getpass" /> <keyword name="getpass" id="getpass" ref="eric5.DebugClients.Python3.getpass.html#getpass" /> @@ -13137,9 +12958,7 @@ <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.CodeStyleChecker.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.CodeStyleChecker.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" /> @@ -13148,8 +12967,10 @@ <keyword name="initGlobals" id="initGlobals" ref="eric5.uninstall.html#initGlobals" /> <keyword name="initPreferences" id="initPreferences" ref="eric5.Preferences.__init__.html#initPreferences" /> <keyword name="initRecentSettings" id="initRecentSettings" ref="eric5.Preferences.__init__.html#initRecentSettings" /> + <keyword name="initService" id="initService" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html#initService" /> + <keyword name="initService" id="initService" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#initService" /> + <keyword name="initService" id="initService" ref="eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html#initService" /> <keyword name="init_checks_registry" id="init_checks_registry" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#init_checks_registry" /> - <keyword name="init_checks_registry" id="init_checks_registry" ref="eric5.UtilitiesPython2.pep8.html#init_checks_registry" /> <keyword name="initializeResourceSearchPath" id="initializeResourceSearchPath" ref="eric5.Toolbox.Startup.html#initializeResourceSearchPath" /> <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" /> @@ -13166,7 +12987,7 @@ <keyword name="is_stream_binary_plist" id="is_stream_binary_plist" ref="eric5.Utilities.binplistlib.html#is_stream_binary_plist" /> <keyword name="isatty" id="isatty" ref="eric5.DebugClients.Ruby.AsyncFile.html#isatty" /> <keyword name="isinpath" id="isinpath" ref="eric5.Utilities.__init__.html#isinpath" /> - <keyword name="iter_child_nodes" id="iter_child_nodes" ref="eric5.Utilities.py2flakes.checker.html#iter_child_nodes" /> + <keyword name="iter_child_nodes" id="iter_child_nodes" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#iter_child_nodes" /> <keyword name="joinext" id="joinext" ref="eric5.Utilities.__init__.html#joinext" /> <keyword name="jsclbr (Module)" id="jsclbr (Module)" ref="eric5.Utilities.ClassBrowsers.jsclbr.html" /> <keyword name="linesep" id="linesep" ref="eric5.Utilities.__init__.html#linesep" /> @@ -13203,23 +13024,17 @@ <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.CodeStyleChecker.pep8.html#maximum_line_length" /> - <keyword name="maximum_line_length" id="maximum_line_length" ref="eric5.UtilitiesPython2.pep8.html#maximum_line_length" /> <keyword name="messageHandler" id="messageHandler" ref="eric5.E5Gui.E5ErrorMessage.html#messageHandler" /> <keyword name="messageHandlerInstalled" id="messageHandlerInstalled" ref="eric5.E5Gui.E5ErrorMessage.html#messageHandlerInstalled" /> - <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="messages (Module)" id="messages (Module)" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html" /> <keyword name="missing_newline" id="missing_newline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.pep8.html#mute_string" /> - <keyword name="mute_string" id="mute_string" ref="eric5.UtilitiesPython2.pep8.html#mute_string" /> + <keyword name="names" id="names" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#names" /> <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" /> - <keyword name="normalizeCode" id="normalizeCode" ref="eric5.UtilitiesPython2.Tools.html#normalizeCode" /> + <keyword name="normalizeCode" id="normalizeCode" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#normalizeCode" /> <keyword name="normcaseabspath" id="normcaseabspath" ref="eric5.Utilities.__init__.html#normcaseabspath" /> <keyword name="normcasepath" id="normcasepath" ref="eric5.Utilities.__init__.html#normcasepath" /> <keyword name="normjoinpath" id="normjoinpath" ref="eric5.Utilities.__init__.html#normjoinpath" /> @@ -13229,12 +13044,10 @@ <keyword name="parseOptionString" id="parseOptionString" ref="eric5.Utilities.__init__.html#parseOptionString" /> <keyword name="parseString" id="parseString" ref="eric5.Utilities.__init__.html#parseString" /> <keyword name="parse_udiff" id="parse_udiff" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#parse_udiff" /> - <keyword name="parse_udiff" id="parse_udiff" ref="eric5.UtilitiesPython2.pep8.html#parse_udiff" /> <keyword name="patch_modpython (Module)" id="patch_modpython (Module)" ref="eric5.patch_modpython.html" /> <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.CodeStyleChecker.pep8.html" /> - <keyword name="pep8 (Module)" id="pep8 (Module)" ref="eric5.UtilitiesPython2.pep8.html" /> <keyword name="prepareProcess" id="prepareProcess" ref="eric5.Plugins.VcsPlugins.vcsMercurial.HgUtilities.html#prepareProcess" /> <keyword name="prepareQtMacBundle" id="prepareQtMacBundle" ref="eric5.Utilities.__init__.html#prepareQtMacBundle" /> <keyword name="prepareUninstall" id="prepareUninstall" ref="eric5.Plugins.PluginVcsMercurial.html#prepareUninstall" /> @@ -13245,7 +13058,6 @@ <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.CodeStyleChecker.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="proxyAuthenticationRequired" id="proxyAuthenticationRequired" ref="eric5.E5Network.E5NetworkProxyFactory.html#proxyAuthenticationRequired" /> <keyword name="purge (Module)" id="purge (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.PurgeExtension.purge.html" /> @@ -13256,30 +13068,24 @@ <keyword name="pwEncrypt" id="pwEncrypt" ref="eric5.Utilities.crypto.__init__.html#pwEncrypt" /> <keyword name="pwRecode" id="pwRecode" ref="eric5.Utilities.crypto.__init__.html#pwRecode" /> <keyword name="pwReencrypt" id="pwReencrypt" ref="eric5.Utilities.crypto.__init__.html#pwReencrypt" /> - <keyword name="py2flakes (Package)" id="py2flakes (Package)" ref="index-eric5.Utilities.py2flakes.html" /> <keyword name="py3AES (Module)" id="py3AES (Module)" ref="eric5.Utilities.crypto.py3AES.html" /> <keyword name="py3PBKDF2 (Module)" id="py3PBKDF2 (Module)" ref="eric5.Utilities.crypto.py3PBKDF2.html" /> - <keyword name="py3flakes (Package)" id="py3flakes (Package)" ref="index-eric5.Utilities.py3flakes.html" /> <keyword name="pyName" id="pyName" ref="eric5.Utilities.uic.html#pyName" /> <keyword name="pyName" id="pyName" ref="eric5.compileUiFiles.html#pyName" /> <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="pyflakes (Package)" id="pyflakes (Package)" ref="index-eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.html" /> <keyword name="python_3000_backticks" id="python_3000_backticks" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.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="qtHandler" id="qtHandler" ref="eric5.E5Gui.E5ErrorMessage.html#qtHandler" /> <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="quote" id="quote" ref="eric5.Utilities.__init__.html#quote" /> <keyword name="rbclbr (Module)" id="rbclbr (Module)" ref="eric5.Utilities.ClassBrowsers.rbclbr.html" /> <keyword name="read" id="read" ref="eric5.DebugClients.Ruby.AsyncFile.html#read" /> - <keyword name="readEncodedFile" id="readEncodedFile" ref="eric5.Utilities.SyntaxCheck.html#readEncodedFile" /> - <keyword name="readEncodedFile" id="readEncodedFile" ref="eric5.UtilitiesPython2.Tools.html#readEncodedFile" /> + <keyword name="readEncodedFile" id="readEncodedFile" ref="eric5.Utilities.__init__.html#readEncodedFile" /> <keyword name="readEncodedFileWithHash" id="readEncodedFileWithHash" ref="eric5.Utilities.__init__.html#readEncodedFileWithHash" /> <keyword name="readModule" id="readModule" ref="eric5.Utilities.ModuleParser.html#readModule" /> <keyword name="readPlist" id="readPlist" ref="eric5.Utilities.binplistlib.html#readPlist" /> @@ -13288,13 +13094,10 @@ <keyword name="readStringFromStream" id="readStringFromStream" ref="eric5.Utilities.__init__.html#readStringFromStream" /> <keyword name="readToolGroups" id="readToolGroups" ref="eric5.Preferences.__init__.html#readToolGroups" /> <keyword name="read_config" id="read_config" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#read_config" /> - <keyword name="read_config" id="read_config" ref="eric5.UtilitiesPython2.pep8.html#read_config" /> <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.CodeStyleChecker.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.CodeStyleChecker.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.jsclbr.html#readmodule_ex" /> @@ -13303,7 +13106,6 @@ <keyword name="rebase (Module)" id="rebase (Module)" ref="eric5.Plugins.VcsPlugins.vcsMercurial.RebaseExtension.rebase.html" /> <keyword name="registerLexer" id="registerLexer" ref="eric5.QScintilla.Lexers.__init__.html#registerLexer" /> <keyword name="register_check" id="register_check" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#register_check" /> - <keyword name="register_check" id="register_check" ref="eric5.UtilitiesPython2.pep8.html#register_check" /> <keyword name="rehashPassword" id="rehashPassword" ref="eric5.Utilities.crypto.py3PBKDF2.html#rehashPassword" /> <keyword name="relpath" id="relpath" ref="eric5.Utilities.__init__.html#relpath" /> <keyword name="removeMarkers" id="removeMarkers" ref="eric5.UI.CompareDialog.html#removeMarkers" /> @@ -13379,16 +13181,14 @@ <keyword name="startDebugger" id="startDebugger" ref="eric5.DebugClients.Python.eric5dbgstub.html#startDebugger" /> <keyword name="startDebugger" id="startDebugger" ref="eric5.DebugClients.Python3.eric5dbgstub.html#startDebugger" /> <keyword name="stdin_get_value" id="stdin_get_value" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#stdin_get_value" /> - <keyword name="stdin_get_value" id="stdin_get_value" ref="eric5.UtilitiesPython2.pep8.html#stdin_get_value" /> <keyword name="strip_PKCS7_padding" id="strip_PKCS7_padding" ref="eric5.Utilities.crypto.py3AES.html#strip_PKCS7_padding" /> <keyword name="subversion (Module)" id="subversion (Module)" ref="eric5.Plugins.VcsPlugins.vcsPySvn.subversion.html" /> <keyword name="subversion (Module)" id="subversion (Module)" ref="eric5.Plugins.VcsPlugins.vcsSubversion.subversion.html" /> <keyword name="summarize" id="summarize" ref="eric5.DataViews.CodeMetrics.html#summarize" /> <keyword name="syncPreferences" id="syncPreferences" ref="eric5.Preferences.__init__.html#syncPreferences" /> + <keyword name="syntaxAndPyflakesCheck" id="syntaxAndPyflakesCheck" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#syntaxAndPyflakesCheck" /> <keyword name="tabs_obsolete" id="tabs_obsolete" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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" /> @@ -13402,9 +13202,8 @@ <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.CodeStyleChecker.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.CodeStyleChecker.pep8.html#trailing_whitespace" /> - <keyword name="trailing_whitespace" id="trailing_whitespace" ref="eric5.UtilitiesPython2.pep8.html#trailing_whitespace" /> + <keyword name="translations (Module)" id="translations (Module)" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html" /> <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" /> @@ -13413,6 +13212,7 @@ <keyword name="uninstall (Module)" id="uninstall (Module)" ref="eric5.uninstall.html" /> <keyword name="uninstallEric" id="uninstallEric" ref="eric5.uninstall.html#uninstallEric" /> <keyword name="unregisterLexer" id="unregisterLexer" ref="eric5.QScintilla.Lexers.__init__.html#unregisterLexer" /> + <keyword name="unusedAssignments" id="unusedAssignments" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html#unusedAssignments" /> <keyword name="usage" id="usage" ref="eric5.Toolbox.Startup.html#usage" /> <keyword name="usage" id="usage" ref="eric5.eric5_api.html#usage" /> <keyword name="usage" id="usage" ref="eric5.eric5_doc.html#usage" /> @@ -13429,17 +13229,11 @@ <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.CodeStyleChecker.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_keywords" id="whitespace_around_keywords" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#whitespace_around_keywords" /> - <keyword name="whitespace_around_keywords" id="whitespace_around_keywords" ref="eric5.UtilitiesPython2.pep8.html#whitespace_around_keywords" /> <keyword name="whitespace_around_named_parameter_equals" id="whitespace_around_named_parameter_equals" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.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.CodeStyleChecker.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" /> @@ -13454,10 +13248,6 @@ <keyword name="yesNo" id="yesNo" ref="eric5.E5Gui.E5MessageBox.html#yesNo" /> </keywords> <files> - <file>Pep257CheckerPy2.html</file> - <file>Pep8Checker.html</file> - <file>Pep8NamingCheckerPy2.html</file> - <file>Tools.html</file> <file>eric5.Cooperation.ChatWidget.html</file> <file>eric5.Cooperation.Connection.html</file> <file>eric5.Cooperation.CooperationClient.html</file> @@ -13814,8 +13604,12 @@ <file>eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html</file> <file>eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html</file> <file>eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html</file> - <file>eric5.Plugins.CheckerPlugins.Pep8.pep8.html</file> + <file>eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html</file> + <file>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html</file> + <file>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html</file> <file>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html</file> + <file>eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html</file> + <file>eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html</file> <file>eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html</file> <file>eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html</file> <file>eric5.Plugins.DocumentationPlugins.Ericapi.EricapiConfigDialog.html</file> @@ -14196,6 +13990,8 @@ <file>eric5.UI.SymbolsWidget.html</file> <file>eric5.UI.UserInterface.html</file> <file>eric5.Utilities.AutoSaver.html</file> + <file>eric5.Utilities.BackgroundClient.html</file> + <file>eric5.Utilities.BackgroundService.html</file> <file>eric5.Utilities.ClassBrowsers.ClbrBaseClasses.html</file> <file>eric5.Utilities.ClassBrowsers.__init__.html</file> <file>eric5.Utilities.ClassBrowsers.idlclbr.html</file> @@ -14206,23 +14002,13 @@ <file>eric5.Utilities.ModuleParser.html</file> <file>eric5.Utilities.PasswordChecker.html</file> <file>eric5.Utilities.PySideImporter.html</file> - <file>eric5.Utilities.SyntaxCheck.html</file> <file>eric5.Utilities.__init__.html</file> <file>eric5.Utilities.binplistlib.html</file> <file>eric5.Utilities.compatibility_fixes.html</file> <file>eric5.Utilities.crypto.__init__.html</file> <file>eric5.Utilities.crypto.py3AES.html</file> <file>eric5.Utilities.crypto.py3PBKDF2.html</file> - <file>eric5.Utilities.py2flakes.checker.html</file> - <file>eric5.Utilities.py2flakes.messages.html</file> - <file>eric5.Utilities.py3flakes.checker.html</file> - <file>eric5.Utilities.py3flakes.messages.html</file> <file>eric5.Utilities.uic.html</file> - <file>eric5.UtilitiesPython2.CodeStyleChecker.html</file> - <file>eric5.UtilitiesPython2.DocStyleCheckerPy2.html</file> - <file>eric5.UtilitiesPython2.NamingStyleCheckerPy2.html</file> - <file>eric5.UtilitiesPython2.Tools.html</file> - <file>eric5.UtilitiesPython2.pep8.html</file> <file>eric5.VCS.CommandOptionsDialog.html</file> <file>eric5.VCS.ProjectBrowserHelper.html</file> <file>eric5.VCS.ProjectHelper.html</file> @@ -14308,6 +14094,7 @@ <file>index-eric5.Plugins.AboutPlugin.html</file> <file>index-eric5.Plugins.CheckerPlugins.CodeStyleChecker.html</file> <file>index-eric5.Plugins.CheckerPlugins.SyntaxChecker.html</file> + <file>index-eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.html</file> <file>index-eric5.Plugins.CheckerPlugins.Tabnanny.html</file> <file>index-eric5.Plugins.CheckerPlugins.html</file> <file>index-eric5.Plugins.DocumentationPlugins.Ericapi.html</file> @@ -14359,14 +14146,10 @@ <file>index-eric5.Utilities.ClassBrowsers.html</file> <file>index-eric5.Utilities.crypto.html</file> <file>index-eric5.Utilities.html</file> - <file>index-eric5.Utilities.py2flakes.html</file> - <file>index-eric5.Utilities.py3flakes.html</file> - <file>index-eric5.UtilitiesPython2.html</file> <file>index-eric5.VCS.html</file> <file>index-eric5.ViewManager.html</file> <file>index-eric5.html</file> <file>index.html</file> - <file>pep8.html</file> </files> </filterSection> </QtHelpProject>
--- a/Documentation/Source/Pep257CheckerPy2.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,896 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>Pep257CheckerPy2</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>Pep257CheckerPy2</h1> -<p> -Module implementing a checker for PEP-257 documentation string conventions. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#Pep257Checker">Pep257Checker</a></td> -<td>Class implementing a checker for PEP-257 documentation string conventions.</td> -</tr><tr> -<td><a href="#Pep257Context">Pep257Context</a></td> -<td>Class implementing the source context.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="Pep257Checker" ID="Pep257Checker"></a> -<h2>Pep257Checker</h2> -<p> - Class implementing a checker for PEP-257 documentation string conventions. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>Codes</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Pep257Checker.__init__">Pep257Checker</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkBackslashes">__checkBackslashes</a></td> -<td>Private method to check, that all docstrings containing backslashes are surrounded by raw triple double quotes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkBlankAfterLastParagraph">__checkBlankAfterLastParagraph</a></td> -<td>Private method to check, that the last paragraph of docstrings is followed by a blank line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkBlankAfterSummary">__checkBlankAfterSummary</a></td> -<td>Private method to check, that docstring summaries are followed by a blank line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkBlankBeforeAndAfterClass">__checkBlankBeforeAndAfterClass</a></td> -<td>Private method to check, that class docstrings have one blank line around them.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkClassDocstring">__checkClassDocstring</a></td> -<td>Private method to check, that all public functions and methods have a docstring.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEndsWithPeriod">__checkEndsWithPeriod</a></td> -<td>Private method to check, that docstring summaries end with a period.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricBlankAfterSummary">__checkEricBlankAfterSummary</a></td> -<td>Private method to check, that docstring summaries are followed by a blank line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricEndsWithPeriod">__checkEricEndsWithPeriod</a></td> -<td>Private method to check, that docstring summaries end with a period.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricException">__checkEricException</a></td> -<td>Private method to check, that docstrings contain an @exception line if they raise an exception and don't otherwise.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricFunctionArguments">__checkEricFunctionArguments</a></td> -<td>Private method to check, that docstrings contain an @param and/or @keyparam line for each argument.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricNBlankAfterLastParagraph">__checkEricNBlankAfterLastParagraph</a></td> -<td>Private method to check, that the last paragraph of docstrings is not followed by a blank line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricNoBlankBeforeAndAfterClassOrFunction">__checkEricNoBlankBeforeAndAfterClassOrFunction</a></td> -<td>Private method to check, that class and function/method docstrings have no blank line around them.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricQuotesOnSeparateLines">__checkEricQuotesOnSeparateLines</a></td> -<td>Private method to check, that leading and trailing quotes are on a line by themselves.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkEricReturn">__checkEricReturn</a></td> -<td>Private method to check, that docstrings contain an @return line if they return anything and don't otherwise.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkFunctionDocstring">__checkFunctionDocstring</a></td> -<td>Private method to check, that all public functions and methods have a docstring.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkImperativeMood">__checkImperativeMood</a></td> -<td>Private method to check, that docstring summaries are in imperative mood.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkIndent">__checkIndent</a></td> -<td>Private method to check, that docstrings are properly indented.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkModulesDocstrings">__checkModulesDocstrings</a></td> -<td>Private method to check, if the module has a docstring.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkNoBlankLineBefore">__checkNoBlankLineBefore</a></td> -<td>Private method to check, that function/method docstrings are not preceded by a blank line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkNoSignature">__checkNoSignature</a></td> -<td>Private method to check, that docstring summaries don't repeat the function's signature.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkOneLiner">__checkOneLiner</a></td> -<td>Private method to check, that one-liner docstrings fit on one line with quotes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkReturnType">__checkReturnType</a></td> -<td>Private method to check, that docstrings mention the return value type.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkTripleDoubleQuotes">__checkTripleDoubleQuotes</a></td> -<td>Private method to check, that all docstrings are surrounded by triple double quotes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__checkUnicode">__checkUnicode</a></td> -<td>Private method to check, that all docstrings containing unicode characters are surrounded by unicode triple double quotes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__error">__error</a></td> -<td>Private method to record an issue.</td> -</tr><tr> -<td><a href="#Pep257Checker.__getArgNames">__getArgNames</a></td> -<td></td> -</tr><tr> -<td><a href="#Pep257Checker.__getSummaryLine">__getSummaryLine</a></td> -<td>Private method to extract the summary line.</td> -</tr><tr> -<td><a href="#Pep257Checker.__getSummaryLines">__getSummaryLines</a></td> -<td>Private method to extract the summary lines.</td> -</tr><tr> -<td><a href="#Pep257Checker.__ignoreCode">__ignoreCode</a></td> -<td>Private method to check if the error code should be ignored.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseClasses">__parseClasses</a></td> -<td>Private method to extract top-level classes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseContexts">__parseContexts</a></td> -<td>Private method to extract a context from the source.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseDocstring">__parseDocstring</a></td> -<td>Private method to extract a docstring given `def` or `class` source.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseFunctions">__parseFunctions</a></td> -<td>Private method to extract top-level functions.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseMethods">__parseMethods</a></td> -<td>Private method to extract methods of all classes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseModuleDocstring">__parseModuleDocstring</a></td> -<td>Private method to extract a docstring given a module source.</td> -</tr><tr> -<td><a href="#Pep257Checker.__parseTopLevel">__parseTopLevel</a></td> -<td>Private method to extract top-level functions or classes.</td> -</tr><tr> -<td><a href="#Pep257Checker.__readline">__readline</a></td> -<td>Private method to get the next line from the source.</td> -</tr><tr> -<td><a href="#Pep257Checker.__resetReadline">__resetReadline</a></td> -<td>Private method to reset the internal readline function.</td> -</tr><tr> -<td><a href="#Pep257Checker.__skipIndentedBlock">__skipIndentedBlock</a></td> -<td>Private method to skip over an indented block of source code.</td> -</tr><tr> -<td><a href="#Pep257Checker.run">run</a></td> -<td>Public method to check the given source for violations of doc string conventions according to PEP-257.</td> -</tr><tr> -<td><a href="#Pep257Checker.unpackArgs">unpackArgs</a></td> -<td>Local helper function to unpack function argument names.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Pep257Checker.__init__" ID="Pep257Checker.__init__"></a> -<h4>Pep257Checker (Constructor)</h4> -<b>Pep257Checker</b>(<i>source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257"</i>) -<p> - Constructor -</p><dl> -<dt><i>source</i></dt> -<dd> -source code to be checked (list of string) -</dd><dt><i>filename</i></dt> -<dd> -name of the source file (string) -</dd><dt><i>select</i></dt> -<dd> -list of selected codes (list of string) -</dd><dt><i>ignore</i></dt> -<dd> -list of codes to be ignored (list of string) -</dd><dt><i>expected</i></dt> -<dd> -list of expected codes (list of string) -</dd><dt><i>repeat</i></dt> -<dd> -flag indicating to report each occurrence of a code - (boolean) -</dd><dt><i>maxLineLength=</i></dt> -<dd> -allowed line length (integer) -</dd><dt><i>docType=</i></dt> -<dd> -type of the documentation strings - (string, one of 'eric' or 'pep257') -</dd> -</dl><a NAME="Pep257Checker.__checkBackslashes" ID="Pep257Checker.__checkBackslashes"></a> -<h4>Pep257Checker.__checkBackslashes</h4> -<b>__checkBackslashes</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings containing - backslashes are surrounded by raw triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkBlankAfterLastParagraph" ID="Pep257Checker.__checkBlankAfterLastParagraph"></a> -<h4>Pep257Checker.__checkBlankAfterLastParagraph</h4> -<b>__checkBlankAfterLastParagraph</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that the last paragraph of docstrings is - followed by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkBlankAfterSummary" ID="Pep257Checker.__checkBlankAfterSummary"></a> -<h4>Pep257Checker.__checkBlankAfterSummary</h4> -<b>__checkBlankAfterSummary</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are followed - by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkBlankBeforeAndAfterClass" ID="Pep257Checker.__checkBlankBeforeAndAfterClass"></a> -<h4>Pep257Checker.__checkBlankBeforeAndAfterClass</h4> -<b>__checkBlankBeforeAndAfterClass</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that class docstrings have one - blank line around them. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkClassDocstring" ID="Pep257Checker.__checkClassDocstring"></a> -<h4>Pep257Checker.__checkClassDocstring</h4> -<b>__checkClassDocstring</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all public functions and methods - have a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEndsWithPeriod" ID="Pep257Checker.__checkEndsWithPeriod"></a> -<h4>Pep257Checker.__checkEndsWithPeriod</h4> -<b>__checkEndsWithPeriod</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries end with a period. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricBlankAfterSummary" ID="Pep257Checker.__checkEricBlankAfterSummary"></a> -<h4>Pep257Checker.__checkEricBlankAfterSummary</h4> -<b>__checkEricBlankAfterSummary</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are followed - by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricEndsWithPeriod" ID="Pep257Checker.__checkEricEndsWithPeriod"></a> -<h4>Pep257Checker.__checkEricEndsWithPeriod</h4> -<b>__checkEricEndsWithPeriod</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries end with a period. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricException" ID="Pep257Checker.__checkEricException"></a> -<h4>Pep257Checker.__checkEricException</h4> -<b>__checkEricException</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @exception line - if they raise an exception and don't otherwise. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricFunctionArguments" ID="Pep257Checker.__checkEricFunctionArguments"></a> -<h4>Pep257Checker.__checkEricFunctionArguments</h4> -<b>__checkEricFunctionArguments</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @param and/or - @keyparam line for each argument. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricNBlankAfterLastParagraph" ID="Pep257Checker.__checkEricNBlankAfterLastParagraph"></a> -<h4>Pep257Checker.__checkEricNBlankAfterLastParagraph</h4> -<b>__checkEricNBlankAfterLastParagraph</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that the last paragraph of docstrings is - not followed by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricNoBlankBeforeAndAfterClassOrFunction" ID="Pep257Checker.__checkEricNoBlankBeforeAndAfterClassOrFunction"></a> -<h4>Pep257Checker.__checkEricNoBlankBeforeAndAfterClassOrFunction</h4> -<b>__checkEricNoBlankBeforeAndAfterClassOrFunction</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that class and function/method docstrings - have no blank line around them. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricQuotesOnSeparateLines" ID="Pep257Checker.__checkEricQuotesOnSeparateLines"></a> -<h4>Pep257Checker.__checkEricQuotesOnSeparateLines</h4> -<b>__checkEricQuotesOnSeparateLines</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that leading and trailing quotes are on - a line by themselves. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkEricReturn" ID="Pep257Checker.__checkEricReturn"></a> -<h4>Pep257Checker.__checkEricReturn</h4> -<b>__checkEricReturn</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @return line - if they return anything and don't otherwise. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkFunctionDocstring" ID="Pep257Checker.__checkFunctionDocstring"></a> -<h4>Pep257Checker.__checkFunctionDocstring</h4> -<b>__checkFunctionDocstring</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all public functions and methods - have a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkImperativeMood" ID="Pep257Checker.__checkImperativeMood"></a> -<h4>Pep257Checker.__checkImperativeMood</h4> -<b>__checkImperativeMood</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are in - imperative mood. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkIndent" ID="Pep257Checker.__checkIndent"></a> -<h4>Pep257Checker.__checkIndent</h4> -<b>__checkIndent</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings are properly indented. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkModulesDocstrings" ID="Pep257Checker.__checkModulesDocstrings"></a> -<h4>Pep257Checker.__checkModulesDocstrings</h4> -<b>__checkModulesDocstrings</b>(<i>docstringContext, context</i>) -<p> - Private method to check, if the module has a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkNoBlankLineBefore" ID="Pep257Checker.__checkNoBlankLineBefore"></a> -<h4>Pep257Checker.__checkNoBlankLineBefore</h4> -<b>__checkNoBlankLineBefore</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that function/method docstrings are not - preceded by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkNoSignature" ID="Pep257Checker.__checkNoSignature"></a> -<h4>Pep257Checker.__checkNoSignature</h4> -<b>__checkNoSignature</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries don't repeat - the function's signature. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkOneLiner" ID="Pep257Checker.__checkOneLiner"></a> -<h4>Pep257Checker.__checkOneLiner</h4> -<b>__checkOneLiner</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that one-liner docstrings fit on - one line with quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkReturnType" ID="Pep257Checker.__checkReturnType"></a> -<h4>Pep257Checker.__checkReturnType</h4> -<b>__checkReturnType</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings mention the return value type. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkTripleDoubleQuotes" ID="Pep257Checker.__checkTripleDoubleQuotes"></a> -<h4>Pep257Checker.__checkTripleDoubleQuotes</h4> -<b>__checkTripleDoubleQuotes</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings are surrounded - by triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__checkUnicode" ID="Pep257Checker.__checkUnicode"></a> -<h4>Pep257Checker.__checkUnicode</h4> -<b>__checkUnicode</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings containing unicode - characters are surrounded by unicode triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__error" ID="Pep257Checker.__error"></a> -<h4>Pep257Checker.__error</h4> -<b>__error</b>(<i>lineNumber, offset, code, *args</i>) -<p> - Private method to record an issue. -</p><dl> -<dt><i>lineNumber</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>args</i></dt> -<dd> -arguments for the message (list) -</dd> -</dl><a NAME="Pep257Checker.__getArgNames" ID="Pep257Checker.__getArgNames"></a> -<h4>Pep257Checker.__getArgNames</h4> -<b>__getArgNames</b>(<i>node</i>) -<a NAME="Pep257Checker.__getSummaryLine" ID="Pep257Checker.__getSummaryLine"></a> -<h4>Pep257Checker.__getSummaryLine</h4> -<b>__getSummaryLine</b>(<i>docstringContext</i>) -<p> - Private method to extract the summary line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -summary line (string) and the line it was found on (integer) -</dd> -</dl><a NAME="Pep257Checker.__getSummaryLines" ID="Pep257Checker.__getSummaryLines"></a> -<h4>Pep257Checker.__getSummaryLines</h4> -<b>__getSummaryLines</b>(<i>docstringContext</i>) -<p> - Private method to extract the summary lines. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (Pep257Context) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -summary lines (list of string) and the line it was found on - (integer) -</dd> -</dl><a NAME="Pep257Checker.__ignoreCode" ID="Pep257Checker.__ignoreCode"></a> -<h4>Pep257Checker.__ignoreCode</h4> -<b>__ignoreCode</b>(<i>code</i>) -<p> - Private method to check if the error code should be ignored. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code to check for (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating to ignore the given code (boolean) -</dd> -</dl><a NAME="Pep257Checker.__parseClasses" ID="Pep257Checker.__parseClasses"></a> -<h4>Pep257Checker.__parseClasses</h4> -<b>__parseClasses</b>(<i></i>) -<p> - Private method to extract top-level classes. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted class contexts (list of Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseContexts" ID="Pep257Checker.__parseContexts"></a> -<h4>Pep257Checker.__parseContexts</h4> -<b>__parseContexts</b>(<i>kind</i>) -<p> - Private method to extract a context from the source. -</p><dl> -<dt><i>kind</i></dt> -<dd> -kind of context to extract (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -requested contexts (list of Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseDocstring" ID="Pep257Checker.__parseDocstring"></a> -<h4>Pep257Checker.__parseDocstring</h4> -<b>__parseDocstring</b>(<i>context, what=''</i>) -<p> - Private method to extract a docstring given `def` or `class` source. -</p><dl> -<dt><i>context</i></dt> -<dd> -context data to get the docstring from (Pep257Context) -</dd><dt><i>what</i></dt> -<dd> -string denoting what is being parsed (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -context of extracted docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseFunctions" ID="Pep257Checker.__parseFunctions"></a> -<h4>Pep257Checker.__parseFunctions</h4> -<b>__parseFunctions</b>(<i></i>) -<p> - Private method to extract top-level functions. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted function contexts (list of Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseMethods" ID="Pep257Checker.__parseMethods"></a> -<h4>Pep257Checker.__parseMethods</h4> -<b>__parseMethods</b>(<i></i>) -<p> - Private method to extract methods of all classes. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted method contexts (list of Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseModuleDocstring" ID="Pep257Checker.__parseModuleDocstring"></a> -<h4>Pep257Checker.__parseModuleDocstring</h4> -<b>__parseModuleDocstring</b>(<i>source</i>) -<p> - Private method to extract a docstring given a module source. -</p><dl> -<dt><i>source</i></dt> -<dd> -source to parse (list of string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -context of extracted docstring (Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__parseTopLevel" ID="Pep257Checker.__parseTopLevel"></a> -<h4>Pep257Checker.__parseTopLevel</h4> -<b>__parseTopLevel</b>(<i>keyword</i>) -<p> - Private method to extract top-level functions or classes. -</p><dl> -<dt><i>keyword</i></dt> -<dd> -keyword signaling what to extract (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -extracted function or class contexts (list of Pep257Context) -</dd> -</dl><a NAME="Pep257Checker.__readline" ID="Pep257Checker.__readline"></a> -<h4>Pep257Checker.__readline</h4> -<b>__readline</b>(<i></i>) -<p> - Private method to get the next line from the source. -</p><dl> -<dt>Returns:</dt> -<dd> -next line of source (string) -</dd> -</dl><a NAME="Pep257Checker.__resetReadline" ID="Pep257Checker.__resetReadline"></a> -<h4>Pep257Checker.__resetReadline</h4> -<b>__resetReadline</b>(<i></i>) -<p> - Private method to reset the internal readline function. -</p><a NAME="Pep257Checker.__skipIndentedBlock" ID="Pep257Checker.__skipIndentedBlock"></a> -<h4>Pep257Checker.__skipIndentedBlock</h4> -<b>__skipIndentedBlock</b>(<i>tokenGenerator</i>) -<p> - Private method to skip over an indented block of source code. -</p><dl> -<dt><i>tokenGenerator</i></dt> -<dd> -token generator -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -last token of the indented block -</dd> -</dl><a NAME="Pep257Checker.run" ID="Pep257Checker.run"></a> -<h4>Pep257Checker.run</h4> -<b>run</b>(<i></i>) -<p> - Public method to check the given source for violations of doc string - conventions according to PEP-257. -</p><a NAME="Pep257Checker.unpackArgs" ID="Pep257Checker.unpackArgs"></a> -<h4>Pep257Checker.unpackArgs</h4> -<b>unpackArgs</b>(<i></i>) -<p> - Local helper function to unpack function argument names. -</p><dl> -<dt><i>args</i></dt> -<dd> -list of AST node arguments -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="Pep257Context" ID="Pep257Context"></a> -<h2>Pep257Context</h2> -<p> - Class implementing the source context. -</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="#Pep257Context.__init__">Pep257Context</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Pep257Context.contextType">contextType</a></td> -<td>Public method to get the context type.</td> -</tr><tr> -<td><a href="#Pep257Context.end">end</a></td> -<td>Public method to get the end line number.</td> -</tr><tr> -<td><a href="#Pep257Context.indent">indent</a></td> -<td>Public method to get the indentation of the first line.</td> -</tr><tr> -<td><a href="#Pep257Context.source">source</a></td> -<td>Public method to get the source.</td> -</tr><tr> -<td><a href="#Pep257Context.ssource">ssource</a></td> -<td>Public method to get the joined source lines.</td> -</tr><tr> -<td><a href="#Pep257Context.start">start</a></td> -<td>Public method to get the start line number.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Pep257Context.__init__" ID="Pep257Context.__init__"></a> -<h4>Pep257Context (Constructor)</h4> -<b>Pep257Context</b>(<i>source, startLine, contextType</i>) -<p> - Constructor -</p><dl> -<dt><i>source</i></dt> -<dd> -source code of the context (list of string or string) -</dd><dt><i>startLine</i></dt> -<dd> -line number the context starts in the source (integer) -</dd><dt><i>contextType</i></dt> -<dd> -type of the context object (string) -</dd> -</dl><a NAME="Pep257Context.contextType" ID="Pep257Context.contextType"></a> -<h4>Pep257Context.contextType</h4> -<b>contextType</b>(<i></i>) -<p> - Public method to get the context type. -</p><dl> -<dt>Returns:</dt> -<dd> -context type (string) -</dd> -</dl><a NAME="Pep257Context.end" ID="Pep257Context.end"></a> -<h4>Pep257Context.end</h4> -<b>end</b>(<i></i>) -<p> - Public method to get the end line number. -</p><dl> -<dt>Returns:</dt> -<dd> -end line number (integer) -</dd> -</dl><a NAME="Pep257Context.indent" ID="Pep257Context.indent"></a> -<h4>Pep257Context.indent</h4> -<b>indent</b>(<i></i>) -<p> - Public method to get the indentation of the first line. -</p><dl> -<dt>Returns:</dt> -<dd> -indentation string (string) -</dd> -</dl><a NAME="Pep257Context.source" ID="Pep257Context.source"></a> -<h4>Pep257Context.source</h4> -<b>source</b>(<i></i>) -<p> - Public method to get the source. -</p><dl> -<dt>Returns:</dt> -<dd> -source (list of string) -</dd> -</dl><a NAME="Pep257Context.ssource" ID="Pep257Context.ssource"></a> -<h4>Pep257Context.ssource</h4> -<b>ssource</b>(<i></i>) -<p> - Public method to get the joined source lines. -</p><dl> -<dt>Returns:</dt> -<dd> -source (string) -</dd> -</dl><a NAME="Pep257Context.start" ID="Pep257Context.start"></a> -<h4>Pep257Context.start</h4> -<b>start</b>(<i></i>) -<p> - Public method to get the start line number. -</p><dl> -<dt>Returns:</dt> -<dd> -start line number (integer) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/Pep8Checker.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>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>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="#Pep8Report">Pep8Report</a></td> -<td>Class implementing a special report to be used with our dialog.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="Pep8Report" ID="Pep8Report"></a> -<h2>Pep8Report</h2> -<p> - Class implementing a special report to be used with our dialog. -</p> -<h3>Derived from</h3> -pep8 -<h3>Class Attributes</h3> -<table> -<tr><td>docType</td></tr><tr><td>filename</td></tr><tr><td>hang_closing</td></tr><tr><td>ignore</td></tr><tr><td>max_line_length</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="#Pep8Report.__init__">Pep8Report</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#Pep8Report.error_args">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="Pep8Report.__init__" ID="Pep8Report.__init__"></a> -<h4>Pep8Report (Constructor)</h4> -<b>Pep8Report</b>(<i>options</i>) -<p> - Constructor -</p><dl> -<dt><i>options</i></dt> -<dd> -options for the report (optparse.Values) -</dd> -</dl><a NAME="Pep8Report.error_args" ID="Pep8Report.error_args"></a> -<h4>Pep8Report.error_args</h4> -<b>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/Pep8NamingCheckerPy2.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,396 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>Pep8NamingCheckerPy2</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>Pep8NamingCheckerPy2</h1> -<p> -Module implementing a checker for PEP-8 naming conventions for Python2. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#Pep8NamingChecker">Pep8NamingChecker</a></td> -<td>Class implementing a checker for PEP-8 naming conventions for Python2.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="Pep8NamingChecker" ID="Pep8NamingChecker"></a> -<h2>Pep8NamingChecker</h2> -<p> - Class implementing a checker for PEP-8 naming conventions for Python2. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>CamelcaseRegexp</td></tr><tr><td>Codes</td></tr><tr><td>LowercaseRegex</td></tr><tr><td>MixedcaseRegexp</td></tr><tr><td>UppercaseRegexp</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#Pep8NamingChecker.__init__">Pep8NamingChecker</a></td> -<td>Constructor (according to 'extended' pep8.py API)</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkClassName">__checkClassName</a></td> -<td>Private class to check the given node for class name conventions (N801).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkFunctionArgumentNames">__checkFunctionArgumentNames</a></td> -<td>Private class to check the argument names of functions (N803, N804, N805, N806).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkFuntionName">__checkFuntionName</a></td> -<td>Private class to check the given node for function name conventions (N802).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkImportAs">__checkImportAs</a></td> -<td>Private method to check that imports don't change the naming convention (N811, N812, N813, N814).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkModule">__checkModule</a></td> -<td>Private method to check module naming conventions (N807, N808).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkNameToBeAvoided">__checkNameToBeAvoided</a></td> -<td>Private class to check the given node for a name to be avoided (N831).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__checkVariablesInFunction">__checkVariablesInFunction</a></td> -<td>Private method to check local variables in functions (N821).</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__error">__error</a></td> -<td>Private method to build the error information</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__findGlobalDefs">__findGlobalDefs</a></td> -<td>Private method amend a node with global definitions information.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__getArgNames">__getArgNames</a></td> -<td>Private method to get the argument names of a function node.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__isNameToBeAvoided">__isNameToBeAvoided</a></td> -<td>Private method to check, if the given name should be avoided.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__tagClassFunctions">__tagClassFunctions</a></td> -<td>Private method to tag functions if they are methods, class methods or static methods.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__visitNode">__visitNode</a></td> -<td>Private method to inspect the given AST node.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.__visitTree">__visitTree</a></td> -<td>Private method to scan the given AST tree.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.run">run</a></td> -<td>Public method run by the pep8.py checker.</td> -</tr><tr> -<td><a href="#Pep8NamingChecker.unpackArgs">unpackArgs</a></td> -<td>Local helper function to unpack function argument names.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Pep8NamingChecker.__init__" ID="Pep8NamingChecker.__init__"></a> -<h4>Pep8NamingChecker (Constructor)</h4> -<b>Pep8NamingChecker</b>(<i>tree, filename, options</i>) -<p> - Constructor (according to 'extended' pep8.py API) -</p><dl> -<dt><i>tree</i></dt> -<dd> -AST tree of the source file -</dd><dt><i>filename</i></dt> -<dd> -name of the source file (string) -</dd><dt><i>options</i></dt> -<dd> -options as parsed by pep8.StyleGuide -</dd> -</dl><a NAME="Pep8NamingChecker.__checkClassName" ID="Pep8NamingChecker.__checkClassName"></a> -<h4>Pep8NamingChecker.__checkClassName</h4> -<b>__checkClassName</b>(<i>node, parents</i>) -<p> - Private class to check the given node for class name - conventions (N801). -</p><p> - Almost without exception, class names use the CapWords convention. - Classes for internal use have a leading underscore in addition. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkFunctionArgumentNames" ID="Pep8NamingChecker.__checkFunctionArgumentNames"></a> -<h4>Pep8NamingChecker.__checkFunctionArgumentNames</h4> -<b>__checkFunctionArgumentNames</b>(<i>node, parents</i>) -<p> - Private class to check the argument names of functions - (N803, N804, N805, N806). -</p><p> - The argument names of a function should be lowercase, with words - separated by underscores. A class method should have 'cls' as the - first argument. A method should have 'self' as the first argument. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkFuntionName" ID="Pep8NamingChecker.__checkFuntionName"></a> -<h4>Pep8NamingChecker.__checkFuntionName</h4> -<b>__checkFuntionName</b>(<i>node, parents</i>) -<p> - Private class to check the given node for function name - conventions (N802). -</p><p> - Function names should be lowercase, with words separated by underscores - as necessary to improve readability. Functions <b>not</b> being - methods '__' in front and back are not allowed. Mixed case is allowed - only in contexts where that's already the prevailing style - (e.g. threading.py), to retain backwards compatibility. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkImportAs" ID="Pep8NamingChecker.__checkImportAs"></a> -<h4>Pep8NamingChecker.__checkImportAs</h4> -<b>__checkImportAs</b>(<i>node, parents</i>) -<p> - Private method to check that imports don't change the - naming convention (N811, N812, N813, N814). -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkModule" ID="Pep8NamingChecker.__checkModule"></a> -<h4>Pep8NamingChecker.__checkModule</h4> -<b>__checkModule</b>(<i>node, parents</i>) -<p> - Private method to check module naming conventions (N807, N808). -</p><p> - Module and package names should be lowercase. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkNameToBeAvoided" ID="Pep8NamingChecker.__checkNameToBeAvoided"></a> -<h4>Pep8NamingChecker.__checkNameToBeAvoided</h4> -<b>__checkNameToBeAvoided</b>(<i>node, parents</i>) -<p> - Private class to check the given node for a name to be avoided (N831). -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__checkVariablesInFunction" ID="Pep8NamingChecker.__checkVariablesInFunction"></a> -<h4>Pep8NamingChecker.__checkVariablesInFunction</h4> -<b>__checkVariablesInFunction</b>(<i>node, parents</i>) -<p> - Private method to check local variables in functions (N821). -</p><p> - Local variables in functions should be lowercase. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__error" ID="Pep8NamingChecker.__error"></a> -<h4>Pep8NamingChecker.__error</h4> -<b>__error</b>(<i>node, code</i>) -<p> - Private method to build the error information -</p><dl> -<dt><i>node</i></dt> -<dd> -AST node to report an error for -</dd><dt><i>code</i></dt> -<dd> -error code to report (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="Pep8NamingChecker.__findGlobalDefs" ID="Pep8NamingChecker.__findGlobalDefs"></a> -<h4>Pep8NamingChecker.__findGlobalDefs</h4> -<b>__findGlobalDefs</b>(<i>functionNode</i>) -<p> - Private method amend a node with global definitions information. -</p><dl> -<dt><i>functionNode</i></dt> -<dd> -AST tree node to amend -</dd> -</dl><a NAME="Pep8NamingChecker.__getArgNames" ID="Pep8NamingChecker.__getArgNames"></a> -<h4>Pep8NamingChecker.__getArgNames</h4> -<b>__getArgNames</b>(<i>node</i>) -<p> - Private method to get the argument names of a function node. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST node to extract arguments names from -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</dd> -</dl><a NAME="Pep8NamingChecker.__isNameToBeAvoided" ID="Pep8NamingChecker.__isNameToBeAvoided"></a> -<h4>Pep8NamingChecker.__isNameToBeAvoided</h4> -<b>__isNameToBeAvoided</b>(<i>name</i>) -<p> - Private method to check, if the given name should be avoided. -</p><dl> -<dt><i>name</i></dt> -<dd> -name to be checked (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating to avoid it (boolen) -</dd> -</dl><a NAME="Pep8NamingChecker.__tagClassFunctions" ID="Pep8NamingChecker.__tagClassFunctions"></a> -<h4>Pep8NamingChecker.__tagClassFunctions</h4> -<b>__tagClassFunctions</b>(<i>classNode</i>) -<p> - Private method to tag functions if they are methods, class methods or - static methods. -</p><dl> -<dt><i>classNode</i></dt> -<dd> -AST tree node to tag -</dd> -</dl><a NAME="Pep8NamingChecker.__visitNode" ID="Pep8NamingChecker.__visitNode"></a> -<h4>Pep8NamingChecker.__visitNode</h4> -<b>__visitNode</b>(<i>node</i>) -<p> - Private method to inspect the given AST node. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST tree node to inspect -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="Pep8NamingChecker.__visitTree" ID="Pep8NamingChecker.__visitTree"></a> -<h4>Pep8NamingChecker.__visitTree</h4> -<b>__visitTree</b>(<i>node</i>) -<p> - Private method to scan the given AST tree. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST tree node to scan -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="Pep8NamingChecker.run" ID="Pep8NamingChecker.run"></a> -<h4>Pep8NamingChecker.run</h4> -<b>run</b>(<i></i>) -<p> - Public method run by the pep8.py checker. -</p><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="Pep8NamingChecker.unpackArgs" ID="Pep8NamingChecker.unpackArgs"></a> -<h4>Pep8NamingChecker.unpackArgs</h4> -<b>unpackArgs</b>(<i></i>) -<p> - Local helper function to unpack function argument names. -</p><dl> -<dt><i>args</i></dt> -<dd> -list of AST node arguments -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/Tools.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>Tools</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>Tools</h1> -<p> -Module implementing tool functions. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>coding_regexps</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#decode">decode</a></td> -<td>Function to decode a text.</td> -</tr><tr> -<td><a href="#extractLineFlags">extractLineFlags</a></td> -<td>Function to extract flags starting and ending with '__' from a line comment.</td> -</tr><tr> -<td><a href="#get_coding">get_coding</a></td> -<td>Function to get the coding of a text.</td> -</tr><tr> -<td><a href="#normalizeCode">normalizeCode</a></td> -<td>Function to normalize the given code.</td> -</tr><tr> -<td><a href="#readEncodedFile">readEncodedFile</a></td> -<td>Function to read a file and decode its contents into proper text.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="decode" ID="decode"></a> -<h2>decode</h2> -<b>decode</b>(<i>text</i>) -<p> - Function to decode a text. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to decode (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -decoded text and encoding -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="extractLineFlags" ID="extractLineFlags"></a> -<h2>extractLineFlags</h2> -<b>extractLineFlags</b>(<i>line, startComment="</i>) -<p> - Function to extract flags starting and ending with '__' from a line comment. -</p><dl> -<dt><i>line</i></dt> -<dd> -line to extract flags from (string) -</dd><dt><i>startComment=</i></dt> -<dd> -string identifying the start of the comment (string) -</dd><dt><i>endComment=</i></dt> -<dd> -string identifying the end of a comment (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list containing the extracted flags (list of strings) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_coding" ID="get_coding"></a> -<h2>get_coding</h2> -<b>get_coding</b>(<i>text</i>) -<p> - Function to get the coding of a text. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to inspect (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -coding string -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="normalizeCode" ID="normalizeCode"></a> -<h2>normalizeCode</h2> -<b>normalizeCode</b>(<i>codestring</i>) -<p> - Function to normalize the given code. -</p><dl> -<dt><i>codestring</i></dt> -<dd> -code to be normalized (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -normalized code (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="readEncodedFile" ID="readEncodedFile"></a> -<h2>readEncodedFile</h2> -<b>readEncodedFile</b>(<i>filename</i>) -<p> - Function to read a file and decode its contents into proper text. -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file to read (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple of decoded text and encoding (string, string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -30,22 +30,31 @@ <h3>Classes</h3> <table> <tr> -<td><a href="#CodeStyleCheckerPy2">CodeStyleCheckerPy2</a></td> -<td>Class implementing the code style checker interface for Python 2.</td> +<td><a href="#CodeStyleCheckerReport">CodeStyleCheckerReport</a></td> +<td>Class implementing a special report to be used with our dialog.</td> </tr> </table> <h3>Functions</h3> <table> -<tr><td>None</td></tr> +<tr> +<td><a href="#codeStyleCheck">codeStyleCheck</a></td> +<td>Do the code style check and/ or fix found errors.</td> +</tr><tr> +<td><a href="#extractLineFlags">extractLineFlags</a></td> +<td>Function to extract flags starting and ending with '__' from a line comment.</td> +</tr><tr> +<td><a href="#initService">initService</a></td> +<td>Initialize the service and return the entry point.</td> +</tr> </table> <hr /><hr /> -<a NAME="CodeStyleCheckerPy2" ID="CodeStyleCheckerPy2"></a> -<h2>CodeStyleCheckerPy2</h2> +<a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a> +<h2>CodeStyleCheckerReport</h2> <p> - Class implementing the code style checker interface for Python 2. + Class implementing a special report to be used with our dialog. </p> <h3>Derived from</h3> -object +pep8.BaseReport <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> @@ -57,54 +66,121 @@ <h3>Methods</h3> <table> <tr> -<td><a href="#CodeStyleCheckerPy2.__init__">CodeStyleCheckerPy2</a></td> +<td><a href="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td> <td>Constructor</td> +</tr><tr> +<td><a href="#CodeStyleCheckerReport.error_args">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="CodeStyleCheckerPy2.__init__" ID="CodeStyleCheckerPy2.__init__"></a> -<h4>CodeStyleCheckerPy2 (Constructor)</h4> -<b>CodeStyleCheckerPy2</b>(<i>filename, lines, repeat=False, select="", ignore="", max_line_length=79, hang_closing=False, docType="pep257"</i>) +<a NAME="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a> +<h4>CodeStyleCheckerReport (Constructor)</h4> +<b>CodeStyleCheckerReport</b>(<i>options</i>) <p> Constructor </p><dl> +<dt><i>options</i></dt> +<dd> +options for the report (optparse.Values) +</dd> +</dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a> +<h4>CodeStyleCheckerReport.error_args</h4> +<b>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><dl> +<dt>Returns:</dt> +<dd> +error code (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="codeStyleCheck" ID="codeStyleCheck"></a> +<h2>codeStyleCheck</h2> +<b>codeStyleCheck</b>(<i>filename, source, args</i>) +<p> + Do the code style check and/ or fix found errors. +</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) (ignored) -</dd><dt><i>repeat=</i></dt> +source filename (string) +</dd><dt><i>source</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> +string containing the code to check (string) +</dd><dt><i>args</i></dt> <dd> -list of message IDs to ignore - (comma separated string) -</dd><dt><i>max_line_length=</i></dt> -<dd> -maximum allowed line length (integer) -</dd><dt><i>hang_closing=</i></dt> -<dd> -flag indicating to allow hanging closing - brackets (boolean) -</dd><dt><i>docType=</i></dt> -<dd> -type of the documentation strings - (string, one of 'eric' or 'pep257') +arguments used by the codeStyleCheck function (list of + excludeMessages (str), includeMessages (str), repeatMessages + (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), + maxLineLength (int), hangClosing (bool), docType (str), errors + (list of str), eol (str), encoding (str)) </dd> </dl><dl> -<dt>Raises <b>AssertionError</b>:</dt> +<dt>Returns:</dt> +<dd> +tuple of stats (dict) and results (tuple for each found violation + of style (tuple of lineno (int), position (int), text (str), fixed + (bool), autofixing (bool), fixedMsg (str))) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="extractLineFlags" ID="extractLineFlags"></a> +<h2>extractLineFlags</h2> +<b>extractLineFlags</b>(<i>line, startComment="</i>) +<p> + Function to extract flags starting and ending with '__' from a line + comment. +</p><dl> +<dt><i>line</i></dt> +<dd> +line to extract flags from (string) +</dd><dt><i>startComment=</i></dt> <dd> -raised if the docType argument is not - "eric" or "pep257" +string identifying the start of the comment (string) +</dd><dt><i>endComment=</i></dt> +<dd> +string identifying the end of a comment (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list containing the extracted flags (list of strings) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="initService" ID="initService"></a> +<h2>initService</h2> +<b>initService</b>(<i></i>) +<p> + Initialize the service and return the entry point. +</p><dl> +<dt>Returns:</dt> +<dd> +the entry point for the background client (function) </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog.html Sun Mar 30 22:00:14 2014 +0200 @@ -32,9 +32,6 @@ <tr> <td><a href="#CodeStyleCheckerDialog">CodeStyleCheckerDialog</a></td> <td>Class implementing a dialog to show the results of the code style check.</td> -</tr><tr> -<td><a href="#CodeStyleCheckerReport">CodeStyleCheckerReport</a></td> -<td>Class implementing a special report to be used with our dialog.</td> </tr> </table> <h3>Functions</h3> @@ -72,6 +69,9 @@ <td><a href="#CodeStyleCheckerDialog.__finish">__finish</a></td> <td>Private slot called when the code style check finished or the user pressed the cancel button.</td> </tr><tr> +<td><a href="#CodeStyleCheckerDialog.__getEol">__getEol</a></td> +<td>Private method to get the applicable eol string.</td> +</tr><tr> <td><a href="#CodeStyleCheckerDialog.__getSelectedFixableItems">__getSelectedFixableItems</a></td> <td>Private method to extract all selected items for fixable issues.</td> </tr><tr> @@ -81,6 +81,9 @@ <td><a href="#CodeStyleCheckerDialog.__modifyFixedResultItem">__modifyFixedResultItem</a></td> <td>Private method to modify a result list entry to show its positive fixed state.</td> </tr><tr> +<td><a href="#CodeStyleCheckerDialog.__processResult">__processResult</a></td> +<td>Privat slot called after perfoming a style check on one file.</td> +</tr><tr> <td><a href="#CodeStyleCheckerDialog.__resetStatistics">__resetStatistics</a></td> <td>Private slot to reset the statistics data.</td> </tr><tr> @@ -96,6 +99,9 @@ <td><a href="#CodeStyleCheckerDialog.__updateStatistics">__updateStatistics</a></td> <td>Private method to update the collected statistics.</td> </tr><tr> +<td><a href="#CodeStyleCheckerDialog.check">check</a></td> +<td>Start a style check for one file.</td> +</tr><tr> <td><a href="#CodeStyleCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> <td>Private slot called by a button of the button box clicked.</td> </tr><tr> @@ -151,11 +157,15 @@ </table> <a NAME="CodeStyleCheckerDialog.__init__" ID="CodeStyleCheckerDialog.__init__"></a> <h4>CodeStyleCheckerDialog (Constructor)</h4> -<b>CodeStyleCheckerDialog</b>(<i>parent=None</i>) +<b>CodeStyleCheckerDialog</b>(<i>styleCheckService, parent=None</i>) <p> Constructor </p><dl> -<dt><i>parent</i></dt> +<dt><i>styleCheckService</i></dt> +<dd> +reference to the service + (CodeStyleCheckService) +</dd><dt><i>parent</i></dt> <dd> reference to the parent widget (QWidget) </dd> @@ -207,7 +217,22 @@ <p> Private slot called when the code style check finished or the user pressed the cancel button. -</p><a NAME="CodeStyleCheckerDialog.__getSelectedFixableItems" ID="CodeStyleCheckerDialog.__getSelectedFixableItems"></a> +</p><a NAME="CodeStyleCheckerDialog.__getEol" ID="CodeStyleCheckerDialog.__getEol"></a> +<h4>CodeStyleCheckerDialog.__getEol</h4> +<b>__getEol</b>(<i>fn</i>) +<p> + Private method to get the applicable eol string. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename where to determine the line ending (str) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +eol string (string) +</dd> +</dl><a NAME="CodeStyleCheckerDialog.__getSelectedFixableItems" ID="CodeStyleCheckerDialog.__getSelectedFixableItems"></a> <h4>CodeStyleCheckerDialog.__getSelectedFixableItems</h4> <b>__getSelectedFixableItems</b>(<i></i>) <p> @@ -249,6 +274,27 @@ <dd> flag indicating a fixed issue (boolean) </dd> +</dl><a NAME="CodeStyleCheckerDialog.__processResult" ID="CodeStyleCheckerDialog.__processResult"></a> +<h4>CodeStyleCheckerDialog.__processResult</h4> +<b>__processResult</b>(<i>fn, codeStyleCheckerStats, fixes, results</i>) +<p> + Privat slot called after perfoming a style check on one file. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the just checked file (str) +</dd><dt><i>codeStyleCheckerStats</i></dt> +<dd> +stats of style and name check (dict) +</dd><dt><i>fixes</i></dt> +<dd> +number of applied fixes (int) +</dd><dt><i>results</i></dt> +<dd> +tuple for each found violation of style (tuple of + lineno (int), position (int), text (str), fixed (bool), + autofixing (bool)) +</dd> </dl><a NAME="CodeStyleCheckerDialog.__resetStatistics" ID="CodeStyleCheckerDialog.__resetStatistics"></a> <h4>CodeStyleCheckerDialog.__resetStatistics</h4> <b>__resetStatistics</b>(<i></i>) @@ -297,6 +343,21 @@ <dd> reference to the code style fixer (CodeStyleFixer) </dd> +</dl><a NAME="CodeStyleCheckerDialog.check" ID="CodeStyleCheckerDialog.check"></a> +<h4>CodeStyleCheckerDialog.check</h4> +<b>check</b>(<i>codestring='', onlyFixes={}</i>) +<p> + Start a style check for one file. +</p><p> + The results are reported to the __processResult slot. +</p><dl> +<dt><i>codestring=</i></dt> +<dd> +optional sourcestring (str) +</dd><dt><i>onlyFixes=</i></dt> +<dd> +dict which violations should be fixed (dict) +</dd> </dl><a NAME="CodeStyleCheckerDialog.on_buttonBox_clicked" ID="CodeStyleCheckerDialog.on_buttonBox_clicked"></a> <h4>CodeStyleCheckerDialog.on_buttonBox_clicked</h4> <b>on_buttonBox_clicked</b>(<i>button</i>) @@ -318,6 +379,9 @@ <b>on_fixButton_clicked</b>(<i></i>) <p> Private slot to fix selected issues. +</p><p> + Build a dictionary of issues to fix. Update the initialized __options. + Then call check with the dict as keyparam to fix selected issues. </p><a NAME="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked" ID="CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked"></a> <h4>CodeStyleCheckerDialog.on_fixIssuesSelectButton_clicked</h4> <b>on_fixIssuesSelectButton_clicked</b>(<i></i>) @@ -419,74 +483,5 @@ </dd> </dl> <div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="CodeStyleCheckerReport" ID="CodeStyleCheckerReport"></a> -<h2>CodeStyleCheckerReport</h2> -<p> - Class implementing a special report to be used with our dialog. -</p> -<h3>Derived from</h3> -pep8.BaseReport -<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="#CodeStyleCheckerReport.__init__">CodeStyleCheckerReport</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#CodeStyleCheckerReport.error_args">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="CodeStyleCheckerReport.__init__" ID="CodeStyleCheckerReport.__init__"></a> -<h4>CodeStyleCheckerReport (Constructor)</h4> -<b>CodeStyleCheckerReport</b>(<i>options</i>) -<p> - Constructor -</p><dl> -<dt><i>options</i></dt> -<dd> -options for the report (optparse.Values) -</dd> -</dl><a NAME="CodeStyleCheckerReport.error_args" ID="CodeStyleCheckerReport.error_args"></a> -<h4>CodeStyleCheckerReport.error_args</h4> -<b>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><dl> -<dt>Returns:</dt> -<dd> -error code (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.CodeStyleFixer.html Sun Mar 30 22:00:14 2014 +0200 @@ -54,7 +54,7 @@ Class implementing a fixer for certain code style issues. </p> <h3>Derived from</h3> -QObject +object <h3>Class Attributes</h3> <table> <tr><td>None</td></tr> @@ -81,9 +81,6 @@ <td><a href="#CodeStyleFixer.__fixD112">__fixD112</a></td> <td>Private method to fix docstring 'r' or 'u' in leading quotes.</td> </tr><tr> -<td><a href="#CodeStyleFixer.__fixD121">__fixD121</a></td> -<td>Private method to fix a single line docstring on multiple lines.</td> -</tr><tr> <td><a href="#CodeStyleFixer.__fixD131">__fixD131</a></td> <td>Private method to fix a docstring summary not ending with a period.</td> </tr><tr> @@ -204,9 +201,6 @@ <td><a href="#CodeStyleFixer.__fixWhitespace">__fixWhitespace</a></td> <td>Private method to correct whitespace at the given offset.</td> </tr><tr> -<td><a href="#CodeStyleFixer.__getEol">__getEol</a></td> -<td>Private method to get the applicable eol string.</td> -</tr><tr> <td><a href="#CodeStyleFixer.__getID">__getID</a></td> <td>Private method to get the ID for a deferred fix.</td> </tr><tr> @@ -241,14 +235,11 @@ </table> <a NAME="CodeStyleFixer.__init__" ID="CodeStyleFixer.__init__"></a> <h4>CodeStyleFixer (Constructor)</h4> -<b>CodeStyleFixer</b>(<i>project, filename, sourceLines, fixCodes, noFixCodes, maxLineLength, inPlace</i>) +<b>CodeStyleFixer</b>(<i>filename, sourceLines, fixCodes, noFixCodes, maxLineLength, inPlace, eol</i>) <p> Constructor </p><dl> -<dt><i>project</i></dt> -<dd> -reference to the project object (Project) -</dd><dt><i>filename</i></dt> +<dt><i>filename</i></dt> <dd> name of the file to be fixed (string) </dd><dt><i>sourceLines</i></dt> @@ -269,6 +260,9 @@ </dd><dt><i>inPlace</i></dt> <dd> flag indicating to modify the file in place (boolean) +</dd><dt><i>eol</i></dt> +<dd> +end of line character(s) (string) </dd> </dl><a NAME="CodeStyleFixer.__codeMatch" ID="CodeStyleFixer.__codeMatch"></a> <h4>CodeStyleFixer.__codeMatch</h4> @@ -347,35 +341,6 @@ a message for the fix (string) and an ID for a deferred fix (integer) </dd> -</dl><a NAME="CodeStyleFixer.__fixD121" ID="CodeStyleFixer.__fixD121"></a> -<h4>CodeStyleFixer.__fixD121</h4> -<b>__fixD121</b>(<i>code, line, pos, apply=False</i>) -<p> - Private method to fix a single line docstring on multiple lines. -</p><p> - Codes: D121 -</p><dl> -<dt><i>code</i></dt> -<dd> -code of the issue (string) -</dd><dt><i>line</i></dt> -<dd> -line number of the issue (integer) -</dd><dt><i>pos</i></dt> -<dd> -position inside line (integer) -</dd><dt><i>apply=</i></dt> -<dd> -flag indicating, that the fix should be applied - (boolean) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -value indicating an applied/deferred fix (-1, 0, 1), - a message for the fix (string) and an ID for a deferred - fix (integer) -</dd> </dl><a NAME="CodeStyleFixer.__fixD131" ID="CodeStyleFixer.__fixD131"></a> <h4>CodeStyleFixer.__fixD131</h4> <b>__fixD131</b>(<i>code, line, pos</i>) @@ -1488,16 +1453,6 @@ <dd> corrected line </dd> -</dl><a NAME="CodeStyleFixer.__getEol" ID="CodeStyleFixer.__getEol"></a> -<h4>CodeStyleFixer.__getEol</h4> -<b>__getEol</b>(<i></i>) -<p> - Private method to get the applicable eol string. -</p><dl> -<dt>Returns:</dt> -<dd> -eol string (string) -</dd> </dl><a NAME="CodeStyleFixer.__getID" ID="CodeStyleFixer.__getID"></a> <h4>CodeStyleFixer.__getID</h4> <b>__getID</b>(<i></i>) @@ -1626,7 +1581,7 @@ </dl><dl> <dt>Returns:</dt> <dd> -flag indicating success (boolean) +error message on failure (tuple of str) </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -25,7 +25,7 @@ </p> <h3>Global Attributes</h3> <table> -<tr><td>PyCF_ONLY_AST</td></tr> +<tr><td>None</td></tr> </table> <h3>Classes</h3> <table> @@ -51,14 +51,11 @@ object <h3>Class Attributes</h3> <table> -<tr><td>Codes</td></tr><tr><td>Messages</td></tr><tr><td>MessagesSampleArgs</td></tr> +<tr><td>Codes</td></tr> </table> <h3>Class Methods</h3> <table> -<tr> -<td><a href="#DocStyleChecker.getMessage">getMessage</a></td> -<td>Class method to get a translated and formatted message for a given code.</td> -</tr> +<tr><td>None</td></tr> </table> <h3>Methods</h3> <table> @@ -200,26 +197,7 @@ <table> <tr><td>None</td></tr> </table> -<a NAME="DocStyleChecker.getMessage" ID="DocStyleChecker.getMessage"></a> -<h4>DocStyleChecker.getMessage (class method)</h4> -<b>getMessage</b>(<i>code, *args</i>) -<p> - Class method to get a translated and formatted message for a - given code. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code (string) -</dd><dt><i>args</i></dt> -<dd> -arguments for a formatted message (list) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -translated and formatted message (string) -</dd> -</dl><a NAME="DocStyleChecker.__init__" ID="DocStyleChecker.__init__"></a> +<a NAME="DocStyleChecker.__init__" ID="DocStyleChecker.__init__"></a> <h4>DocStyleChecker (Constructor)</h4> <b>DocStyleChecker</b>(<i>source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257"</i>) <p>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.NamingStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -48,14 +48,11 @@ object <h3>Class Attributes</h3> <table> -<tr><td>CamelcaseRegexp</td></tr><tr><td>Codes</td></tr><tr><td>LowercaseRegex</td></tr><tr><td>Messages</td></tr><tr><td>MixedcaseRegexp</td></tr><tr><td>UppercaseRegexp</td></tr> +<tr><td>CamelcaseRegexp</td></tr><tr><td>Codes</td></tr><tr><td>LowercaseRegex</td></tr><tr><td>MixedcaseRegexp</td></tr><tr><td>UppercaseRegexp</td></tr> </table> <h3>Class Methods</h3> <table> -<tr> -<td><a href="#NamingStyleChecker.getMessage">getMessage</a></td> -<td>Class method to get a translated and formatted message for a given code.</td> -</tr> +<tr><td>None</td></tr> </table> <h3>Methods</h3> <table> @@ -107,32 +104,16 @@ </tr><tr> <td><a href="#NamingStyleChecker.run">run</a></td> <td>Public method run by the pep8.py checker.</td> +</tr><tr> +<td><a href="#NamingStyleChecker.unpackArgs">unpackArgs</a></td> +<td>Local helper function to unpack function argument names.</td> </tr> </table> <h3>Static Methods</h3> <table> <tr><td>None</td></tr> </table> -<a NAME="NamingStyleChecker.getMessage" ID="NamingStyleChecker.getMessage"></a> -<h4>NamingStyleChecker.getMessage (class method)</h4> -<b>getMessage</b>(<i>code, *args</i>) -<p> - Class method to get a translated and formatted message for a - given code. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code (string) -</dd><dt><i>args</i></dt> -<dd> -arguments for a formatted message (list) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -translated and formatted message (string) -</dd> -</dl><a NAME="NamingStyleChecker.__init__" ID="NamingStyleChecker.__init__"></a> +<a NAME="NamingStyleChecker.__init__" ID="NamingStyleChecker.__init__"></a> <h4>NamingStyleChecker (Constructor)</h4> <b>NamingStyleChecker</b>(<i>tree, filename, options</i>) <p> @@ -415,6 +396,21 @@ tuple giving line number, offset within line, code and checker function </dd> +</dl><a NAME="NamingStyleChecker.unpackArgs" ID="NamingStyleChecker.unpackArgs"></a> +<h4>NamingStyleChecker.unpackArgs</h4> +<b>unpackArgs</b>(<i></i>) +<p> + Local helper function to unpack function argument names. +</p><dl> +<dt><i>args</i></dt> +<dd> +list of AST node arguments +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list of argument names (list of string) +</dd> </dl> <div align="right"><a href="#top">Up</a></div> <hr />
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html Sun Mar 30 22:00:14 2014 +0200 @@ -23,7 +23,7 @@ <h3>Global Attributes</h3> <table> -<tr><td>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_SINGLETON_REGEX</td></tr><tr><td>COMPARE_TYPE_REGEX</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>HUNK_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>KEYWORDS</td></tr><tr><td>KEYWORD_REGEX</td></tr><tr><td>LAMBDA_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</td></tr><tr><td>PyCF_ONLY_AST</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>REPORT_FORMAT</td></tr><tr><td>RERAISE_COMMA_REGEX</td></tr><tr><td>SINGLETONS</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>TESTSUITE_PATH</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AFTER_COMMA_REGEX</td></tr><tr><td>WS_NEEDED_OPERATORS</td></tr><tr><td>WS_OPTIONAL_OPERATORS</td></tr><tr><td>__version__</td></tr><tr><td>_checks</td></tr><tr><td>noqa</td></tr><tr><td>pep8_messages</td></tr><tr><td>pep8_messages_sample_args</td></tr> +<tr><td>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_SINGLETON_REGEX</td></tr><tr><td>COMPARE_TYPE_REGEX</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>HUNK_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>KEYWORDS</td></tr><tr><td>KEYWORD_REGEX</td></tr><tr><td>LAMBDA_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</td></tr><tr><td>PyCF_ONLY_AST</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>REPORT_FORMAT</td></tr><tr><td>RERAISE_COMMA_REGEX</td></tr><tr><td>SINGLETONS</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>TESTSUITE_PATH</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AFTER_COMMA_REGEX</td></tr><tr><td>WS_NEEDED_OPERATORS</td></tr><tr><td>WS_OPTIONAL_OPERATORS</td></tr><tr><td>__version__</td></tr><tr><td>_checks</td></tr><tr><td>noqa</td></tr> </table> <h3>Classes</h3> <table> @@ -83,9 +83,6 @@ <td><a href="#filename_match">filename_match</a></td> <td>Check if patterns contains a pattern that matches filename.</td> </tr><tr> -<td><a href="#getMessage">getMessage</a></td> -<td>Function to get a translated and formatted message for a given code.</td> -</tr><tr> <td><a href="#get_parser">get_parser</a></td> <td></td> </tr><tr> @@ -840,27 +837,6 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> -<a NAME="getMessage" ID="getMessage"></a> -<h2>getMessage</h2> -<b>getMessage</b>(<i>code, *args</i>) -<p> - Function to get a translated and formatted message for a given code. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code (string) -</dd><dt><i>args</i></dt> -<dd> -arguments for a formatted message (list) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -translated and formatted message (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> <a NAME="get_parser" ID="get_parser"></a> <h2>get_parser</h2> <b>get_parser</b>(<i>prog='pep8', version=__version__</i>)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations</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.Plugins.CheckerPlugins.CodeStyleChecker.translations</h1> +<p> +Module implementing message translations for the code style plugin messages. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>__all__</td></tr><tr><td>_messages</td></tr><tr><td>_messages_sample_args</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Functions</h3> +<table> +<tr> +<td><a href="#getTranslatedMessage">getTranslatedMessage</a></td> +<td>Module function to get a translated and formatted message for a given pyflakes message ID.</td> +</tr> +</table> +<hr /><hr /> +<a NAME="getTranslatedMessage" ID="getTranslatedMessage"></a> +<h2>getTranslatedMessage</h2> +<b>getTranslatedMessage</b>(<i>message</i>) +<p> + Module function to get a translated and formatted message for a + given pyflakes message ID. +</p><dl> +<dt><i>message</i></dt> +<dd> +the message ID (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +translated and formatted message (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.Pep8.pep8.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1282 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Plugins.CheckerPlugins.Pep8.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.Plugins.CheckerPlugins.Pep8.pep8</h1> - -<h3>Global Attributes</h3> -<table> -<tr><td>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_SINGLETON_REGEX</td></tr><tr><td>COMPARE_TYPE_REGEX</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>HUNK_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>KEYWORDS</td></tr><tr><td>KEYWORD_REGEX</td></tr><tr><td>LAMBDA_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</td></tr><tr><td>PyCF_ONLY_AST</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>REPORT_FORMAT</td></tr><tr><td>RERAISE_COMMA_REGEX</td></tr><tr><td>SINGLETONS</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>TESTSUITE_PATH</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AFTER_COMMA_REGEX</td></tr><tr><td>WS_NEEDED_OPERATORS</td></tr><tr><td>WS_OPTIONAL_OPERATORS</td></tr><tr><td>__version__</td></tr><tr><td>_checks</td></tr><tr><td>noqa</td></tr><tr><td>pep8_messages</td></tr><tr><td>pep8_messages_sample_args</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#BaseReport">BaseReport</a></td> -<td>Collect the results of the checks.</td> -</tr><tr> -<td><a href="#Checker">Checker</a></td> -<td>Load a Python source file, tokenize it, check coding style.</td> -</tr><tr> -<td><a href="#DiffReport">DiffReport</a></td> -<td>Collect and print the results for the changed lines only.</td> -</tr><tr> -<td><a href="#FileReport">FileReport</a></td> -<td>Collect the results of the checks and print only the filenames.</td> -</tr><tr> -<td><a href="#StandardReport">StandardReport</a></td> -<td>Collect and print the results of the checks.</td> -</tr><tr> -<td><a href="#StyleGuide">StyleGuide</a></td> -<td>Initialize a PEP-8 instance with few options.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#_add_check">_add_check</a></td> -<td></td> -</tr><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>Separate top-level function and class definitions with two blank lines.</td> -</tr><tr> -<td><a href="#comparison_to_singleton">comparison_to_singleton</a></td> -<td>Comparisons to singletons like None should always be done with "is" or "is not", never the equality operators.</td> -</tr><tr> -<td><a href="#comparison_type">comparison_type</a></td> -<td>Object type comparisons should always use isinstance() instead of comparing types directly.</td> -</tr><tr> -<td><a href="#compound_statements">compound_statements</a></td> -<td>Compound statements (multiple statements on the same line) are generally discouraged.</td> -</tr><tr> -<td><a href="#continued_indentation">continued_indentation</a></td> -<td>Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent.</td> -</tr><tr> -<td><a href="#expand_indent">expand_indent</a></td> -<td>Return the amount of indentation.</td> -</tr><tr> -<td><a href="#explicit_line_join">explicit_line_join</a></td> -<td>Avoid explicit line join between brackets.</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 patterns contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#getMessage">getMessage</a></td> -<td>Function to get a translated and formatted message for a given code.</td> -</tr><tr> -<td><a href="#get_parser">get_parser</a></td> -<td></td> -</tr><tr> -<td><a href="#imports_on_separate_lines">imports_on_separate_lines</a></td> -<td>Imports should usually be on separate lines.</td> -</tr><tr> -<td><a href="#indentation">indentation</a></td> -<td>Use 4 spaces per indentation level.</td> -</tr><tr> -<td><a href="#init_checks_registry">init_checks_registry</a></td> -<td>Register all globally visible functions where the first argument name is 'physical_line' or 'logical_line'.</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="#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>- 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).</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="#parse_udiff">parse_udiff</a></td> -<td>Return a dictionary of matching lines.</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 3.</td> -</tr><tr> -<td><a href="#python_3000_has_key">python_3000_has_key</a></td> -<td>The {}.has_key() method is removed in the Python 3.</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="#read_config">read_config</a></td> -<td>Read both user configuration and local configuration.</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="#register_check">register_check</a></td> -<td>Register a new check object.</td> -</tr><tr> -<td><a href="#stdin_get_value">stdin_get_value</a></td> -<td></td> -</tr><tr> -<td><a href="#tabs_obsolete">tabs_obsolete</a></td> -<td>For new projects, spaces-only are strongly recommended over tabs.</td> -</tr><tr> -<td><a href="#tabs_or_spaces">tabs_or_spaces</a></td> -<td>Never mix tabs and spaces.</td> -</tr><tr> -<td><a href="#trailing_blank_lines">trailing_blank_lines</a></td> -<td>JCR: Trailing blank lines are superfluous.</td> -</tr><tr> -<td><a href="#trailing_whitespace">trailing_whitespace</a></td> -<td>JCR: Trailing whitespace is superfluous.</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_keywords">whitespace_around_keywords</a></td> -<td>Avoid extraneous whitespace around keywords.</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="BaseReport" ID="BaseReport"></a> -<h2>BaseReport</h2> -<p> -Collect the results of the checks. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#BaseReport.__init__">BaseReport</a></td> -<td></td> -</tr><tr> -<td><a href="#BaseReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.get_count">get_count</a></td> -<td>Return the total count of errors and warnings.</td> -</tr><tr> -<td><a href="#BaseReport.get_file_results">get_file_results</a></td> -<td>Return the count of errors and warnings for this file.</td> -</tr><tr> -<td><a href="#BaseReport.get_statistics">get_statistics</a></td> -<td>Get statistics for message codes that start with the prefix.</td> -</tr><tr> -<td><a href="#BaseReport.increment_logical_line">increment_logical_line</a></td> -<td>Signal a new logical line.</td> -</tr><tr> -<td><a href="#BaseReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr><tr> -<td><a href="#BaseReport.print_benchmark">print_benchmark</a></td> -<td>Print benchmark numbers.</td> -</tr><tr> -<td><a href="#BaseReport.print_statistics">print_statistics</a></td> -<td>Print overall statistics (number of errors and warnings).</td> -</tr><tr> -<td><a href="#BaseReport.start">start</a></td> -<td>Start the timer.</td> -</tr><tr> -<td><a href="#BaseReport.stop">stop</a></td> -<td>Stop the timer.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="BaseReport.__init__" ID="BaseReport.__init__"></a> -<h4>BaseReport (Constructor)</h4> -<b>BaseReport</b>(<i>options</i>) -<a NAME="BaseReport.error" ID="BaseReport.error"></a> -<h4>BaseReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.error_args" ID="BaseReport.error_args"></a> -<h4>BaseReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.get_count" ID="BaseReport.get_count"></a> -<h4>BaseReport.get_count</h4> -<b>get_count</b>(<i>prefix=''</i>) -<p> -Return the total count of errors and warnings. -</p><a NAME="BaseReport.get_file_results" ID="BaseReport.get_file_results"></a> -<h4>BaseReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Return the count of errors and warnings for this file. -</p><a NAME="BaseReport.get_statistics" ID="BaseReport.get_statistics"></a> -<h4>BaseReport.get_statistics</h4> -<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><a NAME="BaseReport.increment_logical_line" ID="BaseReport.increment_logical_line"></a> -<h4>BaseReport.increment_logical_line</h4> -<b>increment_logical_line</b>(<i></i>) -<p> -Signal a new logical line. -</p><a NAME="BaseReport.init_file" ID="BaseReport.init_file"></a> -<h4>BaseReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p><a NAME="BaseReport.print_benchmark" ID="BaseReport.print_benchmark"></a> -<h4>BaseReport.print_benchmark</h4> -<b>print_benchmark</b>(<i></i>) -<p> -Print benchmark numbers. -</p><a NAME="BaseReport.print_statistics" ID="BaseReport.print_statistics"></a> -<h4>BaseReport.print_statistics</h4> -<b>print_statistics</b>(<i>prefix=''</i>) -<p> -Print overall statistics (number of errors and warnings). -</p><a NAME="BaseReport.start" ID="BaseReport.start"></a> -<h4>BaseReport.start</h4> -<b>start</b>(<i></i>) -<p> -Start the timer. -</p><a NAME="BaseReport.stop" ID="BaseReport.stop"></a> -<h4>BaseReport.stop</h4> -<b>stop</b>(<i></i>) -<p> -Stop the timer. -</p> -<div align="right"><a href="#top">Up</a></div> -<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_ast">check_ast</a></td> -<td></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.generate_tokens">generate_tokens</a></td> -<td></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_invalid_syntax">report_invalid_syntax</a></td> -<td></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=None, lines=None, options=None, report=None, **kwargs</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_ast" ID="Checker.check_ast"></a> -<h4>Checker.check_ast</h4> -<b>check_ast</b>(<i></i>) -<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.generate_tokens" ID="Checker.generate_tokens"></a> -<h4>Checker.generate_tokens</h4> -<b>generate_tokens</b>(<i></i>) -<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_invalid_syntax" ID="Checker.report_invalid_syntax"></a> -<h4>Checker.report_invalid_syntax</h4> -<b>report_invalid_syntax</b>(<i></i>) -<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="DiffReport" ID="DiffReport"></a> -<h2>DiffReport</h2> -<p> -Collect and print the results for the changed lines only. -</p> -<h3>Derived from</h3> -StandardReport -<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="#DiffReport.__init__">DiffReport</a></td> -<td></td> -</tr><tr> -<td><a href="#DiffReport.error">error</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DiffReport.__init__" ID="DiffReport.__init__"></a> -<h4>DiffReport (Constructor)</h4> -<b>DiffReport</b>(<i>options</i>) -<a NAME="DiffReport.error" ID="DiffReport.error"></a> -<h4>DiffReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="FileReport" ID="FileReport"></a> -<h2>FileReport</h2> -<p> -Collect the results of the checks and print only the filenames. -</p> -<h3>Derived from</h3> -BaseReport -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</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="StandardReport" ID="StandardReport"></a> -<h2>StandardReport</h2> -<p> -Collect and print the results of the checks. -</p> -<h3>Derived from</h3> -BaseReport -<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="#StandardReport.__init__">StandardReport</a></td> -<td></td> -</tr><tr> -<td><a href="#StandardReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.get_file_results">get_file_results</a></td> -<td>Print the result and return the overall count for this file.</td> -</tr><tr> -<td><a href="#StandardReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StandardReport.__init__" ID="StandardReport.__init__"></a> -<h4>StandardReport (Constructor)</h4> -<b>StandardReport</b>(<i>options</i>) -<a NAME="StandardReport.error" ID="StandardReport.error"></a> -<h4>StandardReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.error_args" ID="StandardReport.error_args"></a> -<h4>StandardReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.get_file_results" ID="StandardReport.get_file_results"></a> -<h4>StandardReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Print the result and return the overall count for this file. -</p><a NAME="StandardReport.init_file" ID="StandardReport.init_file"></a> -<h4>StandardReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="StyleGuide" ID="StyleGuide"></a> -<h2>StyleGuide</h2> -<p> -Initialize a PEP-8 instance with few options. -</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="#StyleGuide.__init__">StyleGuide</a></td> -<td></td> -</tr><tr> -<td><a href="#StyleGuide.check_files">check_files</a></td> -<td>Run all checks on the paths.</td> -</tr><tr> -<td><a href="#StyleGuide.excluded">excluded</a></td> -<td>Check if options.exclude contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#StyleGuide.get_checks">get_checks</a></td> -<td>Find all globally visible functions where the first argument name starts with argument_name and which contain selected tests.</td> -</tr><tr> -<td><a href="#StyleGuide.ignore_code">ignore_code</a></td> -<td>Check if the error code should be ignored.</td> -</tr><tr> -<td><a href="#StyleGuide.init_report">init_report</a></td> -<td>Initialize the report instance.</td> -</tr><tr> -<td><a href="#StyleGuide.input_dir">input_dir</a></td> -<td>Check all files in this directory and all subdirectories.</td> -</tr><tr> -<td><a href="#StyleGuide.input_file">input_file</a></td> -<td>Run all checks on a Python source file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StyleGuide.__init__" ID="StyleGuide.__init__"></a> -<h4>StyleGuide (Constructor)</h4> -<b>StyleGuide</b>(<i>*args, **kwargs</i>) -<a NAME="StyleGuide.check_files" ID="StyleGuide.check_files"></a> -<h4>StyleGuide.check_files</h4> -<b>check_files</b>(<i>paths=None</i>) -<p> -Run all checks on the paths. -</p><a NAME="StyleGuide.excluded" ID="StyleGuide.excluded"></a> -<h4>StyleGuide.excluded</h4> -<b>excluded</b>(<i>filename, parent=None</i>) -<p> - Check if options.exclude contains a pattern that matches filename. -</p><a NAME="StyleGuide.get_checks" ID="StyleGuide.get_checks"></a> -<h4>StyleGuide.get_checks</h4> -<b>get_checks</b>(<i>argument_name</i>) -<p> - Find all globally visible functions where the first argument name - starts with argument_name and which contain selected tests. -</p><a NAME="StyleGuide.ignore_code" ID="StyleGuide.ignore_code"></a> -<h4>StyleGuide.ignore_code</h4> -<b>ignore_code</b>(<i>code</i>) -<p> - Check if the error code should be ignored. -</p><p> - If 'options.select' contains a prefix of the error code, - return False. Else, if 'options.ignore' contains a prefix of - the error code, return True. -</p><a NAME="StyleGuide.init_report" ID="StyleGuide.init_report"></a> -<h4>StyleGuide.init_report</h4> -<b>init_report</b>(<i>reporter=None</i>) -<p> -Initialize the report instance. -</p><a NAME="StyleGuide.input_dir" ID="StyleGuide.input_dir"></a> -<h4>StyleGuide.input_dir</h4> -<b>input_dir</b>(<i>dirname</i>) -<p> -Check all files in this directory and all subdirectories. -</p><a NAME="StyleGuide.input_file" ID="StyleGuide.input_file"></a> -<h4>StyleGuide.input_file</h4> -<b>input_file</b>(<i>filename, lines=None, expected=None, line_offset=0</i>) -<p> -Run all checks on a Python source file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="_add_check" ID="_add_check"></a> -<h2>_add_check</h2> -<b>_add_check</b>(<i>check, kind, codes, args</i>) - -<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</i>) -<p> - Separate top-level function and class definitions with two blank lines. -</p><p> - Method definitions inside a class are separated by a single blank line. -</p><p> - 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). -</p><p> - Use blank lines in functions, sparingly, to indicate logical sections. -</p><p> - 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 -</p><p> - 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 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_to_singleton" ID="comparison_to_singleton"></a> -<h2>comparison_to_singleton</h2> -<b>comparison_to_singleton</b>(<i>logical_line, noqa</i>) -<p> - Comparisons to singletons like None should always be done - with "is" or "is not", never the equality operators. -</p><p> - Okay: if arg is not None: - E711: if arg != None: - E712: if arg == True: -</p><p> - Also, beware of writing if x when you really mean if x is not None -- - e.g. when testing whether a variable or argument that defaults to None was - set to some other value. The other value might have a type (such as a - container) that could be false in a boolean context! -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_type" ID="comparison_type"></a> -<h2>comparison_type</h2> -<b>comparison_type</b>(<i>logical_line</i>) -<p> - Object type comparisons should always use isinstance() instead of - comparing types directly. -</p><p> - Okay: if isinstance(obj, int): - E721: if type(obj) is type(1): -</p><p> - When checking if an object is a string, keep in mind that it might be a - unicode string too! In Python 2.3, str and unicode have a common base - class, basestring, so you can do: -</p><p> - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): -</p> -<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>) -<p> - Compound statements (multiple statements on the same line) are - generally discouraged. -</p><p> - 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! -</p><p> - Okay: if foo == 'blah':\n do_blah_thing() - Okay: do_one() - Okay: do_two() - Okay: do_three() -</p><p> - 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() -</p><p> - E702: do_one(); do_two(); do_three() - E703: do_four(); # useless semicolon -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="continued_indentation" ID="continued_indentation"></a> -<h2>continued_indentation</h2> -<b>continued_indentation</b>(<i>logical_line, tokens, indent_level, hang_closing, noqa, verbose</i>) -<p> - Continuation lines should align wrapped elements either vertically using - Python's implicit line joining inside parentheses, brackets and braces, or - using a hanging indent. -</p><p> - When using a hanging indent the following considerations should be applied: -</p><p> - - there should be no arguments on the first line, and -</p><p> - - further indentation should be used to clearly distinguish itself as a - continuation line. -</p><p> - Okay: a = (\n) - E123: a = (\n ) -</p><p> - Okay: a = (\n 42) - E121: a = (\n 42) - E122: a = (\n42) - E123: a = (\n 42\n ) - E124: a = (24,\n 42\n) - E125: if (a or\n b):\n pass - E126: a = (\n 42) - E127: a = (24,\n 42) - E128: a = (24,\n 42) -</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="explicit_line_join" ID="explicit_line_join"></a> -<h2>explicit_line_join</h2> -<b>explicit_line_join</b>(<i>logical_line, tokens</i>) -<p> - Avoid explicit line join between brackets. -</p><p> - The preferred way of wrapping long lines is by using Python's implied line - continuation inside parentheses, brackets and braces. Long lines can be - broken over multiple lines by wrapping expressions in parentheses. These - should be used in preference to using a backslash for line continuation. -</p><p> - E502: aaa = [123, \\n 123] - E502: aaa = ("bbb " \\n "ccc") -</p><p> - Okay: aaa = [123,\n 123] - Okay: aaa = ("bbb "\n "ccc") - Okay: aaa = "bbb " \\n "ccc" -</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, patterns, default=True</i>) -<p> - Check if patterns contains a pattern that matches filename. - If patterns is unspecified, this always returns True. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="getMessage" ID="getMessage"></a> -<h2>getMessage</h2> -<b>getMessage</b>(<i>code, *args</i>) -<p> - Function to get a translated and formatted message for a given code. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code (string) -</dd><dt><i>args</i></dt> -<dd> -arguments for a formatted message (list) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -translated and formatted message (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_parser" ID="get_parser"></a> -<h2>get_parser</h2> -<b>get_parser</b>(<i>prog='pep8', version=__version__</i>) - -<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>) -<p> - Imports should usually be on separate lines. -</p><p> - Okay: import os\nimport sys - E401: import sys, os -</p><p> - 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 -</p> -<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>) -<p> - Use 4 spaces per indentation level. -</p><p> - For really old code that you don't want to mess up, you can continue to - use 8-space tabs. -</p><p> - Okay: a = 1 - Okay: if a == 0:\n a = 1 - E111: a = 1 -</p><p> - Okay: for item in items:\n pass - E112: for item in items:\npass -</p><p> - Okay: a = 1\nb = 2 - E113: a = 1\n b = 2 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="init_checks_registry" ID="init_checks_registry"></a> -<h2>init_checks_registry</h2> -<b>init_checks_registry</b>(<i></i>) -<p> - Register all globally visible functions where the first argument name - is 'physical_line' or 'logical_line'. -</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, max_line_length</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><p> - Reports error E501. -</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><p> - Reports warning W292. -</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) - E231: [{'a':'b'}] -</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>) -<p> - - 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). -</p><p> - - Use spaces around arithmetic operators. -</p><p> - 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: alpha[:-i] -</p><p> - E225: i=i+1 - E225: submitted +=1 - E225: x = x /2 - 1 - E225: z = x **y - E226: c = (a+b) * (a-b) - E226: hypot2 = x*x + y*y - E227: c = a|b - E228: msg = fmt%(errno, errmsg) -</p> -<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="parse_udiff" ID="parse_udiff"></a> -<h2>parse_udiff</h2> -<b>parse_udiff</b>(<i>diff, patterns=None, parent='.'</i>) -<p> -Return a dictionary of matching lines. -</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, parse_argv=False, config_file=None, parser=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 3. - Use repr() instead. -</p><p> - Okay: val = repr(1 + 2) - W604: val = `1 + 2` -</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 is removed in the Python 3. - Use the 'in' operation instead. -</p><p> - Okay: if "alph" in d:\n print d["alph"] - W601: assert d.has_key('alph') -</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 3. -</p><p> - Okay: if a != 'no': - W603: if a <> 'no': -</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 is removed in Python 3. -</p><p> - Okay: raise DummyError("Message") - W602: raise DummyError, "Message" -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="read_config" ID="read_config"></a> -<h2>read_config</h2> -<b>read_config</b>(<i>options, args, arglist, parser</i>) -<p> -Read both user configuration and local configuration. -</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="register_check" ID="register_check"></a> -<h2>register_check</h2> -<b>register_check</b>(<i>check, codes=None</i>) -<p> - Register a new check object. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="stdin_get_value" ID="stdin_get_value"></a> -<h2>stdin_get_value</h2> -<b>stdin_get_value</b>(<i></i>) - -<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>) -<p> - For new projects, spaces-only are strongly recommended over tabs. Most - editors have features that make this easy to do. -</p><p> - Okay: if True:\n return - W191: if True:\n\treturn -</p> -<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>) -<p> - Never mix tabs and spaces. -</p><p> - 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! -</p><p> - Okay: if a == 0:\n a = 1\n b = 1 - E101: if a == 0:\n a = 1\n\tb = 1 -</p> -<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>) -<p> - JCR: Trailing blank lines are superfluous. -</p><p> - Okay: spam(1) - W391: spam(1)\n -</p> -<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>) -<p> - 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. -</p><p> - [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines -</p><p> - The warning returned varies on whether the line itself is blank, for easier - filtering for those who want to indent their blank lines. -</p><p> - Okay: spam(1)\n# - W291: spam(1) \n# - W293: class Foo(object):\n \n bang = 12 -</p> -<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_keywords" ID="whitespace_around_keywords"></a> -<h2>whitespace_around_keywords</h2> -<b>whitespace_around_keywords</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace around keywords. -</p><p> - Okay: True and False - E271: True and False - E272: True and False - E273: True and\tFalse - E274: True\tand False -</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, tokens</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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,139 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</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.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck</h1> +<p> +Module implementing the syntax check for Python 2/3. +</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="#extractLineFlags">extractLineFlags</a></td> +<td>Function to extract flags starting and ending with '__' from a line comment.</td> +</tr><tr> +<td><a href="#initService">initService</a></td> +<td>Initialize the service and return the entry point.</td> +</tr><tr> +<td><a href="#normalizeCode">normalizeCode</a></td> +<td>Function to normalize the given code.</td> +</tr><tr> +<td><a href="#syntaxAndPyflakesCheck">syntaxAndPyflakesCheck</a></td> +<td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> +</tr> +</table> +<hr /><hr /> +<a NAME="extractLineFlags" ID="extractLineFlags"></a> +<h2>extractLineFlags</h2> +<b>extractLineFlags</b>(<i>line, startComment="</i>) +<p> + Function to extract flags starting and ending with '__' from a line + comment. +</p><dl> +<dt><i>line</i></dt> +<dd> +line to extract flags from (string) +</dd><dt><i>startComment=</i></dt> +<dd> +string identifying the start of the comment (string) +</dd><dt><i>endComment=</i></dt> +<dd> +string identifying the end of a comment (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list containing the extracted flags (list of strings) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="initService" ID="initService"></a> +<h2>initService</h2> +<b>initService</b>(<i></i>) +<p> + Initialize the service and return the entry point. +</p><dl> +<dt>Returns:</dt> +<dd> +the entry point for the background client (function) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="normalizeCode" ID="normalizeCode"></a> +<h2>normalizeCode</h2> +<b>normalizeCode</b>(<i>codestring</i>) +<p> + Function to normalize the given code. +</p><dl> +<dt><i>codestring</i></dt> +<dd> +code to be normalized (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +normalized code (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="syntaxAndPyflakesCheck" ID="syntaxAndPyflakesCheck"></a> +<h2>syntaxAndPyflakesCheck</h2> +<b>syntaxAndPyflakesCheck</b>(<i>filename, codestring, checkFlakes=True, ignoreStarImportWarnings=False</i>) +<p> + Function to compile one Python source file to Python bytecode + and to perform a pyflakes check. +</p><dl> +<dt><i>filename</i></dt> +<dd> +source filename (string) +</dd><dt><i>codestring</i></dt> +<dd> +string containing the code to compile (string) +</dd><dt><i>checkFlakes=</i></dt> +<dd> +flag indicating to do a pyflakes check (boolean) +</dd><dt><i>ignoreStarImportWarnings=</i></dt> +<dd> +flag indicating to + ignore 'star import' warnings (boolean) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message, a list with arguments for the message) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,202 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</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.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</h1> +<p> +Module implementing an interface to add different languages to do a syntax +check. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#SyntaxCheckService">SyntaxCheckService</a></td> +<td>Implement the syntax check service.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="SyntaxCheckService" ID="SyntaxCheckService"></a> +<h2>SyntaxCheckService</h2> +<p> + Implement the syntax check service. +</p><p> + Plugins can add other languages to the syntax check by calling addLanguage + and support of an extra checker module on the client side which has to + connect directly to the background service. +</p><h3>Signals</h3> +<dl> +<dt>syntaxChecked(str, dict)</dt> +<dd> +emited when the syntax check was done. +</dd> +</dl> +<h3>Derived from</h3> +QObject +<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="#SyntaxCheckService.__init__">SyntaxCheckService</a></td> +<td>Contructor of SyntaxCheckService.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.__determineLanguage">__determineLanguage</a></td> +<td>Private methode to determine the language of the file.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.addLanguage">addLanguage</a></td> +<td>Register the new language to the supported languages.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.getExtensions">getExtensions</a></td> +<td>Return all supported file extensions for the syntax checker dialog.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.getLanguages">getLanguages</a></td> +<td>Return the supported language names.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.removeLanguage">removeLanguage</a></td> +<td>Remove the language from syntax check.</td> +</tr><tr> +<td><a href="#SyntaxCheckService.syntaxCheck">syntaxCheck</a></td> +<td>Method to prepare to compile one Python source file to Python bytecode and to perform a pyflakes check in another task.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="SyntaxCheckService.__init__" ID="SyntaxCheckService.__init__"></a> +<h4>SyntaxCheckService (Constructor)</h4> +<b>SyntaxCheckService</b>(<i></i>) +<p> + Contructor of SyntaxCheckService. +</p><a NAME="SyntaxCheckService.__determineLanguage" ID="SyntaxCheckService.__determineLanguage"></a> +<h4>SyntaxCheckService.__determineLanguage</h4> +<b>__determineLanguage</b>(<i>filename, source</i>) +<p> + Private methode to determine the language of the file. +</p><dl> +<dt><i>filename</i></dt> +<dd> +of the sourcefile (str) +</dd><dt><i>source</i></dt> +<dd> +code of the file (str) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +language of the file or None if not found (str or None) +</dd> +</dl><a NAME="SyntaxCheckService.addLanguage" ID="SyntaxCheckService.addLanguage"></a> +<h4>SyntaxCheckService.addLanguage</h4> +<b>addLanguage</b>(<i>lang, path, module, getArgs, getExt, callback, onError</i>) +<p> + Register the new language to the supported languages. +</p><dl> +<dt><i>lang</i></dt> +<dd> +new language to check syntax (str) +</dd><dt><i>path</i></dt> +<dd> +full path to the module (str) +</dd><dt><i>module</i></dt> +<dd> +name to import (str) +</dd><dt><i>getArgs</i></dt> +<dd> +function to collect the required arguments to call the + syntax checker on client side (function) +</dd><dt><i>getExt</i></dt> +<dd> +function that returns the supported file extensions of + the syntax checker (function) +</dd><dt><i>callback</i></dt> +<dd> +function on service response (function) +</dd><dt><i>onError</i></dt> +<dd> +callback function if client or service isn't available + (function) +</dd> +</dl><a NAME="SyntaxCheckService.getExtensions" ID="SyntaxCheckService.getExtensions"></a> +<h4>SyntaxCheckService.getExtensions</h4> +<b>getExtensions</b>(<i></i>) +<p> + Return all supported file extensions for the syntax checker dialog. +</p><dl> +<dt>Returns:</dt> +<dd> +set of all supported file extensions (set of str) +</dd> +</dl><a NAME="SyntaxCheckService.getLanguages" ID="SyntaxCheckService.getLanguages"></a> +<h4>SyntaxCheckService.getLanguages</h4> +<b>getLanguages</b>(<i></i>) +<p> + Return the supported language names. +</p><dl> +<dt>Returns:</dt> +<dd> +list of languanges supported (list of str) +</dd> +</dl><a NAME="SyntaxCheckService.removeLanguage" ID="SyntaxCheckService.removeLanguage"></a> +<h4>SyntaxCheckService.removeLanguage</h4> +<b>removeLanguage</b>(<i>lang</i>) +<p> + Remove the language from syntax check. +</p><dl> +<dt><i>lang</i></dt> +<dd> +language to remove (str) +</dd> +</dl><a NAME="SyntaxCheckService.syntaxCheck" ID="SyntaxCheckService.syntaxCheck"></a> +<h4>SyntaxCheckService.syntaxCheck</h4> +<b>syntaxCheck</b>(<i>lang, filename, source</i>) +<p> + Method to prepare to compile one Python source file to Python bytecode + and to perform a pyflakes check in another task. +</p><dl> +<dt><i>lang</i></dt> +<dd> +language of the file or None to determine by internal + algorithm (str or None) +</dd><dt><i>filename</i></dt> +<dd> +source filename (string) +</dd><dt><i>source</i></dt> +<dd> +string containing the code to check (string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html Sun Mar 30 22:00:14 2014 +0200 @@ -69,9 +69,15 @@ <td><a href="#SyntaxCheckerDialog.__finish">__finish</a></td> <td>Private slot called when the syntax check finished or the user pressed the button.</td> </tr><tr> +<td><a href="#SyntaxCheckerDialog.__processResult">__processResult</a></td> +<td>Slot to display the reported messages.</td> +</tr><tr> <td><a href="#SyntaxCheckerDialog.__resort">__resort</a></td> <td>Private method to resort the tree.</td> </tr><tr> +<td><a href="#SyntaxCheckerDialog.check">check</a></td> +<td>Start a check for one file.</td> +</tr><tr> <td><a href="#SyntaxCheckerDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> <td>Private slot called by a button of the button box clicked.</td> </tr><tr> @@ -147,12 +153,40 @@ <p> Private slot called when the syntax check finished or the user pressed the button. -</p><a NAME="SyntaxCheckerDialog.__resort" ID="SyntaxCheckerDialog.__resort"></a> +</p><a NAME="SyntaxCheckerDialog.__processResult" ID="SyntaxCheckerDialog.__processResult"></a> +<h4>SyntaxCheckerDialog.__processResult</h4> +<b>__processResult</b>(<i>fn, problems</i>) +<p> + Slot to display the reported messages. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the checked file (str) +</dd><dt><i>problems</i></dt> +<dd> +dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message) (dict) +</dd> +</dl><a NAME="SyntaxCheckerDialog.__resort" ID="SyntaxCheckerDialog.__resort"></a> <h4>SyntaxCheckerDialog.__resort</h4> <b>__resort</b>(<i></i>) <p> Private method to resort the tree. -</p><a NAME="SyntaxCheckerDialog.on_buttonBox_clicked" ID="SyntaxCheckerDialog.on_buttonBox_clicked"></a> +</p><a NAME="SyntaxCheckerDialog.check" ID="SyntaxCheckerDialog.check"></a> +<h4>SyntaxCheckerDialog.check</h4> +<b>check</b>(<i>codestring=''</i>) +<p> + Start a check for one file. +</p><p> + The results are reported to the __processResult slot. +</p><dl> +<dt><i>codestring=</i></dt> +<dd> +optional sourcestring (str) +</dd> +</dl><a NAME="SyntaxCheckerDialog.on_buttonBox_clicked" ID="SyntaxCheckerDialog.on_buttonBox_clicked"></a> <h4>SyntaxCheckerDialog.on_buttonBox_clicked</h4> <b>on_buttonBox_clicked</b>(<i>button</i>) <p> @@ -211,7 +245,7 @@ </dd><dt><i>codestring</i></dt> <dd> string containing the code to be checked (string). - If this is given, file must be a single file name. + If this is given, fn must be a single file name. </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,461 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.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.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker</h1> +<p> +Main module. +</p><p> +Implement the central Checker class. +Also, it models the Bindings and Scopes. +</p> +<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>I check the cleanliness and sanity of Python code.</td> +</tr><tr> +<td><a href="#ClassDefinition">ClassDefinition</a></td> +<td></td> +</tr><tr> +<td><a href="#ClassScope">ClassScope</a></td> +<td></td> +</tr><tr> +<td><a href="#Definition">Definition</a></td> +<td>A binding that defines a function or a class.</td> +</tr><tr> +<td><a href="#ExportBinding">ExportBinding</a></td> +<td>A binding created by an C{__all__} assignment.</td> +</tr><tr> +<td><a href="#FunctionDefinition">FunctionDefinition</a></td> +<td></td> +</tr><tr> +<td><a href="#FunctionScope">FunctionScope</a></td> +<td>I represent a name scope for a function.</td> +</tr><tr> +<td><a href="#GeneratorScope">GeneratorScope</a></td> +<td></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></td> +</tr><tr> +<td><a href="#Scope">Scope</a></td> +<td></td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr> +<td><a href="#__init__">__init__</a></td> +<td></td> +</tr><tr> +<td><a href="#__init___1">__init__</a></td> +<td></td> +</tr><tr> +<td><a href="#__init___2">__init__</a></td> +<td></td> +</tr><tr> +<td><a href="#__repr__">__repr__</a></td> +<td></td> +</tr><tr> +<td><a href="#__repr___1">__repr__</a></td> +<td></td> +</tr><tr> +<td><a href="#__str__">__str__</a></td> +<td></td> +</tr><tr> +<td><a href="#getNodeName">getNodeName</a></td> +<td></td> +</tr><tr> +<td><a href="#getNodeType">getNodeType</a></td> +<td></td> +</tr><tr> +<td><a href="#getNodeType_1">getNodeType</a></td> +<td></td> +</tr><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><tr> +<td><a href="#names">names</a></td> +<td>Return a list of the names referenced by this binding.</td> +</tr><tr> +<td><a href="#unusedAssignments">unusedAssignments</a></td> +<td>Return a generator for the assignments which have not been used.</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="ClassDefinition" ID="ClassDefinition"></a> +<h2>ClassDefinition</h2> + +<h3>Derived from</h3> +Definition +<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="ClassScope" ID="ClassScope"></a> +<h2>ClassScope</h2> + +<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="Definition" ID="Definition"></a> +<h2>Definition</h2> +<p> + A binding that defines a function or a class. +</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="ExportBinding" ID="ExportBinding"></a> +<h2>ExportBinding</h2> +<p> + A binding created by an C{__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 C{__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 + C{__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>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="FunctionDefinition" ID="FunctionDefinition"></a> +<h2>FunctionDefinition</h2> + +<h3>Derived from</h3> +Definition +<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="GeneratorScope" ID="GeneratorScope"></a> +<h2>GeneratorScope</h2> + +<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="ModuleScope" ID="ModuleScope"></a> +<h2>ModuleScope</h2> + +<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> + +<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>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="__init__" ID="__init__"></a> +<h2>__init__</h2> +<b>__init__</b>(<i>self, name, source</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="__init___1" ID="__init___1"></a> +<h2>__init__</h2> +<b>__init__</b>(<i>self, name, source</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="__init___2" ID="__init___2"></a> +<h2>__init__</h2> +<b>__init__</b>(<i>self</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="__repr__" ID="__repr__"></a> +<h2>__repr__</h2> +<b>__repr__</b>(<i>self</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="__repr___1" ID="__repr___1"></a> +<h2>__repr__</h2> +<b>__repr__</b>(<i>self</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="__str__" ID="__str__"></a> +<h2>__str__</h2> +<b>__str__</b>(<i>self</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="getNodeName" ID="getNodeName"></a> +<h2>getNodeName</h2> +<b>getNodeName</b>(<i>node</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="getNodeType" ID="getNodeType"></a> +<h2>getNodeType</h2> +<b>getNodeType</b>(<i>node_class</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="getNodeType_1" ID="getNodeType_1"></a> +<h2>getNodeType</h2> +<b>getNodeType</b>(<i>node_class</i>) + +<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</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 /><hr /> +<a NAME="names" ID="names"></a> +<h2>names</h2> +<b>names</b>(<i>self</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="unusedAssignments" ID="unusedAssignments"></a> +<h2>unusedAssignments</h2> +<b>unusedAssignments</b>(<i>self</i>) +<p> + Return a generator for the assignments which have not been used. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,753 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.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.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages</h1> +<p> +Provide the class Message and its subclasses. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>QT_TRANSLATE_NOOP</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#DoctestSyntaxError">DoctestSyntaxError</a></td> +<td>Class defining the "Syntax error in doctest" message.</td> +</tr><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="#Redefined">Redefined</a></td> +<td>Class defining the "Redefined" message.</td> +</tr><tr> +<td><a href="#RedefinedInListComp">RedefinedInListComp</a></td> +<td>Class defining the list comprehension redefinition.</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="DoctestSyntaxError" ID="DoctestSyntaxError"></a> +<h2>DoctestSyntaxError</h2> +<p> + Class defining the "Syntax error in doctest" 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="#DoctestSyntaxError.__init__">DoctestSyntaxError</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="DoctestSyntaxError.__init__" ID="DoctestSyntaxError.__init__"></a> +<h4>DoctestSyntaxError (Constructor)</h4> +<b>DoctestSyntaxError</b>(<i>filename, loc, position=None</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>position=</i></dt> +<dd> +of warning if existent (object) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<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, loc, name</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc, name, orig_loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>name</i></dt> +<dd> +name of the shadowed import (string) +</dd><dt><i>orig_loc</i></dt> +<dd> +location of the import (object) +</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, loc, modname</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc, names</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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="Redefined" ID="Redefined"></a> +<h2>Redefined</h2> +<p> + Class defining the "Redefined" 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="#Redefined.__init__">Redefined</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="Redefined.__init__" ID="Redefined.__init__"></a> +<h4>Redefined (Constructor)</h4> +<b>Redefined</b>(<i>filename, loc, name, orig_loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>name</i></dt> +<dd> +name of the redefined function (string) +</dd><dt><i>orig_loc</i></dt> +<dd> +location of the original definition (object) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="RedefinedInListComp" ID="RedefinedInListComp"></a> +<h2>RedefinedInListComp</h2> +<p> + Class defining the list comprehension redefinition. +</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="#RedefinedInListComp.__init__">RedefinedInListComp</a></td> +<td>Constructor</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="RedefinedInListComp.__init__" ID="RedefinedInListComp.__init__"></a> +<h4>RedefinedInListComp (Constructor)</h4> +<b>RedefinedInListComp</b>(<i>filename, loc, name, orig_loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>name</i></dt> +<dd> +name of the redefined object (string) +</dd><dt><i>orig_loc</i></dt> +<dd> +location of the original definition (object) +</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, loc, name, orig_loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>name</i></dt> +<dd> +name of the redefined object (string) +</dd><dt><i>orig_loc</i></dt> +<dd> +location of the original definition (object) +</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, loc, name</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc, name, orig_loc</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>name</i></dt> +<dd> +name of the prematurely referenced variable (string) +</dd><dt><i>orig_loc</i></dt> +<dd> +location of the variable definition (object) +</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, loc, name</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc, name</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</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, loc, names</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file (string) +</dd><dt><i>loc</i></dt> +<dd> +location of warning (object) +</dd><dt><i>names</i></dt> +<dd> +names 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/eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.Tabnanny.Tabnanny.html Sun Mar 30 22:00:14 2014 +0200 @@ -63,6 +63,9 @@ <td><a href="#format_witnesses">format_witnesses</a></td> <td>Function to format the witnesses as a readable string.</td> </tr><tr> +<td><a href="#initService">initService</a></td> +<td>Initialize the service and return the entry point.</td> +</tr><tr> <td><a href="#process_tokens">process_tokens</a></td> <td>Function processing all tokens generated by a tokenizer run.</td> </tr> @@ -351,6 +354,19 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="initService" ID="initService"></a> +<h2>initService</h2> +<b>initService</b>(<i></i>) +<p> + Initialize the service and return the entry point. +</p><dl> +<dt>Returns:</dt> +<dd> +the entry point for the background client (function) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="process_tokens" ID="process_tokens"></a> <h2>process_tokens</h2> <b>process_tokens</b>(<i>tokens</i>)
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.Tabnanny.TabnannyDialog.html Sun Mar 30 22:00:14 2014 +0200 @@ -67,9 +67,15 @@ <td><a href="#TabnannyDialog.__finish">__finish</a></td> <td>Private slot called when the action or the user pressed the button.</td> </tr><tr> +<td><a href="#TabnannyDialog.__processResult">__processResult</a></td> +<td>Privat slot called after perfoming a style check on one file.</td> +</tr><tr> <td><a href="#TabnannyDialog.__resort">__resort</a></td> <td>Private method to resort the tree.</td> </tr><tr> +<td><a href="#TabnannyDialog.check">check</a></td> +<td>Start a style check for one file.</td> +</tr><tr> <td><a href="#TabnannyDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> <td>Private slot called by a button of the button box clicked.</td> </tr><tr> @@ -92,11 +98,14 @@ </table> <a NAME="TabnannyDialog.__init__" ID="TabnannyDialog.__init__"></a> <h4>TabnannyDialog (Constructor)</h4> -<b>TabnannyDialog</b>(<i>parent=None</i>) +<b>TabnannyDialog</b>(<i>indentCheckService, parent=None</i>) <p> Constructor </p><dl> -<dt><i>parent</i></dt> +<dt><i>indentCheckService</i></dt> +<dd> +reference to the service (IndentCheckService) +</dd><dt><i>parent</i></dt> <dd> The parent widget (QWidget). </dd> @@ -121,12 +130,43 @@ <b>__finish</b>(<i></i>) <p> Private slot called when the action or the user pressed the button. -</p><a NAME="TabnannyDialog.__resort" ID="TabnannyDialog.__resort"></a> +</p><a NAME="TabnannyDialog.__processResult" ID="TabnannyDialog.__processResult"></a> +<h4>TabnannyDialog.__processResult</h4> +<b>__processResult</b>(<i>fn, nok, line, error</i>) +<p> + Privat slot called after perfoming a style check on one file. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the just checked file (str) +</dd><dt><i>nok</i></dt> +<dd> +flag if a problem was found (bool) +</dd><dt><i>line</i></dt> +<dd> +line number (str) +</dd><dt><i>error</i></dt> +<dd> +text of the problem (str) +</dd> +</dl><a NAME="TabnannyDialog.__resort" ID="TabnannyDialog.__resort"></a> <h4>TabnannyDialog.__resort</h4> <b>__resort</b>(<i></i>) <p> Private method to resort the tree. -</p><a NAME="TabnannyDialog.on_buttonBox_clicked" ID="TabnannyDialog.on_buttonBox_clicked"></a> +</p><a NAME="TabnannyDialog.check" ID="TabnannyDialog.check"></a> +<h4>TabnannyDialog.check</h4> +<b>check</b>(<i>codestring=''</i>) +<p> + Start a style check for one file. +</p><p> + The results are reported to the __processResult slot. +</p><dl> +<dt><i>codestring=</i></dt> +<dd> +optional sourcestring (str) +</dd> +</dl><a NAME="TabnannyDialog.on_buttonBox_clicked" ID="TabnannyDialog.on_buttonBox_clicked"></a> <h4>TabnannyDialog.on_buttonBox_clicked</h4> <b>on_buttonBox_clicked</b>(<i>button</i>) <p>
--- a/Documentation/Source/eric5.Plugins.PluginCodeStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.PluginCodeStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -43,7 +43,14 @@ <h2>CodeStyleCheckerPlugin</h2> <p> Class implementing the code style checker plug-in. -</p> +</p><h3>Signals</h3> +<dl> +<dt>styleChecked(str, dict, int, list)</dt> +<dd> +emited when the style check was + done. +</dd> +</dl> <h3>Derived from</h3> QObject <h3>Class Attributes</h3> @@ -87,11 +94,17 @@ <td><a href="#CodeStyleCheckerPlugin.__projectShowMenu">__projectShowMenu</a></td> <td>Private slot called, when the the project menu or a submenu is about to be shown.</td> </tr><tr> +<td><a href="#CodeStyleCheckerPlugin.__translateStyleCheck">__translateStyleCheck</a></td> +<td>Privat slot called after perfoming a style check on one file.</td> +</tr><tr> <td><a href="#CodeStyleCheckerPlugin.activate">activate</a></td> <td>Public method to activate this plugin.</td> </tr><tr> <td><a href="#CodeStyleCheckerPlugin.deactivate">deactivate</a></td> <td>Public method to deactivate this plugin.</td> +</tr><tr> +<td><a href="#CodeStyleCheckerPlugin.styleCheck">styleCheck</a></td> +<td>Method to prepare a style check on one Python source file in another task.</td> </tr> </table> <h3>Static Methods</h3> @@ -195,6 +208,24 @@ <dd> reference to the menu (QMenu) </dd> +</dl><a NAME="CodeStyleCheckerPlugin.__translateStyleCheck" ID="CodeStyleCheckerPlugin.__translateStyleCheck"></a> +<h4>CodeStyleCheckerPlugin.__translateStyleCheck</h4> +<b>__translateStyleCheck</b>(<i>fn, codeStyleCheckerStats, results</i>) +<p> + Privat slot called after perfoming a style check on one file. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the just checked file (str) +</dd><dt><i>codeStyleCheckerStats</i></dt> +<dd> +stats of style and name check (dict) +</dd><dt><i>results</i></dt> +<dd> +tuple for each found violation of style (tuple of + lineno (int), position (int), text (str), fixed (bool), + autofixing (bool), fixedMsg (str)) +</dd> </dl><a NAME="CodeStyleCheckerPlugin.activate" ID="CodeStyleCheckerPlugin.activate"></a> <h4>CodeStyleCheckerPlugin.activate</h4> <b>activate</b>(<i></i>) @@ -210,7 +241,32 @@ <b>deactivate</b>(<i></i>) <p> Public method to deactivate this plugin. -</p> +</p><a NAME="CodeStyleCheckerPlugin.styleCheck" ID="CodeStyleCheckerPlugin.styleCheck"></a> +<h4>CodeStyleCheckerPlugin.styleCheck</h4> +<b>styleCheck</b>(<i>lang, filename, source, args</i>) +<p> + Method to prepare a style check on one Python source file in another + task. +</p><dl> +<dt><i>lang</i></dt> +<dd> +language of the file or None to determine by internal + algorithm (str or None) +</dd><dt><i>filename</i></dt> +<dd> +source filename (string) +</dd><dt><i>source</i></dt> +<dd> +string containing the code to check (string) +</dd><dt><i>args</i></dt> +<dd> +arguments used by the codeStyleCheck function (list of + excludeMessages (str), includeMessages (str), repeatMessages + (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), + maxLineLength (int), hangClosing (bool), docType (str), errors + (list of str), eol (str), encoding (str)) +</dd> +</dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Plugins.PluginSyntaxChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.PluginSyntaxChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -72,6 +72,9 @@ <td><a href="#SyntaxCheckerPlugin.__editorSyntaxCheck">__editorSyntaxCheck</a></td> <td>Private slot to handle the syntax check context menu action of the editors.</td> </tr><tr> +<td><a href="#SyntaxCheckerPlugin.__getPythonOptions">__getPythonOptions</a></td> +<td>Private methode to determine the syntax check options.</td> +</tr><tr> <td><a href="#SyntaxCheckerPlugin.__initialize">__initialize</a></td> <td>Private slot to (re)initialize the plugin.</td> </tr><tr> @@ -87,6 +90,9 @@ <td><a href="#SyntaxCheckerPlugin.__projectSyntaxCheck">__projectSyntaxCheck</a></td> <td>Public slot used to check the project files for syntax errors.</td> </tr><tr> +<td><a href="#SyntaxCheckerPlugin.__translateSyntaxCheck">__translateSyntaxCheck</a></td> +<td>Slot to translate the resulting messages.</td> +</tr><tr> <td><a href="#SyntaxCheckerPlugin.activate">activate</a></td> <td>Public method to activate this plugin.</td> </tr><tr> @@ -151,7 +157,17 @@ <p> Private slot to handle the syntax check context menu action of the editors. -</p><a NAME="SyntaxCheckerPlugin.__initialize" ID="SyntaxCheckerPlugin.__initialize"></a> +</p><a NAME="SyntaxCheckerPlugin.__getPythonOptions" ID="SyntaxCheckerPlugin.__getPythonOptions"></a> +<h4>SyntaxCheckerPlugin.__getPythonOptions</h4> +<b>__getPythonOptions</b>(<i></i>) +<p> + Private methode to determine the syntax check options. +</p><dl> +<dt>Returns:</dt> +<dd> +state of checkFlakes and ignoreStarImportWarnings (bool, bool) +</dd> +</dl><a NAME="SyntaxCheckerPlugin.__initialize" ID="SyntaxCheckerPlugin.__initialize"></a> <h4>SyntaxCheckerPlugin.__initialize</h4> <b>__initialize</b>(<i></i>) <p> @@ -195,7 +211,27 @@ <b>__projectSyntaxCheck</b>(<i></i>) <p> Public slot used to check the project files for syntax errors. -</p><a NAME="SyntaxCheckerPlugin.activate" ID="SyntaxCheckerPlugin.activate"></a> +</p><a NAME="SyntaxCheckerPlugin.__translateSyntaxCheck" ID="SyntaxCheckerPlugin.__translateSyntaxCheck"></a> +<h4>SyntaxCheckerPlugin.__translateSyntaxCheck</h4> +<b>__translateSyntaxCheck</b>(<i>fn, problems</i>) +<p> + Slot to translate the resulting messages. +</p><p> + If checkFlakes is True, warnings contains a list of strings containing + the warnings (marker, file name, line number, message) + The values are only valid, if nok is False. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the checked file (str) +</dd><dt><i>problems</i></dt> +<dd> +dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message, a list with arguments for the message) +</dd> +</dl><a NAME="SyntaxCheckerPlugin.activate" ID="SyntaxCheckerPlugin.activate"></a> <h4>SyntaxCheckerPlugin.activate</h4> <b>activate</b>(<i></i>) <p>
--- a/Documentation/Source/eric5.Plugins.PluginTabnanny.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Plugins.PluginTabnanny.html Sun Mar 30 22:00:14 2014 +0200 @@ -43,7 +43,14 @@ <h2>TabnannyPlugin</h2> <p> Class implementing the Tabnanny plugin. -</p> +</p><h3>Signals</h3> +<dl> +<dt>indentChecked(str, bool, str, str)</dt> +<dd> +emited when the indent + check was done. +</dd> +</dl> <h3>Derived from</h3> QObject <h3>Class Attributes</h3> @@ -92,6 +99,9 @@ </tr><tr> <td><a href="#TabnannyPlugin.deactivate">deactivate</a></td> <td>Public method to deactivate this plugin.</td> +</tr><tr> +<td><a href="#TabnannyPlugin.indentCheck">indentCheck</a></td> +<td>Method to prepare a style check on one Python source file in another task.</td> </tr> </table> <h3>Static Methods</h3> @@ -209,7 +219,25 @@ <b>deactivate</b>(<i></i>) <p> Public method to deactivate this plugin. -</p> +</p><a NAME="TabnannyPlugin.indentCheck" ID="TabnannyPlugin.indentCheck"></a> +<h4>TabnannyPlugin.indentCheck</h4> +<b>indentCheck</b>(<i>lang, filename, source</i>) +<p> + Method to prepare a style check on one Python source file in another + task. +</p><dl> +<dt><i>lang</i></dt> +<dd> +language of the file or None to determine by internal + algorithm (str or None) +</dd><dt><i>filename</i></dt> +<dd> +source filename (string) +</dd><dt><i>source</i></dt> +<dd> +string containing the code to check (string) +</dd> +</dl> <div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.QScintilla.Editor.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.QScintilla.Editor.html Sun Mar 30 22:00:14 2014 +0200 @@ -419,6 +419,9 @@ <td><a href="#Editor.__processRequestSyncCommand">__processRequestSyncCommand</a></td> <td>Private slot to process a remote RequestSync command.</td> </tr><tr> +<td><a href="#Editor.__processResult">__processResult</a></td> +<td>Slot to report the resulting messages.</td> +</tr><tr> <td><a href="#Editor.__processStartEditCommand">__processStartEditCommand</a></td> <td>Private slot to process a remote StartEdit command.</td> </tr><tr> @@ -770,6 +773,9 @@ <td><a href="#Editor.getNoName">getNoName</a></td> <td>Public method to get the display string for an unnamed editor.</td> </tr><tr> +<td><a href="#Editor.getPyVersion">getPyVersion</a></td> +<td>Public methode to return the Python main version (2 or 3) or 0 if it's not a Python file at all.</td> +</tr><tr> <td><a href="#Editor.getSearchText">getSearchText</a></td> <td>Public method to determine the selection or the current word for the next search operation.</td> </tr><tr> @@ -2001,6 +2007,22 @@ <dd> string containing the command parameters (string) </dd> +</dl><a NAME="Editor.__processResult" ID="Editor.__processResult"></a> +<h4>Editor.__processResult</h4> +<b>__processResult</b>(<i>fn, problems</i>) +<p> + Slot to report the resulting messages. +</p><dl> +<dt><i>fn</i></dt> +<dd> +filename of the checked file (str) +</dd><dt><i>problems</i></dt> +<dd> +dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message) (dict) +</dd> </dl><a NAME="Editor.__processStartEditCommand" ID="Editor.__processStartEditCommand"></a> <h4>Editor.__processStartEditCommand</h4> <b>__processStartEditCommand</b>(<i>argsString</i>) @@ -2947,6 +2969,17 @@ <dd> display string for this unnamed editor (string) </dd> +</dl><a NAME="Editor.getPyVersion" ID="Editor.getPyVersion"></a> +<h4>Editor.getPyVersion</h4> +<b>getPyVersion</b>(<i></i>) +<p> + Public methode to return the Python main version (2 or 3) or 0 if it's + not a Python file at all. +</p><dl> +<dt>Returns:</dt> +<dd> +Python version (2 or 3) or 0 if it's not a Python file (int) +</dd> </dl><a NAME="Editor.getSearchText" ID="Editor.getSearchText"></a> <h4>Editor.getSearchText</h4> <b>getSearchText</b>(<i>selectionOnly=False</i>) @@ -3817,7 +3850,7 @@ </dd> </dl><a NAME="Editor.toggleWarning" ID="Editor.toggleWarning"></a> <h4>Editor.toggleWarning</h4> -<b>toggleWarning</b>(<i>line, warning, msg="", warningType=WarningCode</i>) +<b>toggleWarning</b>(<i>line, col, warning, msg="", warningType=WarningCode</i>) <p> Public method to toggle a warning indicator. </p><p> @@ -3826,6 +3859,9 @@ <dt><i>line</i></dt> <dd> line number of the warning +</dd><dt><i>col</i></dt> +<dd> +column of the warning </dd><dt><i>warning</i></dt> <dd> flag indicating if the warning marker should be
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Utilities.BackgroundClient.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,154 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Utilities.BackgroundClient</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.Utilities.BackgroundClient</h1> +<p> +Module implementing a Qt free version of a background client for the various +checkers and other python interpreter dependent functions. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#BackgroundClient">BackgroundClient</a></td> +<td>Class implementing the main part of the background client.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="BackgroundClient" ID="BackgroundClient"></a> +<h2>BackgroundClient</h2> +<p> + Class implementing the main part of the background client. +</p> +<h3>Derived from</h3> +object +<h3>Class Attributes</h3> +<table> +<tr><td>backgroundClient</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#BackgroundClient.__init__">BackgroundClient</a></td> +<td>Constructor of the BackgroundClient class.</td> +</tr><tr> +<td><a href="#BackgroundClient.__initClientService">__initClientService</a></td> +<td>Import the given module and register it as service.</td> +</tr><tr> +<td><a href="#BackgroundClient.__receive">__receive</a></td> +<td>Private methode to receive the given length of bytes.</td> +</tr><tr> +<td><a href="#BackgroundClient.__send">__send</a></td> +<td>Private method to send a job response back to the BackgroundService.</td> +</tr><tr> +<td><a href="#BackgroundClient.run">run</a></td> +<td>Implement the main loop of the client.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="BackgroundClient.__init__" ID="BackgroundClient.__init__"></a> +<h4>BackgroundClient (Constructor)</h4> +<b>BackgroundClient</b>(<i>host, port</i>) +<p> + Constructor of the BackgroundClient class. +</p><dl> +<dt><i>host</i></dt> +<dd> +ip address the background service is listening +</dd><dt><i>port</i></dt> +<dd> +port of the background service +</dd> +</dl><a NAME="BackgroundClient.__initClientService" ID="BackgroundClient.__initClientService"></a> +<h4>BackgroundClient.__initClientService</h4> +<b>__initClientService</b>(<i>fn, path, module</i>) +<p> + Import the given module and register it as service. +</p><dl> +<dt><i>fn</i></dt> +<dd> +service name to register (str) +</dd><dt><i>path</i></dt> +<dd> +contains the path to the module (str) +</dd><dt><i>module</i></dt> +<dd> +name to import (str) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +text result of the import action (str) +</dd> +</dl><a NAME="BackgroundClient.__receive" ID="BackgroundClient.__receive"></a> +<h4>BackgroundClient.__receive</h4> +<b>__receive</b>(<i>length</i>) +<p> + Private methode to receive the given length of bytes. +</p><dl> +<dt><i>length</i></dt> +<dd> +bytes to receive (int) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +received bytes or None if connection closed (str) +</dd> +</dl><a NAME="BackgroundClient.__send" ID="BackgroundClient.__send"></a> +<h4>BackgroundClient.__send</h4> +<b>__send</b>(<i>fx, fn, data</i>) +<p> + Private method to send a job response back to the BackgroundService. +</p><dl> +<dt><i>fx</i></dt> +<dd> +remote function name to execute (str) +</dd><dt><i>fn</i></dt> +<dd> +filename for identification (str) +</dd><dt><i>data</i></dt> +<dd> +return value(s) (any basic datatype) +</dd> +</dl><a NAME="BackgroundClient.run" ID="BackgroundClient.run"></a> +<h4>BackgroundClient.run</h4> +<b>run</b>(<i></i>) +<p> + Implement the main loop of the client. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric5.Utilities.BackgroundService.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,258 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Utilities.BackgroundService</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.Utilities.BackgroundService</h1> +<p> +Module implementing a background service for the various checkers and other +python interpreter dependent functions. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#BackgroundService">BackgroundService</a></td> +<td>Class implementing the main part of the background service.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> +<hr /><hr /> +<a NAME="BackgroundService" ID="BackgroundService"></a> +<h2>BackgroundService</h2> +<p> + Class implementing the main part of the background service. +</p> +<h3>Derived from</h3> +QTcpServer +<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="#BackgroundService.__init__">BackgroundService</a></td> +<td>Constructor of the BackgroundService class.</td> +</tr><tr> +<td><a href="#BackgroundService.__processQueue">__processQueue</a></td> +<td>Private method to take the next service request and send it to the client.</td> +</tr><tr> +<td><a href="#BackgroundService.__receive">__receive</a></td> +<td>Private method to receive the response from the clients.</td> +</tr><tr> +<td><a href="#BackgroundService.__send">__send</a></td> +<td>Private method to send a job request to one of the clients.</td> +</tr><tr> +<td><a href="#BackgroundService.__startExternalClient">__startExternalClient</a></td> +<td>Private method to start the background client as external process.</td> +</tr><tr> +<td><a href="#BackgroundService.__startInternalClient">__startInternalClient</a></td> +<td>Private method to start the background client as internal thread.</td> +</tr><tr> +<td><a href="#BackgroundService.enqueueRequest">enqueueRequest</a></td> +<td>Implement a queued processing of incomming events.</td> +</tr><tr> +<td><a href="#BackgroundService.on_disconnectSocket">on_disconnectSocket</a></td> +<td>Slot when connection to a client is lost.</td> +</tr><tr> +<td><a href="#BackgroundService.on_newConnection">on_newConnection</a></td> +<td>Slot for new incomming connections from the clients.</td> +</tr><tr> +<td><a href="#BackgroundService.serviceConnect">serviceConnect</a></td> +<td>Announce a new service to the background service/ client.</td> +</tr><tr> +<td><a href="#BackgroundService.serviceDisconnect">serviceDisconnect</a></td> +<td>Remove the service from the service list.</td> +</tr><tr> +<td><a href="#BackgroundService.shutdown">shutdown</a></td> +<td>Cleanup the connections and processes when Eric is shuting down.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="BackgroundService.__init__" ID="BackgroundService.__init__"></a> +<h4>BackgroundService (Constructor)</h4> +<b>BackgroundService</b>(<i></i>) +<p> + Constructor of the BackgroundService class. +</p><a NAME="BackgroundService.__processQueue" ID="BackgroundService.__processQueue"></a> +<h4>BackgroundService.__processQueue</h4> +<b>__processQueue</b>(<i></i>) +<p> + Private method to take the next service request and send it to the + client. +</p><a NAME="BackgroundService.__receive" ID="BackgroundService.__receive"></a> +<h4>BackgroundService.__receive</h4> +<b>__receive</b>(<i>lang</i>) +<p> + Private method to receive the response from the clients. +</p><dl> +<dt><i>lang</i></dt> +<dd> +language of the incomming connection (str) +</dd> +</dl><a NAME="BackgroundService.__send" ID="BackgroundService.__send"></a> +<h4>BackgroundService.__send</h4> +<b>__send</b>(<i>fx, lang, fn, data</i>) +<p> + Private method to send a job request to one of the clients. +</p><dl> +<dt><i>fx</i></dt> +<dd> +remote function name to execute (str) +</dd><dt><i>lang</i></dt> +<dd> +language to connect to (str) +</dd><dt><i>fn</i></dt> +<dd> +filename for identification (str) +</dd><dt><i>data</i></dt> +<dd> +function argument(s) (any basic datatype) +</dd> +</dl><a NAME="BackgroundService.__startExternalClient" ID="BackgroundService.__startExternalClient"></a> +<h4>BackgroundService.__startExternalClient</h4> +<b>__startExternalClient</b>(<i>interpreter, port</i>) +<p> + Private method to start the background client as external process. +</p><dl> +<dt><i>interpreter</i></dt> +<dd> +path and name of the executable to start (string) +</dd><dt><i>port</i></dt> +<dd> +socket port to which the interpreter should connect (int) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the process object (QProcess or None) +</dd> +</dl><a NAME="BackgroundService.__startInternalClient" ID="BackgroundService.__startInternalClient"></a> +<h4>BackgroundService.__startInternalClient</h4> +<b>__startInternalClient</b>(<i>port</i>) +<p> + Private method to start the background client as internal thread. +</p><dl> +<dt><i>port</i></dt> +<dd> +socket port to which the interpreter should connect (int) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +the thread object (Thread) or None +</dd> +</dl><a NAME="BackgroundService.enqueueRequest" ID="BackgroundService.enqueueRequest"></a> +<h4>BackgroundService.enqueueRequest</h4> +<b>enqueueRequest</b>(<i>fx, lang, fn, data</i>) +<p> + Implement a queued processing of incomming events. +</p><p> + Dublicate service requests updates an older request to avoid overrun or + starving of the services. +</p><dl> +<dt><i>fx</i></dt> +<dd> +function name of the service (str) +</dd><dt><i>lang</i></dt> +<dd> +language to connect to (str) +</dd><dt><i>fn</i></dt> +<dd> +filename for identification (str) +</dd><dt><i>data</i></dt> +<dd> +function argument(s) (any basic datatype(s)) +</dd> +</dl><a NAME="BackgroundService.on_disconnectSocket" ID="BackgroundService.on_disconnectSocket"></a> +<h4>BackgroundService.on_disconnectSocket</h4> +<b>on_disconnectSocket</b>(<i>lang</i>) +<p> + Slot when connection to a client is lost. +</p><dl> +<dt><i>lang</i></dt> +<dd> +client language which connection is lost (str) +</dd> +</dl><a NAME="BackgroundService.on_newConnection" ID="BackgroundService.on_newConnection"></a> +<h4>BackgroundService.on_newConnection</h4> +<b>on_newConnection</b>(<i></i>) +<p> + Slot for new incomming connections from the clients. +</p><a NAME="BackgroundService.serviceConnect" ID="BackgroundService.serviceConnect"></a> +<h4>BackgroundService.serviceConnect</h4> +<b>serviceConnect</b>(<i>fx, lang, modulepath, module, callback, onErrorCallback=None</i>) +<p> + Announce a new service to the background service/ client. +</p><dl> +<dt><i>fx</i></dt> +<dd> +function name of the service (str) +</dd><dt><i>lang</i></dt> +<dd> +language of the new service (str) +</dd><dt><i>modulepath</i></dt> +<dd> +full path to the module (str) +</dd><dt><i>module</i></dt> +<dd> +name to import (str) +</dd><dt><i>callback</i></dt> +<dd> +function on service response (function) +</dd><dt><i>onErrorCallback</i></dt> +<dd> +function if client isn't available (function) +</dd> +</dl><a NAME="BackgroundService.serviceDisconnect" ID="BackgroundService.serviceDisconnect"></a> +<h4>BackgroundService.serviceDisconnect</h4> +<b>serviceDisconnect</b>(<i>fx, lang</i>) +<p> + Remove the service from the service list. +</p><dl> +<dt><i>fx</i></dt> +<dd> +function name of the service (function) +</dd><dt><i>lang</i></dt> +<dd> +language of the service (str) +</dd> +</dl><a NAME="BackgroundService.shutdown" ID="BackgroundService.shutdown"></a> +<h4>BackgroundService.shutdown</h4> +<b>shutdown</b>(<i></i>) +<p> + Cleanup the connections and processes when Eric is shuting down. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Utilities.SyntaxCheck.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.SyntaxCheck</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.Utilities.SyntaxCheck</h1> -<p> -Module implementing the syntax check for Python 2/3. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>codingBytes_regexps</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#compile_and_check">compile_and_check</a></td> -<td>Function to compile one Python source file to Python bytecode and to perform a pyflakes check.</td> -</tr><tr> -<td><a href="#decode">decode</a></td> -<td>Function to decode some byte text into a string.</td> -</tr><tr> -<td><a href="#extractLineFlags">extractLineFlags</a></td> -<td>Function to extract flags starting and ending with '__' from a line comment.</td> -</tr><tr> -<td><a href="#get_codingBytes">get_codingBytes</a></td> -<td>Function to get the coding of a bytes text.</td> -</tr><tr> -<td><a href="#normalizeCode">normalizeCode</a></td> -<td>Function to normalize the given code.</td> -</tr><tr> -<td><a href="#readEncodedFile">readEncodedFile</a></td> -<td>Function to read a file and decode it's contents into proper text.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="compile_and_check" ID="compile_and_check"></a> -<h2>compile_and_check</h2> -<b>compile_and_check</b>(<i>file_, codestring="", checkFlakes=True, ignoreStarImportWarnings=False</i>) -<p> - Function to compile one Python source file to Python bytecode - and to perform a pyflakes check. -</p><dl> -<dt><i>file_</i></dt> -<dd> -source filename (string) -</dd><dt><i>codestring</i></dt> -<dd> -string containing the code to compile (string) -</dd><dt><i>checkFlakes=</i></dt> -<dd> -flag indicating to do a pyflakes check (boolean) -</dd><dt><i>ignoreStarImportWarnings=</i></dt> -<dd> -flag indicating to - ignore 'star import' warnings (boolean) -</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). If checkFlakes is True, a list of strings containing the - warnings (marker, file name, line number, message) - The values are only valid, if the status is True. -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="decode" ID="decode"></a> -<h2>decode</h2> -<b>decode</b>(<i>text</i>) -<p> - Function to decode some byte text into a string. -</p><dl> -<dt><i>text</i></dt> -<dd> -byte text to decode (bytes) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple of decoded text and encoding (string, string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="extractLineFlags" ID="extractLineFlags"></a> -<h2>extractLineFlags</h2> -<b>extractLineFlags</b>(<i>line, startComment="</i>) -<p> - Function to extract flags starting and ending with '__' from a line - comment. -</p><dl> -<dt><i>line</i></dt> -<dd> -line to extract flags from (string) -</dd><dt><i>startComment=</i></dt> -<dd> -string identifying the start of the comment (string) -</dd><dt><i>endComment=</i></dt> -<dd> -string identifying the end of a comment (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list containing the extracted flags (list of strings) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_codingBytes" ID="get_codingBytes"></a> -<h2>get_codingBytes</h2> -<b>get_codingBytes</b>(<i>text</i>) -<p> - Function to get the coding of a bytes text. -</p><dl> -<dt><i>text</i></dt> -<dd> -bytes text to inspect (bytes) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -coding string -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="normalizeCode" ID="normalizeCode"></a> -<h2>normalizeCode</h2> -<b>normalizeCode</b>(<i>codestring</i>) -<p> - Function to normalize the given code. -</p><dl> -<dt><i>codestring</i></dt> -<dd> -code to be normalized (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -normalized code (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="readEncodedFile" ID="readEncodedFile"></a> -<h2>readEncodedFile</h2> -<b>readEncodedFile</b>(<i>filename</i>) -<p> - Function to read a file and decode it's contents into proper text. -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file to read (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple of decoded text and encoding (string, string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Utilities.__init__.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/eric5.Utilities.__init__.html Sun Mar 30 22:00:14 2014 +0200 @@ -25,7 +25,7 @@ </p> <h3>Global Attributes</h3> <table> -<tr><td>_escape</td></tr><tr><td>_escape_map</td></tr><tr><td>_uescape</td></tr><tr><td>_uunescape</td></tr><tr><td>coding_regexps</td></tr><tr><td>configDir</td></tr><tr><td>supportedCodecs</td></tr> +<tr><td>_escape</td></tr><tr><td>_escape_map</td></tr><tr><td>_uescape</td></tr><tr><td>_uunescape</td></tr><tr><td>codingBytes_regexps</td></tr><tr><td>coding_regexps</td></tr><tr><td>configDir</td></tr><tr><td>supportedCodecs</td></tr> </table> <h3>Classes</h3> <table> @@ -49,21 +49,21 @@ <td><a href="#compactPath">compactPath</a></td> <td>Function to return a compacted path fitting inside the given width.</td> </tr><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="#compile_extern">compile_extern</a></td> -<td>Function to compile one Python source file to Python bytecode.</td> -</tr><tr> <td><a href="#convertLineEnds">convertLineEnds</a></td> <td>Function to convert the end of line characters.</td> </tr><tr> +<td><a href="#decode">decode</a></td> +<td>Function to decode some byte text into a string.</td> +</tr><tr> <td><a href="#decodeBytes">decodeBytes</a></td> <td>Function to decode some byte text into a string.</td> </tr><tr> <td><a href="#decodeString">decodeString</a></td> <td>Function to decode a string containing Unicode encoded characters.</td> </tr><tr> +<td><a href="#determinePythonVersion">determinePythonVersion</a></td> +<td>Determine the python version of a given file.</td> +</tr><tr> <td><a href="#direntries">direntries</a></td> <td>Function returning a list of all files and directories.</td> </tr><tr> @@ -82,6 +82,9 @@ <td><a href="#extractFlagsFromFile">extractFlagsFromFile</a></td> <td>Function to extract eric specific flags out of the given file.</td> </tr><tr> +<td><a href="#extractLineFlags">extractLineFlags</a></td> +<td>Function to extract flags starting and ending with '__' from a line comment.</td> +</tr><tr> <td><a href="#fromNativeSeparators">fromNativeSeparators</a></td> <td>Function returning a path, that is using "/" separator characters.</td> </tr><tr> @@ -142,6 +145,9 @@ <td><a href="#get_coding">get_coding</a></td> <td>Function to get the coding of a text.</td> </tr><tr> +<td><a href="#get_codingBytes">get_codingBytes</a></td> +<td>Function to get the coding of a bytes text.</td> +</tr><tr> <td><a href="#hasEnvironmentEntry">hasEnvironmentEntry</a></td> <td>Module function to check, if the environment contains an entry.</td> </tr><tr> @@ -196,6 +202,9 @@ <td><a href="#quote">quote</a></td> <td>Replacement for the urllib.quote function because of unicode problems.</td> </tr><tr> +<td><a href="#readEncodedFile">readEncodedFile</a></td> +<td>Function to read a file and decode its contents into proper text.</td> +</tr><tr> <td><a href="#readEncodedFileWithHash">readEncodedFileWithHash</a></td> <td>Function to read a file, calculate a hash value and decode its contents into proper text.</td> </tr><tr> @@ -393,67 +402,6 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> -<a NAME="compile" ID="compile"></a> -<h2>compile</h2> -<b>compile</b>(<i>file, codestring="", isPy2=False</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> -string containing the code to compile (string) -</dd><dt><i>isPy2</i></dt> -<dd> -shows which interperter to use (boolean) -</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 is True. -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="compile_extern" ID="compile_extern"></a> -<h2>compile_extern</h2> -<b>compile_extern</b>(<i>file, isPy2, checkFlakes=True, ignoreStarImportWarnings=False</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>isPy2</i></dt> -<dd> -flag indicating if it's a Python 2 or 3 file (boolean) -</dd><dt><i>checkFlakes=</i></dt> -<dd> -flag indicating to do a pyflakes check (boolean) -</dd><dt><i>ignoreStarImportWarnings=</i></dt> -<dd> -flag if star import warnings should be - suppressed (boolean) -</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, - the error message and a list of tuples of pyflakes warnings indicating - file name, line number and message (boolean, string, string, string, - string, string, list of (string, string, string)). The syntax error - values are only valid, if the status is True. The pyflakes list will - be empty, if a syntax error was detected by the syntax checker. -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> <a NAME="convertLineEnds" ID="convertLineEnds"></a> <h2>convertLineEnds</h2> <b>convertLineEnds</b>(<i>text, eol</i>) @@ -475,6 +423,24 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="decode" ID="decode"></a> +<h2>decode</h2> +<b>decode</b>(<i>text</i>) +<p> + Function to decode some byte text into a string. +</p><dl> +<dt><i>text</i></dt> +<dd> +byte text to decode (bytes) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +tuple of decoded text and encoding (string, string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="decodeBytes" ID="decodeBytes"></a> <h2>decodeBytes</h2> <b>decodeBytes</b>(<i>buffer</i>) @@ -511,6 +477,30 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="determinePythonVersion" ID="determinePythonVersion"></a> +<h2>determinePythonVersion</h2> +<b>determinePythonVersion</b>(<i>filename, source, editor=None</i>) +<p> + Determine the python version of a given file. +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file with extension (str) +</dd><dt><i>source</i></dt> +<dd> +of the file (str) +</dd><dt><i>editor=</i></dt> +<dd> +if the file is opened already (Editor object) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +Python version if file is Python2 or Python3 (int) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="direntries" ID="direntries"></a> <h2>direntries</h2> <b>direntries</b>(<i>path, filesonly=False, pattern=None, followsymlinks=True, checkStop=None</i>) @@ -652,6 +642,31 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="extractLineFlags" ID="extractLineFlags"></a> +<h2>extractLineFlags</h2> +<b>extractLineFlags</b>(<i>line, startComment="</i>) +<p> + Function to extract flags starting and ending with '__' from a line + comment. +</p><dl> +<dt><i>line</i></dt> +<dd> +line to extract flags from (string) +</dd><dt><i>startComment=</i></dt> +<dd> +string identifying the start of the comment (string) +</dd><dt><i>endComment=</i></dt> +<dd> +string identifying the end of a comment (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +list containing the extracted flags (list of strings) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="fromNativeSeparators" ID="fromNativeSeparators"></a> <h2>fromNativeSeparators</h2> <b>fromNativeSeparators</b>(<i>path</i>) @@ -998,6 +1013,24 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="get_codingBytes" ID="get_codingBytes"></a> +<h2>get_codingBytes</h2> +<b>get_codingBytes</b>(<i>text</i>) +<p> + Function to get the coding of a bytes text. +</p><dl> +<dt><i>text</i></dt> +<dd> +bytes text to inspect (bytes) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +coding string +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="hasEnvironmentEntry" ID="hasEnvironmentEntry"></a> <h2>hasEnvironmentEntry</h2> <b>hasEnvironmentEntry</b>(<i>key</i>) @@ -1352,6 +1385,24 @@ </dl> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="readEncodedFile" ID="readEncodedFile"></a> +<h2>readEncodedFile</h2> +<b>readEncodedFile</b>(<i>filename</i>) +<p> + Function to read a file and decode its contents into proper text. +</p><dl> +<dt><i>filename</i></dt> +<dd> +name of the file to read (string) +</dd> +</dl><dl> +<dt>Returns:</dt> +<dd> +tuple of decoded text and encoding (string, string) +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> <a NAME="readEncodedFileWithHash" ID="readEncodedFileWithHash"></a> <h2>readEncodedFileWithHash</h2> <b>readEncodedFileWithHash</b>(<i>filename</i>)
--- a/Documentation/Source/eric5.Utilities.py2flakes.checker.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,796 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.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.Utilities.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>I check the cleanliness and sanity of Python code.</td> -</tr><tr> -<td><a href="#ClassDefinition">ClassDefinition</a></td> -<td></td> -</tr><tr> -<td><a href="#ClassScope">ClassScope</a></td> -<td></td> -</tr><tr> -<td><a href="#Definition">Definition</a></td> -<td>A binding that defines a function or a class.</td> -</tr><tr> -<td><a href="#ExportBinding">ExportBinding</a></td> -<td>A binding created by an C{__all__} assignment.</td> -</tr><tr> -<td><a href="#FunctionDefinition">FunctionDefinition</a></td> -<td></td> -</tr><tr> -<td><a href="#FunctionScope">FunctionScope</a></td> -<td>I represent 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></td> -</tr><tr> -<td><a href="#Scope">Scope</a></td> -<td></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="#getNodeName">getNodeName</a></td> -<td></td> -</tr><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> - I 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>BOOLOP</td></tr><tr><td>COMPREHENSION</td></tr><tr><td>CONTINUE</td></tr><tr><td>GENERATOREXP</td></tr><tr><td>LOAD</td></tr><tr><td>NONLOCAL</td></tr><tr><td>NUM</td></tr><tr><td>RETURN</td></tr><tr><td>SLICE</td></tr><tr><td>builtIns</td></tr><tr><td>nodeDepth</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></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.EXCEPTHANDLER">EXCEPTHANDLER</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>Handle occurrence of Name (which can be a load/store/delete access.)</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.checkDeadScopes">checkDeadScopes</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.checkUnusedAssignments">checkUnusedAssignments</a></td> -<td>Check to see if any assignments have not been used.</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.descendantOf">descendantOf</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.differentForks">differentForks</a></td> -<td>True, if lnode and rnode are located on different forks of IF/TRY</td> -</tr><tr> -<td><a href="#Checker.getCommonAncestor">getCommonAncestor</a></td> -<td></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.handleNodeDelete">handleNodeDelete</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.handleNodeLoad">handleNodeLoad</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.handleNodeStore">handleNodeStore</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.hasParent">hasParent</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.onFork">onFork</a></td> -<td></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.runDeferred">runDeferred</a></td> -<td>Run the callables in C{deferred} using their associated scope stack.</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>tree, filename='(none)', builtins=None</i>) -<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.EXCEPTHANDLER" ID="Checker.EXCEPTHANDLER"></a> -<h4>Checker.EXCEPTHANDLER</h4> -<b>EXCEPTHANDLER</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> - Handle occurrence of Name (which can be a load/store/delete access.) -</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>node, value, reportRedef=True</i>) -<p> - Called when a binding is altered. -</p><p> - - `node` is the statement responsible for the change - - `value` is the optional new value, a Binding instance, associated - with the binding; if None, the binding is deleted if it exists. - - if `reportRedef` is True (default), rebinding while unused will be - reported. -</p><a NAME="Checker.checkDeadScopes" ID="Checker.checkDeadScopes"></a> -<h4>Checker.checkDeadScopes</h4> -<b>checkDeadScopes</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.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.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.descendantOf" ID="Checker.descendantOf"></a> -<h4>Checker.descendantOf</h4> -<b>descendantOf</b>(<i>node, ancestors, stop=None</i>) -<a NAME="Checker.differentForks" ID="Checker.differentForks"></a> -<h4>Checker.differentForks</h4> -<b>differentForks</b>(<i>lnode, rnode</i>) -<p> -True, if lnode and rnode are located on different forks of IF/TRY -</p><a NAME="Checker.getCommonAncestor" ID="Checker.getCommonAncestor"></a> -<h4>Checker.getCommonAncestor</h4> -<b>getCommonAncestor</b>(<i>lnode, rnode, stop=None</i>) -<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.handleNodeDelete" ID="Checker.handleNodeDelete"></a> -<h4>Checker.handleNodeDelete</h4> -<b>handleNodeDelete</b>(<i>node</i>) -<a NAME="Checker.handleNodeLoad" ID="Checker.handleNodeLoad"></a> -<h4>Checker.handleNodeLoad</h4> -<b>handleNodeLoad</b>(<i>node</i>) -<a NAME="Checker.handleNodeStore" ID="Checker.handleNodeStore"></a> -<h4>Checker.handleNodeStore</h4> -<b>handleNodeStore</b>(<i>node</i>) -<a NAME="Checker.hasParent" ID="Checker.hasParent"></a> -<h4>Checker.hasParent</h4> -<b>hasParent</b>(<i>node, kind</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.onFork" ID="Checker.onFork"></a> -<h4>Checker.onFork</h4> -<b>onFork</b>(<i>parent, lnode, rnode, items</i>) -<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.runDeferred" ID="Checker.runDeferred"></a> -<h4>Checker.runDeferred</h4> -<b>runDeferred</b>(<i>deferred</i>) -<p> - Run the callables in C{deferred} using their associated scope stack. -</p><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="ClassDefinition" ID="ClassDefinition"></a> -<h2>ClassDefinition</h2> - -<h3>Derived from</h3> -Definition -<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="ClassScope" ID="ClassScope"></a> -<h2>ClassScope</h2> - -<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="Definition" ID="Definition"></a> -<h2>Definition</h2> -<p> - A binding that defines a function or a class. -</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="ExportBinding" ID="ExportBinding"></a> -<h2>ExportBinding</h2> -<p> - A binding created by an C{__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 C{__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 - C{__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> - -<h3>Derived from</h3> -Definition -<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> - I represent 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> - -<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> - -<h3>Derived from</h3> -dict -<h3>Class Attributes</h3> -<table> -<tr><td>importStarred</td></tr><tr><td>usesLocals</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<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.__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="getNodeName" ID="getNodeName"></a> -<h2>getNodeName</h2> -<b>getNodeName</b>(<i>node</i>) - -<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.Utilities.py2flakes.messages.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,729 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.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.Utilities.py2flakes.messages</h1> -<p> -Module implementing the messages for py2flakes. -</p> -<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="#Redefined">Redefined</a></td> -<td>Class defining the "Redefined" message.</td> -</tr><tr> -<td><a href="#RedefinedInListComp">RedefinedInListComp</a></td> -<td>Class defining the list comprehension redefinition.</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><a href="#QT_TRANSLATE_NOOP">QT_TRANSLATE_NOOP</a></td> -<td>Function to tell 'lupdate' which strings to keep for translation.</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="Redefined" ID="Redefined"></a> -<h2>Redefined</h2> -<p> - Class defining the "Redefined" 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="#Redefined.__init__">Redefined</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="Redefined.__init__" ID="Redefined.__init__"></a> -<h4>Redefined (Constructor)</h4> -<b>Redefined</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="RedefinedInListComp" ID="RedefinedInListComp"></a> -<h2>RedefinedInListComp</h2> -<p> - Class defining the list comprehension redefinition. -</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="#RedefinedInListComp.__init__">RedefinedInListComp</a></td> -<td>Constructor</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="RedefinedInListComp.__init__" ID="RedefinedInListComp.__init__"></a> -<h4>RedefinedInListComp (Constructor)</h4> -<b>RedefinedInListComp</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="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>names</i></dt> -<dd> -names of the unused variable (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="QT_TRANSLATE_NOOP" ID="QT_TRANSLATE_NOOP"></a> -<h2>QT_TRANSLATE_NOOP</h2> -<b>QT_TRANSLATE_NOOP</b>(<i>mod, txt</i>) -<p> - Function to tell 'lupdate' which strings to keep for translation. -</p><dl> -<dt><i>mod</i></dt> -<dd> -module name -</dd><dt><i>txt</i></dt> -<dd> -translatable string -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -the untranslated! string -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Utilities.py3flakes.checker.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,719 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.py3flakes.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.Utilities.py3flakes.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>None</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 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>ATTRIBUTES</td></tr><tr><td>BOOLOP</td></tr><tr><td>CALL</td></tr><tr><td>COMPREHENSION</td></tr><tr><td>INVERT</td></tr><tr><td>ISNOT</td></tr><tr><td>LOAD</td></tr><tr><td>MOD</td></tr><tr><td>NONLOCAL</td></tr><tr><td>PASS</td></tr><tr><td>RETURN</td></tr><tr><td>SETCOMP</td></tr><tr><td>SLICE</td></tr><tr><td>TRY</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.EXCEPTHANDLER">EXCEPTHANDLER</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>Handle occurrence of Name (which can be a load/store/delete access.)</td> -</tr><tr> -<td><a href="#Checker.STARRED">STARRED</a></td> -<td></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.handleAssignName">handleAssignName</a></td> -<td></td> -</tr><tr> -<td><a href="#Checker.handleBody">handleBody</a></td> -<td></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.EXCEPTHANDLER" ID="Checker.EXCEPTHANDLER"></a> -<h4>Checker.EXCEPTHANDLER</h4> -<b>EXCEPTHANDLER</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> - Handle occurrence of Name (which can be a load/store/delete access.) -</p><a NAME="Checker.STARRED" ID="Checker.STARRED"></a> -<h4>Checker.STARRED</h4> -<b>STARRED</b>(<i>node</i>) -<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.handleAssignName" ID="Checker.handleAssignName"></a> -<h4>Checker.handleAssignName</h4> -<b>handleAssignName</b>(<i>node</i>) -<a NAME="Checker.handleBody" ID="Checker.handleBody"></a> -<h4>Checker.handleBody</h4> -<b>handleBody</b>(<i>tree</i>) -<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>is_property</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 /> -</body></html> \ No newline at end of file
--- a/Documentation/Source/eric5.Utilities.py3flakes.messages.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,678 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.py3flakes.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.Utilities.py3flakes.messages</h1> -<p> -Module implementing the messages for py3flakes. -</p> -<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><a href="#QT_TRANSLATE_NOOP">QT_TRANSLATE_NOOP</a></td> -<td>Function to tell 'lupdate' which strings to keep for translation.</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, 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 variable (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="QT_TRANSLATE_NOOP" ID="QT_TRANSLATE_NOOP"></a> -<h2>QT_TRANSLATE_NOOP</h2> -<b>QT_TRANSLATE_NOOP</b>(<i>mod, txt</i>) -<p> - Function to tell 'lupdate' which strings to keep for translation. -</p><dl> -<dt><i>mod</i></dt> -<dd> -module name -</dd><dt><i>txt</i></dt> -<dd> -translatable string -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -the untranslated! string -</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.CodeStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.CodeStyleChecker</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.CodeStyleChecker</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="#CodeStyleReport">CodeStyleReport</a></td> -<td>Class implementing a special report to be used with our dialog.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="CodeStyleReport" ID="CodeStyleReport"></a> -<h2>CodeStyleReport</h2> -<p> - Class implementing a special report to be used with our dialog. -</p> -<h3>Derived from</h3> -pep8.BaseReport -<h3>Class Attributes</h3> -<table> -<tr><td>docType</td></tr><tr><td>filename</td></tr><tr><td>hang_closing</td></tr><tr><td>ignore</td></tr><tr><td>max_line_length</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="#CodeStyleReport.__init__">CodeStyleReport</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#CodeStyleReport.error_args">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="CodeStyleReport.__init__" ID="CodeStyleReport.__init__"></a> -<h4>CodeStyleReport (Constructor)</h4> -<b>CodeStyleReport</b>(<i>options</i>) -<p> - Constructor -</p><dl> -<dt><i>options</i></dt> -<dd> -options for the report (optparse.Values) -</dd> -</dl><a NAME="CodeStyleReport.error_args" ID="CodeStyleReport.error_args"></a> -<h4>CodeStyleReport.error_args</h4> -<b>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><dl> -<dt>Returns:</dt> -<dd> -error code (string) -</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.DocStyleCheckerPy2.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,912 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.DocStyleCheckerPy2</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.DocStyleCheckerPy2</h1> -<p> -Module implementing a checker for documentation string conventions. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#DocStyleChecker">DocStyleChecker</a></td> -<td>Class implementing a checker for documentation string conventions.</td> -</tr><tr> -<td><a href="#DocStyleContext">DocStyleContext</a></td> -<td>Class implementing the source context.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="DocStyleChecker" ID="DocStyleChecker"></a> -<h2>DocStyleChecker</h2> -<p> - Class implementing a checker for documentation string conventions. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>Codes</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#DocStyleChecker.__init__">DocStyleChecker</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkBackslashes">__checkBackslashes</a></td> -<td>Private method to check, that all docstrings containing backslashes are surrounded by raw triple double quotes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkBlankAfterLastParagraph">__checkBlankAfterLastParagraph</a></td> -<td>Private method to check, that the last paragraph of docstrings is followed by a blank line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkBlankAfterSummary">__checkBlankAfterSummary</a></td> -<td>Private method to check, that docstring summaries are followed by a blank line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkBlankBeforeAndAfterClass">__checkBlankBeforeAndAfterClass</a></td> -<td>Private method to check, that class docstrings have one blank line around them.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkClassDocstring">__checkClassDocstring</a></td> -<td>Private method to check, that all public functions and methods have a docstring.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEndsWithPeriod">__checkEndsWithPeriod</a></td> -<td>Private method to check, that docstring summaries end with a period.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricBlankAfterSummary">__checkEricBlankAfterSummary</a></td> -<td>Private method to check, that docstring summaries are followed by a blank line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricEndsWithPeriod">__checkEricEndsWithPeriod</a></td> -<td>Private method to check, that docstring summaries end with a period.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricException">__checkEricException</a></td> -<td>Private method to check, that docstrings contain an @exception line if they raise an exception and don't otherwise.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricFunctionArguments">__checkEricFunctionArguments</a></td> -<td>Private method to check, that docstrings contain an @param and/or @keyparam line for each argument.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricNBlankAfterLastParagraph">__checkEricNBlankAfterLastParagraph</a></td> -<td>Private method to check, that the last paragraph of docstrings is not followed by a blank line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction">__checkEricNoBlankBeforeAndAfterClassOrFunction</a></td> -<td>Private method to check, that class and function/method docstrings have no blank line around them.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricQuotesOnSeparateLines">__checkEricQuotesOnSeparateLines</a></td> -<td>Private method to check, that leading and trailing quotes are on a line by themselves.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkEricReturn">__checkEricReturn</a></td> -<td>Private method to check, that docstrings contain an @return line if they return anything and don't otherwise.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkFunctionDocstring">__checkFunctionDocstring</a></td> -<td>Private method to check, that all public functions and methods have a docstring.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkImperativeMood">__checkImperativeMood</a></td> -<td>Private method to check, that docstring summaries are in imperative mood.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkIndent">__checkIndent</a></td> -<td>Private method to check, that docstrings are properly indented.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkModulesDocstrings">__checkModulesDocstrings</a></td> -<td>Private method to check, if the module has a docstring.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkNoBlankLineBefore">__checkNoBlankLineBefore</a></td> -<td>Private method to check, that function/method docstrings are not preceded by a blank line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkNoSignature">__checkNoSignature</a></td> -<td>Private method to check, that docstring summaries don't repeat the function's signature.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkOneLiner">__checkOneLiner</a></td> -<td>Private method to check, that one-liner docstrings fit on one line with quotes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkReturnType">__checkReturnType</a></td> -<td>Private method to check, that docstrings mention the return value type.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkSummary">__checkSummary</a></td> -<td>Private method to check, that docstring summaries contain some text.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkTripleDoubleQuotes">__checkTripleDoubleQuotes</a></td> -<td>Private method to check, that all docstrings are surrounded by triple double quotes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__checkUnicode">__checkUnicode</a></td> -<td>Private method to check, that all docstrings containing unicode characters are surrounded by unicode triple double quotes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__error">__error</a></td> -<td>Private method to record an issue.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__getArgNames">__getArgNames</a></td> -<td></td> -</tr><tr> -<td><a href="#DocStyleChecker.__getSummaryLine">__getSummaryLine</a></td> -<td>Private method to extract the summary line.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__getSummaryLines">__getSummaryLines</a></td> -<td>Private method to extract the summary lines.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__ignoreCode">__ignoreCode</a></td> -<td>Private method to check if the error code should be ignored.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseClasses">__parseClasses</a></td> -<td>Private method to extract top-level classes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseContexts">__parseContexts</a></td> -<td>Private method to extract a context from the source.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseDocstring">__parseDocstring</a></td> -<td>Private method to extract a docstring given `def` or `class` source.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseFunctions">__parseFunctions</a></td> -<td>Private method to extract top-level functions.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseMethods">__parseMethods</a></td> -<td>Private method to extract methods of all classes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseModuleDocstring">__parseModuleDocstring</a></td> -<td>Private method to extract a docstring given a module source.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__parseTopLevel">__parseTopLevel</a></td> -<td>Private method to extract top-level functions or classes.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__readline">__readline</a></td> -<td>Private method to get the next line from the source.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__resetReadline">__resetReadline</a></td> -<td>Private method to reset the internal readline function.</td> -</tr><tr> -<td><a href="#DocStyleChecker.__skipIndentedBlock">__skipIndentedBlock</a></td> -<td>Private method to skip over an indented block of source code.</td> -</tr><tr> -<td><a href="#DocStyleChecker.run">run</a></td> -<td>Public method to check the given source for violations of doc string conventions.</td> -</tr><tr> -<td><a href="#DocStyleChecker.unpackArgs">unpackArgs</a></td> -<td>Local helper function to unpack function argument names.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DocStyleChecker.__init__" ID="DocStyleChecker.__init__"></a> -<h4>DocStyleChecker (Constructor)</h4> -<b>DocStyleChecker</b>(<i>source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257"</i>) -<p> - Constructor -</p><dl> -<dt><i>source</i></dt> -<dd> -source code to be checked (list of string) -</dd><dt><i>filename</i></dt> -<dd> -name of the source file (string) -</dd><dt><i>select</i></dt> -<dd> -list of selected codes (list of string) -</dd><dt><i>ignore</i></dt> -<dd> -list of codes to be ignored (list of string) -</dd><dt><i>expected</i></dt> -<dd> -list of expected codes (list of string) -</dd><dt><i>repeat</i></dt> -<dd> -flag indicating to report each occurrence of a code - (boolean) -</dd><dt><i>maxLineLength=</i></dt> -<dd> -allowed line length (integer) -</dd><dt><i>docType=</i></dt> -<dd> -type of the documentation strings - (string, one of 'eric' or 'pep257') -</dd> -</dl><a NAME="DocStyleChecker.__checkBackslashes" ID="DocStyleChecker.__checkBackslashes"></a> -<h4>DocStyleChecker.__checkBackslashes</h4> -<b>__checkBackslashes</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings containing - backslashes are surrounded by raw triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkBlankAfterLastParagraph" ID="DocStyleChecker.__checkBlankAfterLastParagraph"></a> -<h4>DocStyleChecker.__checkBlankAfterLastParagraph</h4> -<b>__checkBlankAfterLastParagraph</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that the last paragraph of docstrings is - followed by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkBlankAfterSummary" ID="DocStyleChecker.__checkBlankAfterSummary"></a> -<h4>DocStyleChecker.__checkBlankAfterSummary</h4> -<b>__checkBlankAfterSummary</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are followed - by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkBlankBeforeAndAfterClass" ID="DocStyleChecker.__checkBlankBeforeAndAfterClass"></a> -<h4>DocStyleChecker.__checkBlankBeforeAndAfterClass</h4> -<b>__checkBlankBeforeAndAfterClass</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that class docstrings have one - blank line around them. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkClassDocstring" ID="DocStyleChecker.__checkClassDocstring"></a> -<h4>DocStyleChecker.__checkClassDocstring</h4> -<b>__checkClassDocstring</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all public functions and methods - have a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEndsWithPeriod" ID="DocStyleChecker.__checkEndsWithPeriod"></a> -<h4>DocStyleChecker.__checkEndsWithPeriod</h4> -<b>__checkEndsWithPeriod</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries end with a period. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricBlankAfterSummary" ID="DocStyleChecker.__checkEricBlankAfterSummary"></a> -<h4>DocStyleChecker.__checkEricBlankAfterSummary</h4> -<b>__checkEricBlankAfterSummary</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are followed - by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricEndsWithPeriod" ID="DocStyleChecker.__checkEricEndsWithPeriod"></a> -<h4>DocStyleChecker.__checkEricEndsWithPeriod</h4> -<b>__checkEricEndsWithPeriod</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries end with a period. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricException" ID="DocStyleChecker.__checkEricException"></a> -<h4>DocStyleChecker.__checkEricException</h4> -<b>__checkEricException</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @exception line - if they raise an exception and don't otherwise. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricFunctionArguments" ID="DocStyleChecker.__checkEricFunctionArguments"></a> -<h4>DocStyleChecker.__checkEricFunctionArguments</h4> -<b>__checkEricFunctionArguments</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @param and/or - @keyparam line for each argument. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricNBlankAfterLastParagraph" ID="DocStyleChecker.__checkEricNBlankAfterLastParagraph"></a> -<h4>DocStyleChecker.__checkEricNBlankAfterLastParagraph</h4> -<b>__checkEricNBlankAfterLastParagraph</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that the last paragraph of docstrings is - not followed by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction" ID="DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction"></a> -<h4>DocStyleChecker.__checkEricNoBlankBeforeAndAfterClassOrFunction</h4> -<b>__checkEricNoBlankBeforeAndAfterClassOrFunction</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that class and function/method docstrings - have no blank line around them. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricQuotesOnSeparateLines" ID="DocStyleChecker.__checkEricQuotesOnSeparateLines"></a> -<h4>DocStyleChecker.__checkEricQuotesOnSeparateLines</h4> -<b>__checkEricQuotesOnSeparateLines</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that leading and trailing quotes are on - a line by themselves. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkEricReturn" ID="DocStyleChecker.__checkEricReturn"></a> -<h4>DocStyleChecker.__checkEricReturn</h4> -<b>__checkEricReturn</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings contain an @return line - if they return anything and don't otherwise. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkFunctionDocstring" ID="DocStyleChecker.__checkFunctionDocstring"></a> -<h4>DocStyleChecker.__checkFunctionDocstring</h4> -<b>__checkFunctionDocstring</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all public functions and methods - have a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkImperativeMood" ID="DocStyleChecker.__checkImperativeMood"></a> -<h4>DocStyleChecker.__checkImperativeMood</h4> -<b>__checkImperativeMood</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries are in - imperative mood. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkIndent" ID="DocStyleChecker.__checkIndent"></a> -<h4>DocStyleChecker.__checkIndent</h4> -<b>__checkIndent</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings are properly indented. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkModulesDocstrings" ID="DocStyleChecker.__checkModulesDocstrings"></a> -<h4>DocStyleChecker.__checkModulesDocstrings</h4> -<b>__checkModulesDocstrings</b>(<i>docstringContext, context</i>) -<p> - Private method to check, if the module has a docstring. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkNoBlankLineBefore" ID="DocStyleChecker.__checkNoBlankLineBefore"></a> -<h4>DocStyleChecker.__checkNoBlankLineBefore</h4> -<b>__checkNoBlankLineBefore</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that function/method docstrings are not - preceded by a blank line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkNoSignature" ID="DocStyleChecker.__checkNoSignature"></a> -<h4>DocStyleChecker.__checkNoSignature</h4> -<b>__checkNoSignature</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries don't repeat - the function's signature. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkOneLiner" ID="DocStyleChecker.__checkOneLiner"></a> -<h4>DocStyleChecker.__checkOneLiner</h4> -<b>__checkOneLiner</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that one-liner docstrings fit on - one line with quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkReturnType" ID="DocStyleChecker.__checkReturnType"></a> -<h4>DocStyleChecker.__checkReturnType</h4> -<b>__checkReturnType</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstrings mention the return value type. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkSummary" ID="DocStyleChecker.__checkSummary"></a> -<h4>DocStyleChecker.__checkSummary</h4> -<b>__checkSummary</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that docstring summaries contain some text. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkTripleDoubleQuotes" ID="DocStyleChecker.__checkTripleDoubleQuotes"></a> -<h4>DocStyleChecker.__checkTripleDoubleQuotes</h4> -<b>__checkTripleDoubleQuotes</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings are surrounded - by triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__checkUnicode" ID="DocStyleChecker.__checkUnicode"></a> -<h4>DocStyleChecker.__checkUnicode</h4> -<b>__checkUnicode</b>(<i>docstringContext, context</i>) -<p> - Private method to check, that all docstrings containing unicode - characters are surrounded by unicode triple double quotes. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd><dt><i>context</i></dt> -<dd> -context of the docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__error" ID="DocStyleChecker.__error"></a> -<h4>DocStyleChecker.__error</h4> -<b>__error</b>(<i>lineNumber, offset, code, *args</i>) -<p> - Private method to record an issue. -</p><dl> -<dt><i>lineNumber</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>args</i></dt> -<dd> -arguments for the message (list) -</dd> -</dl><a NAME="DocStyleChecker.__getArgNames" ID="DocStyleChecker.__getArgNames"></a> -<h4>DocStyleChecker.__getArgNames</h4> -<b>__getArgNames</b>(<i>node</i>) -<a NAME="DocStyleChecker.__getSummaryLine" ID="DocStyleChecker.__getSummaryLine"></a> -<h4>DocStyleChecker.__getSummaryLine</h4> -<b>__getSummaryLine</b>(<i>docstringContext</i>) -<p> - Private method to extract the summary line. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -summary line (string) and the line it was found on (integer) -</dd> -</dl><a NAME="DocStyleChecker.__getSummaryLines" ID="DocStyleChecker.__getSummaryLines"></a> -<h4>DocStyleChecker.__getSummaryLines</h4> -<b>__getSummaryLines</b>(<i>docstringContext</i>) -<p> - Private method to extract the summary lines. -</p><dl> -<dt><i>docstringContext</i></dt> -<dd> -docstring context (DocStyleContext) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -summary lines (list of string) and the line it was found on - (integer) -</dd> -</dl><a NAME="DocStyleChecker.__ignoreCode" ID="DocStyleChecker.__ignoreCode"></a> -<h4>DocStyleChecker.__ignoreCode</h4> -<b>__ignoreCode</b>(<i>code</i>) -<p> - Private method to check if the error code should be ignored. -</p><dl> -<dt><i>code</i></dt> -<dd> -message code to check for (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating to ignore the given code (boolean) -</dd> -</dl><a NAME="DocStyleChecker.__parseClasses" ID="DocStyleChecker.__parseClasses"></a> -<h4>DocStyleChecker.__parseClasses</h4> -<b>__parseClasses</b>(<i></i>) -<p> - Private method to extract top-level classes. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted class contexts (list of DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseContexts" ID="DocStyleChecker.__parseContexts"></a> -<h4>DocStyleChecker.__parseContexts</h4> -<b>__parseContexts</b>(<i>kind</i>) -<p> - Private method to extract a context from the source. -</p><dl> -<dt><i>kind</i></dt> -<dd> -kind of context to extract (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -requested contexts (list of DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseDocstring" ID="DocStyleChecker.__parseDocstring"></a> -<h4>DocStyleChecker.__parseDocstring</h4> -<b>__parseDocstring</b>(<i>context, what=''</i>) -<p> - Private method to extract a docstring given `def` or `class` source. -</p><dl> -<dt><i>context</i></dt> -<dd> -context data to get the docstring from (DocStyleContext) -</dd><dt><i>what</i></dt> -<dd> -string denoting what is being parsed (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -context of extracted docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseFunctions" ID="DocStyleChecker.__parseFunctions"></a> -<h4>DocStyleChecker.__parseFunctions</h4> -<b>__parseFunctions</b>(<i></i>) -<p> - Private method to extract top-level functions. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted function contexts (list of DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseMethods" ID="DocStyleChecker.__parseMethods"></a> -<h4>DocStyleChecker.__parseMethods</h4> -<b>__parseMethods</b>(<i></i>) -<p> - Private method to extract methods of all classes. -</p><dl> -<dt>Returns:</dt> -<dd> -extracted method contexts (list of DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseModuleDocstring" ID="DocStyleChecker.__parseModuleDocstring"></a> -<h4>DocStyleChecker.__parseModuleDocstring</h4> -<b>__parseModuleDocstring</b>(<i>source</i>) -<p> - Private method to extract a docstring given a module source. -</p><dl> -<dt><i>source</i></dt> -<dd> -source to parse (list of string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -context of extracted docstring (DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__parseTopLevel" ID="DocStyleChecker.__parseTopLevel"></a> -<h4>DocStyleChecker.__parseTopLevel</h4> -<b>__parseTopLevel</b>(<i>keyword</i>) -<p> - Private method to extract top-level functions or classes. -</p><dl> -<dt><i>keyword</i></dt> -<dd> -keyword signaling what to extract (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -extracted function or class contexts (list of DocStyleContext) -</dd> -</dl><a NAME="DocStyleChecker.__readline" ID="DocStyleChecker.__readline"></a> -<h4>DocStyleChecker.__readline</h4> -<b>__readline</b>(<i></i>) -<p> - Private method to get the next line from the source. -</p><dl> -<dt>Returns:</dt> -<dd> -next line of source (string) -</dd> -</dl><a NAME="DocStyleChecker.__resetReadline" ID="DocStyleChecker.__resetReadline"></a> -<h4>DocStyleChecker.__resetReadline</h4> -<b>__resetReadline</b>(<i></i>) -<p> - Private method to reset the internal readline function. -</p><a NAME="DocStyleChecker.__skipIndentedBlock" ID="DocStyleChecker.__skipIndentedBlock"></a> -<h4>DocStyleChecker.__skipIndentedBlock</h4> -<b>__skipIndentedBlock</b>(<i>tokenGenerator</i>) -<p> - Private method to skip over an indented block of source code. -</p><dl> -<dt><i>tokenGenerator</i></dt> -<dd> -token generator -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -last token of the indented block -</dd> -</dl><a NAME="DocStyleChecker.run" ID="DocStyleChecker.run"></a> -<h4>DocStyleChecker.run</h4> -<b>run</b>(<i></i>) -<p> - Public method to check the given source for violations of doc string - conventions. -</p><a NAME="DocStyleChecker.unpackArgs" ID="DocStyleChecker.unpackArgs"></a> -<h4>DocStyleChecker.unpackArgs</h4> -<b>unpackArgs</b>(<i></i>) -<p> - Local helper function to unpack function argument names. -</p><dl> -<dt><i>args</i></dt> -<dd> -list of AST node arguments -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="DocStyleContext" ID="DocStyleContext"></a> -<h2>DocStyleContext</h2> -<p> - Class implementing the source context. -</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="#DocStyleContext.__init__">DocStyleContext</a></td> -<td>Constructor</td> -</tr><tr> -<td><a href="#DocStyleContext.contextType">contextType</a></td> -<td>Public method to get the context type.</td> -</tr><tr> -<td><a href="#DocStyleContext.end">end</a></td> -<td>Public method to get the end line number.</td> -</tr><tr> -<td><a href="#DocStyleContext.indent">indent</a></td> -<td>Public method to get the indentation of the first line.</td> -</tr><tr> -<td><a href="#DocStyleContext.source">source</a></td> -<td>Public method to get the source.</td> -</tr><tr> -<td><a href="#DocStyleContext.ssource">ssource</a></td> -<td>Public method to get the joined source lines.</td> -</tr><tr> -<td><a href="#DocStyleContext.start">start</a></td> -<td>Public method to get the start line number.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DocStyleContext.__init__" ID="DocStyleContext.__init__"></a> -<h4>DocStyleContext (Constructor)</h4> -<b>DocStyleContext</b>(<i>source, startLine, contextType</i>) -<p> - Constructor -</p><dl> -<dt><i>source</i></dt> -<dd> -source code of the context (list of string or string) -</dd><dt><i>startLine</i></dt> -<dd> -line number the context starts in the source (integer) -</dd><dt><i>contextType</i></dt> -<dd> -type of the context object (string) -</dd> -</dl><a NAME="DocStyleContext.contextType" ID="DocStyleContext.contextType"></a> -<h4>DocStyleContext.contextType</h4> -<b>contextType</b>(<i></i>) -<p> - Public method to get the context type. -</p><dl> -<dt>Returns:</dt> -<dd> -context type (string) -</dd> -</dl><a NAME="DocStyleContext.end" ID="DocStyleContext.end"></a> -<h4>DocStyleContext.end</h4> -<b>end</b>(<i></i>) -<p> - Public method to get the end line number. -</p><dl> -<dt>Returns:</dt> -<dd> -end line number (integer) -</dd> -</dl><a NAME="DocStyleContext.indent" ID="DocStyleContext.indent"></a> -<h4>DocStyleContext.indent</h4> -<b>indent</b>(<i></i>) -<p> - Public method to get the indentation of the first line. -</p><dl> -<dt>Returns:</dt> -<dd> -indentation string (string) -</dd> -</dl><a NAME="DocStyleContext.source" ID="DocStyleContext.source"></a> -<h4>DocStyleContext.source</h4> -<b>source</b>(<i></i>) -<p> - Public method to get the source. -</p><dl> -<dt>Returns:</dt> -<dd> -source (list of string) -</dd> -</dl><a NAME="DocStyleContext.ssource" ID="DocStyleContext.ssource"></a> -<h4>DocStyleContext.ssource</h4> -<b>ssource</b>(<i></i>) -<p> - Public method to get the joined source lines. -</p><dl> -<dt>Returns:</dt> -<dd> -source (string) -</dd> -</dl><a NAME="DocStyleContext.start" ID="DocStyleContext.start"></a> -<h4>DocStyleContext.start</h4> -<b>start</b>(<i></i>) -<p> - Public method to get the start line number. -</p><dl> -<dt>Returns:</dt> -<dd> -start line number (integer) -</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.NamingStyleCheckerPy2.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,417 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.NamingStyleCheckerPy2</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.NamingStyleCheckerPy2</h1> -<p> -Module implementing a checker for naming conventions for Python2. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#NamingStyleChecker">NamingStyleChecker</a></td> -<td>Class implementing a checker for naming conventions for Python2.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr><td>None</td></tr> -</table> -<hr /><hr /> -<a NAME="NamingStyleChecker" ID="NamingStyleChecker"></a> -<h2>NamingStyleChecker</h2> -<p> - Class implementing a checker for naming conventions for Python2. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>CamelcaseRegexp</td></tr><tr><td>Codes</td></tr><tr><td>LowercaseRegex</td></tr><tr><td>MixedcaseRegexp</td></tr><tr><td>UppercaseRegexp</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#NamingStyleChecker.__init__">NamingStyleChecker</a></td> -<td>Constructor (according to 'extended' pep8.py API)</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkClassName">__checkClassName</a></td> -<td>Private class to check the given node for class name conventions (N801).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkFunctionArgumentNames">__checkFunctionArgumentNames</a></td> -<td>Private class to check the argument names of functions (N803, N804, N805, N806).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkFuntionName">__checkFuntionName</a></td> -<td>Private class to check the given node for function name conventions (N802).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkImportAs">__checkImportAs</a></td> -<td>Private method to check that imports don't change the naming convention (N811, N812, N813, N814).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkModule">__checkModule</a></td> -<td>Private method to check module naming conventions (N807, N808).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkNameToBeAvoided">__checkNameToBeAvoided</a></td> -<td>Private class to check the given node for a name to be avoided (N831).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__checkVariablesInFunction">__checkVariablesInFunction</a></td> -<td>Private method to check local variables in functions (N821).</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__error">__error</a></td> -<td>Private method to build the error information.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__findGlobalDefs">__findGlobalDefs</a></td> -<td>Private method amend a node with global definitions information.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__getArgNames">__getArgNames</a></td> -<td>Private method to get the argument names of a function node.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__isNameToBeAvoided">__isNameToBeAvoided</a></td> -<td>Private method to check, if the given name should be avoided.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__tagClassFunctions">__tagClassFunctions</a></td> -<td>Private method to tag functions if they are methods, class methods or static methods.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__visitNode">__visitNode</a></td> -<td>Private method to inspect the given AST node.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.__visitTree">__visitTree</a></td> -<td>Private method to scan the given AST tree.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.run">run</a></td> -<td>Public method run by the pep8.py checker.</td> -</tr><tr> -<td><a href="#NamingStyleChecker.unpackArgs">unpackArgs</a></td> -<td>Local helper function to unpack function argument names.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="NamingStyleChecker.__init__" ID="NamingStyleChecker.__init__"></a> -<h4>NamingStyleChecker (Constructor)</h4> -<b>NamingStyleChecker</b>(<i>tree, filename, options</i>) -<p> - Constructor (according to 'extended' pep8.py API) -</p><dl> -<dt><i>tree</i></dt> -<dd> -AST tree of the source file -</dd><dt><i>filename</i></dt> -<dd> -name of the source file (string) -</dd><dt><i>options</i></dt> -<dd> -options as parsed by pep8.StyleGuide -</dd> -</dl><a NAME="NamingStyleChecker.__checkClassName" ID="NamingStyleChecker.__checkClassName"></a> -<h4>NamingStyleChecker.__checkClassName</h4> -<b>__checkClassName</b>(<i>node, parents</i>) -<p> - Private class to check the given node for class name - conventions (N801). -</p><p> - Almost without exception, class names use the CapWords convention. - Classes for internal use have a leading underscore in addition. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkFunctionArgumentNames" ID="NamingStyleChecker.__checkFunctionArgumentNames"></a> -<h4>NamingStyleChecker.__checkFunctionArgumentNames</h4> -<b>__checkFunctionArgumentNames</b>(<i>node, parents</i>) -<p> - Private class to check the argument names of functions - (N803, N804, N805, N806). -</p><p> - The argument names of a function should be lowercase, with words - separated by underscores. A class method should have 'cls' as the - first argument. A method should have 'self' as the first argument. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkFuntionName" ID="NamingStyleChecker.__checkFuntionName"></a> -<h4>NamingStyleChecker.__checkFuntionName</h4> -<b>__checkFuntionName</b>(<i>node, parents</i>) -<p> - Private class to check the given node for function name - conventions (N802). -</p><p> - Function names should be lowercase, with words separated by underscores - as necessary to improve readability. Functions <b>not</b> being - methods '__' in front and back are not allowed. Mixed case is allowed - only in contexts where that's already the prevailing style - (e.g. threading.py), to retain backwards compatibility. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkImportAs" ID="NamingStyleChecker.__checkImportAs"></a> -<h4>NamingStyleChecker.__checkImportAs</h4> -<b>__checkImportAs</b>(<i>node, parents</i>) -<p> - Private method to check that imports don't change the - naming convention (N811, N812, N813, N814). -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkModule" ID="NamingStyleChecker.__checkModule"></a> -<h4>NamingStyleChecker.__checkModule</h4> -<b>__checkModule</b>(<i>node, parents</i>) -<p> - Private method to check module naming conventions (N807, N808). -</p><p> - Module and package names should be lowercase. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkNameToBeAvoided" ID="NamingStyleChecker.__checkNameToBeAvoided"></a> -<h4>NamingStyleChecker.__checkNameToBeAvoided</h4> -<b>__checkNameToBeAvoided</b>(<i>node, parents</i>) -<p> - Private class to check the given node for a name to be avoided (N831). -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__checkVariablesInFunction" ID="NamingStyleChecker.__checkVariablesInFunction"></a> -<h4>NamingStyleChecker.__checkVariablesInFunction</h4> -<b>__checkVariablesInFunction</b>(<i>node, parents</i>) -<p> - Private method to check local variables in functions (N821). -</p><p> - Local variables in functions should be lowercase. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST note to check -</dd><dt><i>parents</i></dt> -<dd> -list of parent nodes -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__error" ID="NamingStyleChecker.__error"></a> -<h4>NamingStyleChecker.__error</h4> -<b>__error</b>(<i>node, code</i>) -<p> - Private method to build the error information. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST node to report an error for -</dd><dt><i>code</i></dt> -<dd> -error code to report (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line and error code - (integer, integer, string) -</dd> -</dl><a NAME="NamingStyleChecker.__findGlobalDefs" ID="NamingStyleChecker.__findGlobalDefs"></a> -<h4>NamingStyleChecker.__findGlobalDefs</h4> -<b>__findGlobalDefs</b>(<i>functionNode</i>) -<p> - Private method amend a node with global definitions information. -</p><dl> -<dt><i>functionNode</i></dt> -<dd> -AST tree node to amend -</dd> -</dl><a NAME="NamingStyleChecker.__getArgNames" ID="NamingStyleChecker.__getArgNames"></a> -<h4>NamingStyleChecker.__getArgNames</h4> -<b>__getArgNames</b>(<i>node</i>) -<p> - Private method to get the argument names of a function node. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST node to extract arguments names from -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</dd> -</dl><a NAME="NamingStyleChecker.__isNameToBeAvoided" ID="NamingStyleChecker.__isNameToBeAvoided"></a> -<h4>NamingStyleChecker.__isNameToBeAvoided</h4> -<b>__isNameToBeAvoided</b>(<i>name</i>) -<p> - Private method to check, if the given name should be avoided. -</p><dl> -<dt><i>name</i></dt> -<dd> -name to be checked (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -flag indicating to avoid it (boolen) -</dd> -</dl><a NAME="NamingStyleChecker.__tagClassFunctions" ID="NamingStyleChecker.__tagClassFunctions"></a> -<h4>NamingStyleChecker.__tagClassFunctions</h4> -<b>__tagClassFunctions</b>(<i>classNode</i>) -<p> - Private method to tag functions if they are methods, class methods or - static methods. -</p><dl> -<dt><i>classNode</i></dt> -<dd> -AST tree node to tag -</dd> -</dl><a NAME="NamingStyleChecker.__visitNode" ID="NamingStyleChecker.__visitNode"></a> -<h4>NamingStyleChecker.__visitNode</h4> -<b>__visitNode</b>(<i>node</i>) -<p> - Private method to inspect the given AST node. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST tree node to inspect -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="NamingStyleChecker.__visitTree" ID="NamingStyleChecker.__visitTree"></a> -<h4>NamingStyleChecker.__visitTree</h4> -<b>__visitTree</b>(<i>node</i>) -<p> - Private method to scan the given AST tree. -</p><dl> -<dt><i>node</i></dt> -<dd> -AST tree node to scan -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="NamingStyleChecker.run" ID="NamingStyleChecker.run"></a> -<h4>NamingStyleChecker.run</h4> -<b>run</b>(<i></i>) -<p> - Public method run by the pep8.py checker. -</p><dl> -<dt>Returns:</dt> -<dd> -tuple giving line number, offset within line, code and - checker function -</dd> -</dl><a NAME="NamingStyleChecker.unpackArgs" ID="NamingStyleChecker.unpackArgs"></a> -<h4>NamingStyleChecker.unpackArgs</h4> -<b>unpackArgs</b>(<i></i>) -<p> - Local helper function to unpack function argument names. -</p><dl> -<dt><i>args</i></dt> -<dd> -list of AST node arguments -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list of argument names (list of string) -</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.Tools.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2.Tools</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.Tools</h1> -<p> -Module implementing tool functions. -</p> -<h3>Global Attributes</h3> -<table> -<tr><td>coding_regexps</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#decode">decode</a></td> -<td>Function to decode a text.</td> -</tr><tr> -<td><a href="#extractLineFlags">extractLineFlags</a></td> -<td>Function to extract flags starting and ending with '__' from a line comment.</td> -</tr><tr> -<td><a href="#get_coding">get_coding</a></td> -<td>Function to get the coding of a text.</td> -</tr><tr> -<td><a href="#normalizeCode">normalizeCode</a></td> -<td>Function to normalize the given code.</td> -</tr><tr> -<td><a href="#readEncodedFile">readEncodedFile</a></td> -<td>Function to read a file and decode its contents into proper text.</td> -</tr> -</table> -<hr /><hr /> -<a NAME="decode" ID="decode"></a> -<h2>decode</h2> -<b>decode</b>(<i>text</i>) -<p> - Function to decode a text. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to decode (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -decoded text and encoding -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="extractLineFlags" ID="extractLineFlags"></a> -<h2>extractLineFlags</h2> -<b>extractLineFlags</b>(<i>line, startComment="</i>) -<p> - Function to extract flags starting and ending with '__' from a line - comment. -</p><dl> -<dt><i>line</i></dt> -<dd> -line to extract flags from (string) -</dd><dt><i>startComment=</i></dt> -<dd> -string identifying the start of the comment (string) -</dd><dt><i>endComment=</i></dt> -<dd> -string identifying the end of a comment (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -list containing the extracted flags (list of strings) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_coding" ID="get_coding"></a> -<h2>get_coding</h2> -<b>get_coding</b>(<i>text</i>) -<p> - Function to get the coding of a text. -</p><dl> -<dt><i>text</i></dt> -<dd> -text to inspect (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -coding string -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="normalizeCode" ID="normalizeCode"></a> -<h2>normalizeCode</h2> -<b>normalizeCode</b>(<i>codestring</i>) -<p> - Function to normalize the given code. -</p><dl> -<dt><i>codestring</i></dt> -<dd> -code to be normalized (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -normalized code (string) -</dd> -</dl> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="readEncodedFile" ID="readEncodedFile"></a> -<h2>readEncodedFile</h2> -<b>readEncodedFile</b>(<i>filename</i>) -<p> - Function to read a file and decode its contents into proper text. -</p><dl> -<dt><i>filename</i></dt> -<dd> -name of the file to read (string) -</dd> -</dl><dl> -<dt>Returns:</dt> -<dd> -tuple of decoded text and encoding (string, string) -</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 Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1258 +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>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_SINGLETON_REGEX</td></tr><tr><td>COMPARE_TYPE_REGEX</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>HUNK_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>KEYWORDS</td></tr><tr><td>KEYWORD_REGEX</td></tr><tr><td>LAMBDA_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</td></tr><tr><td>PyCF_ONLY_AST</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>REPORT_FORMAT</td></tr><tr><td>RERAISE_COMMA_REGEX</td></tr><tr><td>SINGLETONS</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>TESTSUITE_PATH</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AFTER_COMMA_REGEX</td></tr><tr><td>WS_NEEDED_OPERATORS</td></tr><tr><td>WS_OPTIONAL_OPERATORS</td></tr><tr><td>__version__</td></tr><tr><td>_checks</td></tr><tr><td>noqa</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#BaseReport">BaseReport</a></td> -<td>Collect the results of the checks.</td> -</tr><tr> -<td><a href="#Checker">Checker</a></td> -<td>Load a Python source file, tokenize it, check coding style.</td> -</tr><tr> -<td><a href="#DiffReport">DiffReport</a></td> -<td>Collect and print the results for the changed lines only.</td> -</tr><tr> -<td><a href="#FileReport">FileReport</a></td> -<td>Collect the results of the checks and print only the filenames.</td> -</tr><tr> -<td><a href="#StandardReport">StandardReport</a></td> -<td>Collect and print the results of the checks.</td> -</tr><tr> -<td><a href="#StyleGuide">StyleGuide</a></td> -<td>Initialize a PEP-8 instance with few options.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#_add_check">_add_check</a></td> -<td></td> -</tr><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>Separate top-level function and class definitions with two blank lines.</td> -</tr><tr> -<td><a href="#comparison_to_singleton">comparison_to_singleton</a></td> -<td>Comparisons to singletons like None should always be done with "is" or "is not", never the equality operators.</td> -</tr><tr> -<td><a href="#comparison_type">comparison_type</a></td> -<td>Object type comparisons should always use isinstance() instead of comparing types directly.</td> -</tr><tr> -<td><a href="#compound_statements">compound_statements</a></td> -<td>Compound statements (multiple statements on the same line) are generally discouraged.</td> -</tr><tr> -<td><a href="#continued_indentation">continued_indentation</a></td> -<td>Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent.</td> -</tr><tr> -<td><a href="#expand_indent">expand_indent</a></td> -<td>Return the amount of indentation.</td> -</tr><tr> -<td><a href="#explicit_line_join">explicit_line_join</a></td> -<td>Avoid explicit line join between brackets.</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 patterns contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#get_parser">get_parser</a></td> -<td></td> -</tr><tr> -<td><a href="#imports_on_separate_lines">imports_on_separate_lines</a></td> -<td>Imports should usually be on separate lines.</td> -</tr><tr> -<td><a href="#indentation">indentation</a></td> -<td>Use 4 spaces per indentation level.</td> -</tr><tr> -<td><a href="#init_checks_registry">init_checks_registry</a></td> -<td>Register all globally visible functions where the first argument name is 'physical_line' or 'logical_line'.</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="#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>- 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).</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="#parse_udiff">parse_udiff</a></td> -<td>Return a dictionary of matching lines.</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 3.</td> -</tr><tr> -<td><a href="#python_3000_has_key">python_3000_has_key</a></td> -<td>The {}.has_key() method is removed in the Python 3.</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="#read_config">read_config</a></td> -<td>Read both user configuration and local configuration.</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="#register_check">register_check</a></td> -<td>Register a new check object.</td> -</tr><tr> -<td><a href="#stdin_get_value">stdin_get_value</a></td> -<td></td> -</tr><tr> -<td><a href="#tabs_obsolete">tabs_obsolete</a></td> -<td>For new projects, spaces-only are strongly recommended over tabs.</td> -</tr><tr> -<td><a href="#tabs_or_spaces">tabs_or_spaces</a></td> -<td>Never mix tabs and spaces.</td> -</tr><tr> -<td><a href="#trailing_blank_lines">trailing_blank_lines</a></td> -<td>JCR: Trailing blank lines are superfluous.</td> -</tr><tr> -<td><a href="#trailing_whitespace">trailing_whitespace</a></td> -<td>JCR: Trailing whitespace is superfluous.</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_keywords">whitespace_around_keywords</a></td> -<td>Avoid extraneous whitespace around keywords.</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="BaseReport" ID="BaseReport"></a> -<h2>BaseReport</h2> -<p> -Collect the results of the checks. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#BaseReport.__init__">BaseReport</a></td> -<td></td> -</tr><tr> -<td><a href="#BaseReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.get_count">get_count</a></td> -<td>Return the total count of errors and warnings.</td> -</tr><tr> -<td><a href="#BaseReport.get_file_results">get_file_results</a></td> -<td>Return the count of errors and warnings for this file.</td> -</tr><tr> -<td><a href="#BaseReport.get_statistics">get_statistics</a></td> -<td>Get statistics for message codes that start with the prefix.</td> -</tr><tr> -<td><a href="#BaseReport.increment_logical_line">increment_logical_line</a></td> -<td>Signal a new logical line.</td> -</tr><tr> -<td><a href="#BaseReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr><tr> -<td><a href="#BaseReport.print_benchmark">print_benchmark</a></td> -<td>Print benchmark numbers.</td> -</tr><tr> -<td><a href="#BaseReport.print_statistics">print_statistics</a></td> -<td>Print overall statistics (number of errors and warnings).</td> -</tr><tr> -<td><a href="#BaseReport.start">start</a></td> -<td>Start the timer.</td> -</tr><tr> -<td><a href="#BaseReport.stop">stop</a></td> -<td>Stop the timer.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="BaseReport.__init__" ID="BaseReport.__init__"></a> -<h4>BaseReport (Constructor)</h4> -<b>BaseReport</b>(<i>options</i>) -<a NAME="BaseReport.error" ID="BaseReport.error"></a> -<h4>BaseReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.error_args" ID="BaseReport.error_args"></a> -<h4>BaseReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.get_count" ID="BaseReport.get_count"></a> -<h4>BaseReport.get_count</h4> -<b>get_count</b>(<i>prefix=''</i>) -<p> -Return the total count of errors and warnings. -</p><a NAME="BaseReport.get_file_results" ID="BaseReport.get_file_results"></a> -<h4>BaseReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Return the count of errors and warnings for this file. -</p><a NAME="BaseReport.get_statistics" ID="BaseReport.get_statistics"></a> -<h4>BaseReport.get_statistics</h4> -<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><a NAME="BaseReport.increment_logical_line" ID="BaseReport.increment_logical_line"></a> -<h4>BaseReport.increment_logical_line</h4> -<b>increment_logical_line</b>(<i></i>) -<p> -Signal a new logical line. -</p><a NAME="BaseReport.init_file" ID="BaseReport.init_file"></a> -<h4>BaseReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p><a NAME="BaseReport.print_benchmark" ID="BaseReport.print_benchmark"></a> -<h4>BaseReport.print_benchmark</h4> -<b>print_benchmark</b>(<i></i>) -<p> -Print benchmark numbers. -</p><a NAME="BaseReport.print_statistics" ID="BaseReport.print_statistics"></a> -<h4>BaseReport.print_statistics</h4> -<b>print_statistics</b>(<i>prefix=''</i>) -<p> -Print overall statistics (number of errors and warnings). -</p><a NAME="BaseReport.start" ID="BaseReport.start"></a> -<h4>BaseReport.start</h4> -<b>start</b>(<i></i>) -<p> -Start the timer. -</p><a NAME="BaseReport.stop" ID="BaseReport.stop"></a> -<h4>BaseReport.stop</h4> -<b>stop</b>(<i></i>) -<p> -Stop the timer. -</p> -<div align="right"><a href="#top">Up</a></div> -<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_ast">check_ast</a></td> -<td></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.generate_tokens">generate_tokens</a></td> -<td></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_invalid_syntax">report_invalid_syntax</a></td> -<td></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=None, lines=None, options=None, report=None, **kwargs</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_ast" ID="Checker.check_ast"></a> -<h4>Checker.check_ast</h4> -<b>check_ast</b>(<i></i>) -<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.generate_tokens" ID="Checker.generate_tokens"></a> -<h4>Checker.generate_tokens</h4> -<b>generate_tokens</b>(<i></i>) -<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_invalid_syntax" ID="Checker.report_invalid_syntax"></a> -<h4>Checker.report_invalid_syntax</h4> -<b>report_invalid_syntax</b>(<i></i>) -<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="DiffReport" ID="DiffReport"></a> -<h2>DiffReport</h2> -<p> -Collect and print the results for the changed lines only. -</p> -<h3>Derived from</h3> -StandardReport -<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="#DiffReport.__init__">DiffReport</a></td> -<td></td> -</tr><tr> -<td><a href="#DiffReport.error">error</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DiffReport.__init__" ID="DiffReport.__init__"></a> -<h4>DiffReport (Constructor)</h4> -<b>DiffReport</b>(<i>options</i>) -<a NAME="DiffReport.error" ID="DiffReport.error"></a> -<h4>DiffReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="FileReport" ID="FileReport"></a> -<h2>FileReport</h2> -<p> -Collect the results of the checks and print only the filenames. -</p> -<h3>Derived from</h3> -BaseReport -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</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="StandardReport" ID="StandardReport"></a> -<h2>StandardReport</h2> -<p> -Collect and print the results of the checks. -</p> -<h3>Derived from</h3> -BaseReport -<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="#StandardReport.__init__">StandardReport</a></td> -<td></td> -</tr><tr> -<td><a href="#StandardReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.get_file_results">get_file_results</a></td> -<td>Print the result and return the overall count for this file.</td> -</tr><tr> -<td><a href="#StandardReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StandardReport.__init__" ID="StandardReport.__init__"></a> -<h4>StandardReport (Constructor)</h4> -<b>StandardReport</b>(<i>options</i>) -<a NAME="StandardReport.error" ID="StandardReport.error"></a> -<h4>StandardReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.error_args" ID="StandardReport.error_args"></a> -<h4>StandardReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.get_file_results" ID="StandardReport.get_file_results"></a> -<h4>StandardReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Print the result and return the overall count for this file. -</p><a NAME="StandardReport.init_file" ID="StandardReport.init_file"></a> -<h4>StandardReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="StyleGuide" ID="StyleGuide"></a> -<h2>StyleGuide</h2> -<p> -Initialize a PEP-8 instance with few options. -</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="#StyleGuide.__init__">StyleGuide</a></td> -<td></td> -</tr><tr> -<td><a href="#StyleGuide.check_files">check_files</a></td> -<td>Run all checks on the paths.</td> -</tr><tr> -<td><a href="#StyleGuide.excluded">excluded</a></td> -<td>Check if options.exclude contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#StyleGuide.get_checks">get_checks</a></td> -<td>Find all globally visible functions where the first argument name starts with argument_name and which contain selected tests.</td> -</tr><tr> -<td><a href="#StyleGuide.ignore_code">ignore_code</a></td> -<td>Check if the error code should be ignored.</td> -</tr><tr> -<td><a href="#StyleGuide.init_report">init_report</a></td> -<td>Initialize the report instance.</td> -</tr><tr> -<td><a href="#StyleGuide.input_dir">input_dir</a></td> -<td>Check all files in this directory and all subdirectories.</td> -</tr><tr> -<td><a href="#StyleGuide.input_file">input_file</a></td> -<td>Run all checks on a Python source file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StyleGuide.__init__" ID="StyleGuide.__init__"></a> -<h4>StyleGuide (Constructor)</h4> -<b>StyleGuide</b>(<i>*args, **kwargs</i>) -<a NAME="StyleGuide.check_files" ID="StyleGuide.check_files"></a> -<h4>StyleGuide.check_files</h4> -<b>check_files</b>(<i>paths=None</i>) -<p> -Run all checks on the paths. -</p><a NAME="StyleGuide.excluded" ID="StyleGuide.excluded"></a> -<h4>StyleGuide.excluded</h4> -<b>excluded</b>(<i>filename, parent=None</i>) -<p> - Check if options.exclude contains a pattern that matches filename. -</p><a NAME="StyleGuide.get_checks" ID="StyleGuide.get_checks"></a> -<h4>StyleGuide.get_checks</h4> -<b>get_checks</b>(<i>argument_name</i>) -<p> - Find all globally visible functions where the first argument name - starts with argument_name and which contain selected tests. -</p><a NAME="StyleGuide.ignore_code" ID="StyleGuide.ignore_code"></a> -<h4>StyleGuide.ignore_code</h4> -<b>ignore_code</b>(<i>code</i>) -<p> - Check if the error code should be ignored. -</p><p> - If 'options.select' contains a prefix of the error code, - return False. Else, if 'options.ignore' contains a prefix of - the error code, return True. -</p><a NAME="StyleGuide.init_report" ID="StyleGuide.init_report"></a> -<h4>StyleGuide.init_report</h4> -<b>init_report</b>(<i>reporter=None</i>) -<p> -Initialize the report instance. -</p><a NAME="StyleGuide.input_dir" ID="StyleGuide.input_dir"></a> -<h4>StyleGuide.input_dir</h4> -<b>input_dir</b>(<i>dirname</i>) -<p> -Check all files in this directory and all subdirectories. -</p><a NAME="StyleGuide.input_file" ID="StyleGuide.input_file"></a> -<h4>StyleGuide.input_file</h4> -<b>input_file</b>(<i>filename, lines=None, expected=None, line_offset=0</i>) -<p> -Run all checks on a Python source file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="_add_check" ID="_add_check"></a> -<h2>_add_check</h2> -<b>_add_check</b>(<i>check, kind, codes, args</i>) - -<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</i>) -<p> - Separate top-level function and class definitions with two blank lines. -</p><p> - Method definitions inside a class are separated by a single blank line. -</p><p> - 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). -</p><p> - Use blank lines in functions, sparingly, to indicate logical sections. -</p><p> - 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 -</p><p> - 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 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_to_singleton" ID="comparison_to_singleton"></a> -<h2>comparison_to_singleton</h2> -<b>comparison_to_singleton</b>(<i>logical_line, noqa</i>) -<p> - Comparisons to singletons like None should always be done - with "is" or "is not", never the equality operators. -</p><p> - Okay: if arg is not None: - E711: if arg != None: - E712: if arg == True: -</p><p> - Also, beware of writing if x when you really mean if x is not None -- - e.g. when testing whether a variable or argument that defaults to None was - set to some other value. The other value might have a type (such as a - container) that could be false in a boolean context! -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_type" ID="comparison_type"></a> -<h2>comparison_type</h2> -<b>comparison_type</b>(<i>logical_line</i>) -<p> - Object type comparisons should always use isinstance() instead of - comparing types directly. -</p><p> - Okay: if isinstance(obj, int): - E721: if type(obj) is type(1): -</p><p> - When checking if an object is a string, keep in mind that it might be a - unicode string too! In Python 2.3, str and unicode have a common base - class, basestring, so you can do: -</p><p> - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): -</p> -<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>) -<p> - Compound statements (multiple statements on the same line) are - generally discouraged. -</p><p> - 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! -</p><p> - Okay: if foo == 'blah':\n do_blah_thing() - Okay: do_one() - Okay: do_two() - Okay: do_three() -</p><p> - 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() -</p><p> - E702: do_one(); do_two(); do_three() - E703: do_four(); # useless semicolon -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="continued_indentation" ID="continued_indentation"></a> -<h2>continued_indentation</h2> -<b>continued_indentation</b>(<i>logical_line, tokens, indent_level, hang_closing, noqa, verbose</i>) -<p> - Continuation lines should align wrapped elements either vertically using - Python's implicit line joining inside parentheses, brackets and braces, or - using a hanging indent. -</p><p> - When using a hanging indent the following considerations should be applied: -</p><p> - - there should be no arguments on the first line, and -</p><p> - - further indentation should be used to clearly distinguish itself as a - continuation line. -</p><p> - Okay: a = (\n) - E123: a = (\n ) -</p><p> - Okay: a = (\n 42) - E121: a = (\n 42) - E122: a = (\n42) - E123: a = (\n 42\n ) - E124: a = (24,\n 42\n) - E125: if (a or\n b):\n pass - E126: a = (\n 42) - E127: a = (24,\n 42) - E128: a = (24,\n 42) -</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="explicit_line_join" ID="explicit_line_join"></a> -<h2>explicit_line_join</h2> -<b>explicit_line_join</b>(<i>logical_line, tokens</i>) -<p> - Avoid explicit line join between brackets. -</p><p> - The preferred way of wrapping long lines is by using Python's implied line - continuation inside parentheses, brackets and braces. Long lines can be - broken over multiple lines by wrapping expressions in parentheses. These - should be used in preference to using a backslash for line continuation. -</p><p> - E502: aaa = [123, \\n 123] - E502: aaa = ("bbb " \\n "ccc") -</p><p> - Okay: aaa = [123,\n 123] - Okay: aaa = ("bbb "\n "ccc") - Okay: aaa = "bbb " \\n "ccc" -</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, patterns, default=True</i>) -<p> - Check if patterns contains a pattern that matches filename. - If patterns is unspecified, this always returns True. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_parser" ID="get_parser"></a> -<h2>get_parser</h2> -<b>get_parser</b>(<i>prog='pep8', version=__version__</i>) - -<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>) -<p> - Imports should usually be on separate lines. -</p><p> - Okay: import os\nimport sys - E401: import sys, os -</p><p> - 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 -</p> -<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>) -<p> - Use 4 spaces per indentation level. -</p><p> - For really old code that you don't want to mess up, you can continue to - use 8-space tabs. -</p><p> - Okay: a = 1 - Okay: if a == 0:\n a = 1 - E111: a = 1 -</p><p> - Okay: for item in items:\n pass - E112: for item in items:\npass -</p><p> - Okay: a = 1\nb = 2 - E113: a = 1\n b = 2 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="init_checks_registry" ID="init_checks_registry"></a> -<h2>init_checks_registry</h2> -<b>init_checks_registry</b>(<i></i>) -<p> - Register all globally visible functions where the first argument name - is 'physical_line' or 'logical_line'. -</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, max_line_length</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><p> - Reports error E501. -</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><p> - Reports warning W292. -</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) - E231: [{'a':'b'}] -</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>) -<p> - - 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). -</p><p> - - Use spaces around arithmetic operators. -</p><p> - 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: alpha[:-i] -</p><p> - E225: i=i+1 - E225: submitted +=1 - E225: x = x /2 - 1 - E225: z = x **y - E226: c = (a+b) * (a-b) - E226: hypot2 = x*x + y*y - E227: c = a|b - E228: msg = fmt%(errno, errmsg) -</p> -<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="parse_udiff" ID="parse_udiff"></a> -<h2>parse_udiff</h2> -<b>parse_udiff</b>(<i>diff, patterns=None, parent='.'</i>) -<p> -Return a dictionary of matching lines. -</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, parse_argv=False, config_file=None, parser=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 3. - Use repr() instead. -</p><p> - Okay: val = repr(1 + 2) - W604: val = `1 + 2` -</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 is removed in the Python 3. - Use the 'in' operation instead. -</p><p> - Okay: if "alph" in d:\n print d["alph"] - W601: assert d.has_key('alph') -</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 3. -</p><p> - Okay: if a != 'no': - W603: if a <> 'no': -</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 is removed in Python 3. -</p><p> - Okay: raise DummyError("Message") - W602: raise DummyError, "Message" -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="read_config" ID="read_config"></a> -<h2>read_config</h2> -<b>read_config</b>(<i>options, args, arglist, parser</i>) -<p> -Read both user configuration and local configuration. -</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="register_check" ID="register_check"></a> -<h2>register_check</h2> -<b>register_check</b>(<i>check, codes=None</i>) -<p> - Register a new check object. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="stdin_get_value" ID="stdin_get_value"></a> -<h2>stdin_get_value</h2> -<b>stdin_get_value</b>(<i></i>) - -<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>) -<p> - For new projects, spaces-only are strongly recommended over tabs. Most - editors have features that make this easy to do. -</p><p> - Okay: if True:\n return - W191: if True:\n\treturn -</p> -<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>) -<p> - Never mix tabs and spaces. -</p><p> - 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! -</p><p> - Okay: if a == 0:\n a = 1\n b = 1 - E101: if a == 0:\n a = 1\n\tb = 1 -</p> -<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>) -<p> - JCR: Trailing blank lines are superfluous. -</p><p> - Okay: spam(1) - W391: spam(1)\n -</p> -<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>) -<p> - 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. -</p><p> - [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines -</p><p> - The warning returned varies on whether the line itself is blank, for easier - filtering for those who want to indent their blank lines. -</p><p> - Okay: spam(1)\n# - W291: spam(1) \n# - W293: class Foo(object):\n \n bang = 12 -</p> -<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_keywords" ID="whitespace_around_keywords"></a> -<h2>whitespace_around_keywords</h2> -<b>whitespace_around_keywords</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace around keywords. -</p><p> - Okay: True and False - E271: True and False - E272: True and False - E273: True and\tFalse - E274: True\tand False -</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, tokens</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/index-eric5.Plugins.CheckerPlugins.CodeStyleChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/index-eric5.Plugins.CheckerPlugins.CodeStyleChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -51,6 +51,9 @@ </tr><tr> <td><a href="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html">pep8</a></td> <td></td> +</tr><tr> +<td><a href="eric5.Plugins.CheckerPlugins.CodeStyleChecker.translations.html">translations</a></td> +<td>Module implementing message translations for the code style plugin messages.</td> </tr> </table> </body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.Plugins.CheckerPlugins.SyntaxChecker.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/index-eric5.Plugins.CheckerPlugins.SyntaxChecker.html Sun Mar 30 22:00:14 2014 +0200 @@ -24,10 +24,23 @@ Package containing the Syntax Checker plugin. </p> +<h3>Packages</h3> +<table> +<tr> +<td><a href="index-eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.html">pyflakes</a></td> +<td>Package containg pyflakes adapted for Qt.</td> +</tr> +</table> <h3>Modules</h3> <table> <tr> +<td><a href="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html">SyntaxCheck</a></td> +<td>Module implementing the syntax check for Python 2/3.</td> +</tr><tr> +<td><a href="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html">SyntaxCheckService</a></td> +<td>Module implementing an interface to add different languages to do a syntax check.</td> +</tr><tr> <td><a href="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog.html">SyntaxCheckerDialog</a></td> <td>Module implementing a simple Python syntax checker.</td> </tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/index-eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.html Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<html><head> +<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes</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.Plugins.CheckerPlugins.SyntaxChecker.pyflakes</h1> +<p> +Package containg pyflakes adapted for Qt. +</p> + + +<h3>Modules</h3> +<table> +<tr> +<td><a href="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.checker.html">checker</a></td> +<td>Main module.</td> +</tr><tr> +<td><a href="eric5.Plugins.CheckerPlugins.SyntaxChecker.pyflakes.messages.html">messages</a></td> +<td>Provide the class Message and its subclasses.</td> +</tr> +</table> +</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.Utilities.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/index-eric5.Utilities.html Sun Mar 30 22:00:14 2014 +0200 @@ -32,12 +32,6 @@ </tr><tr> <td><a href="index-eric5.Utilities.crypto.html">crypto</a></td> <td>Package implementing cryptography related functionality.</td> -</tr><tr> -<td><a href="index-eric5.Utilities.py2flakes.html">py2flakes</a></td> -<td>Package containg the pyflakes Python2 port adapted for Qt.</td> -</tr><tr> -<td><a href="index-eric5.Utilities.py3flakes.html">py3flakes</a></td> -<td>Package containg the pyflakes Python3 port adapted for Qt.</td> </tr> </table> @@ -47,6 +41,12 @@ <td><a href="eric5.Utilities.AutoSaver.html">AutoSaver</a></td> <td>Module implementing an auto saver class.</td> </tr><tr> +<td><a href="eric5.Utilities.BackgroundClient.html">BackgroundClient</a></td> +<td>Module implementing a Qt free version of a background client for the various checkers and other python interpreter dependent functions.</td> +</tr><tr> +<td><a href="eric5.Utilities.BackgroundService.html">BackgroundService</a></td> +<td>Module implementing a background service for the various checkers and other python interpreter dependent functions.</td> +</tr><tr> <td><a href="eric5.Utilities.FtpUtilities.html">FtpUtilities</a></td> <td>Module implementing some FTP related utilities.</td> </tr><tr> @@ -59,9 +59,6 @@ <td><a href="eric5.Utilities.PySideImporter.html">PySideImporter</a></td> <td>Module to check for the presence of PySide by importing it.</td> </tr><tr> -<td><a href="eric5.Utilities.SyntaxCheck.html">SyntaxCheck</a></td> -<td>Module implementing the syntax check for Python 2/3.</td> -</tr><tr> <td><a href="eric5.Utilities.__init__.html">Utilities</a></td> <td>Package implementing various functions/classes needed everywhere within eric5.</td> </tr><tr>
--- a/Documentation/Source/index-eric5.Utilities.py2flakes.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.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.Utilities.py2flakes</h1> -<p> -Package containg the pyflakes Python2 port adapted for Qt. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.Utilities.py2flakes.checker.html">checker</a></td> -<td></td> -</tr><tr> -<td><a href="eric5.Utilities.py2flakes.messages.html">messages</a></td> -<td>Module implementing the messages for py2flakes.</td> -</tr> -</table> -</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.Utilities.py3flakes.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.Utilities.py3flakes</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.Utilities.py3flakes</h1> -<p> -Package containg the pyflakes Python3 port adapted for Qt. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.Utilities.py3flakes.checker.html">checker</a></td> -<td></td> -</tr><tr> -<td><a href="eric5.Utilities.py3flakes.messages.html">messages</a></td> -<td>Module implementing the messages for py3flakes.</td> -</tr> -</table> -</body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric5.UtilitiesPython2.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>eric5.UtilitiesPython2</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</h1> -<p> -This package implements some utilities and tools for Python2. -</p> - - -<h3>Modules</h3> -<table> -<tr> -<td><a href="eric5.UtilitiesPython2.CodeStyleChecker.html">CodeStyleChecker</a></td> -<td>Class implementing the PEP 8 checker for Python2.</td> -</tr><tr> -<td><a href="eric5.UtilitiesPython2.DocStyleCheckerPy2.html">DocStyleCheckerPy2</a></td> -<td>Module implementing a checker for documentation string conventions.</td> -</tr><tr> -<td><a href="eric5.UtilitiesPython2.NamingStyleCheckerPy2.html">NamingStyleCheckerPy2</a></td> -<td>Module implementing a checker for naming conventions for Python2.</td> -</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.html Sun Jan 05 23:22:17 2014 +0100 +++ b/Documentation/Source/index-eric5.html Sun Mar 30 22:00:14 2014 +0200 @@ -117,9 +117,6 @@ <td><a href="index-eric5.Utilities.html">Utilities</a></td> <td>Package implementing various functions/classes needed everywhere within eric5.</td> </tr><tr> -<td><a href="index-eric5.UtilitiesPython2.html">UtilitiesPython2</a></td> -<td>This package implements some utilities and tools for Python2.</td> -</tr><tr> <td><a href="index-eric5.VCS.html">VCS</a></td> <td>Module implementing the general part of the interface to version control systems.</td> </tr><tr>
--- a/Documentation/Source/pep8.html Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1258 +0,0 @@ -<!DOCTYPE html> -<html><head> -<title>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>pep8</h1> - -<h3>Global Attributes</h3> -<table> -<tr><td>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_SINGLETON_REGEX</td></tr><tr><td>COMPARE_TYPE_REGEX</td></tr><tr><td>DEFAULT_EXCLUDE</td></tr><tr><td>DEFAULT_IGNORE</td></tr><tr><td>DOCSTRING_REGEX</td></tr><tr><td>ERRORCODE_REGEX</td></tr><tr><td>EXTRANEOUS_WHITESPACE_REGEX</td></tr><tr><td>HUNK_REGEX</td></tr><tr><td>INDENT_REGEX</td></tr><tr><td>KEYWORDS</td></tr><tr><td>KEYWORD_REGEX</td></tr><tr><td>LAMBDA_REGEX</td></tr><tr><td>MAX_LINE_LENGTH</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</td></tr><tr><td>PyCF_ONLY_AST</td></tr><tr><td>RAISE_COMMA_REGEX</td></tr><tr><td>REPORT_FORMAT</td></tr><tr><td>RERAISE_COMMA_REGEX</td></tr><tr><td>SINGLETONS</td></tr><tr><td>SKIP_TOKENS</td></tr><tr><td>TESTSUITE_PATH</td></tr><tr><td>UNARY_OPERATORS</td></tr><tr><td>WHITESPACE</td></tr><tr><td>WHITESPACE_AFTER_COMMA_REGEX</td></tr><tr><td>WS_NEEDED_OPERATORS</td></tr><tr><td>WS_OPTIONAL_OPERATORS</td></tr><tr><td>__version__</td></tr><tr><td>_checks</td></tr><tr><td>noqa</td></tr> -</table> -<h3>Classes</h3> -<table> -<tr> -<td><a href="#BaseReport">BaseReport</a></td> -<td>Collect the results of the checks.</td> -</tr><tr> -<td><a href="#Checker">Checker</a></td> -<td>Load a Python source file, tokenize it, check coding style.</td> -</tr><tr> -<td><a href="#DiffReport">DiffReport</a></td> -<td>Collect and print the results for the changed lines only.</td> -</tr><tr> -<td><a href="#FileReport">FileReport</a></td> -<td>Collect the results of the checks and print only the filenames.</td> -</tr><tr> -<td><a href="#StandardReport">StandardReport</a></td> -<td>Collect and print the results of the checks.</td> -</tr><tr> -<td><a href="#StyleGuide">StyleGuide</a></td> -<td>Initialize a PEP-8 instance with few options.</td> -</tr> -</table> -<h3>Functions</h3> -<table> -<tr> -<td><a href="#_add_check">_add_check</a></td> -<td></td> -</tr><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>Separate top-level function and class definitions with two blank lines.</td> -</tr><tr> -<td><a href="#comparison_to_singleton">comparison_to_singleton</a></td> -<td>Comparisons to singletons like None should always be done with "is" or "is not", never the equality operators.</td> -</tr><tr> -<td><a href="#comparison_type">comparison_type</a></td> -<td>Object type comparisons should always use isinstance() instead of comparing types directly.</td> -</tr><tr> -<td><a href="#compound_statements">compound_statements</a></td> -<td>Compound statements (multiple statements on the same line) are generally discouraged.</td> -</tr><tr> -<td><a href="#continued_indentation">continued_indentation</a></td> -<td>Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent.</td> -</tr><tr> -<td><a href="#expand_indent">expand_indent</a></td> -<td>Return the amount of indentation.</td> -</tr><tr> -<td><a href="#explicit_line_join">explicit_line_join</a></td> -<td>Avoid explicit line join between brackets.</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 patterns contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#get_parser">get_parser</a></td> -<td></td> -</tr><tr> -<td><a href="#imports_on_separate_lines">imports_on_separate_lines</a></td> -<td>Imports should usually be on separate lines.</td> -</tr><tr> -<td><a href="#indentation">indentation</a></td> -<td>Use 4 spaces per indentation level.</td> -</tr><tr> -<td><a href="#init_checks_registry">init_checks_registry</a></td> -<td>Register all globally visible functions where the first argument name is 'physical_line' or 'logical_line'.</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="#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>- 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).</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="#parse_udiff">parse_udiff</a></td> -<td>Return a dictionary of matching lines.</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 3.</td> -</tr><tr> -<td><a href="#python_3000_has_key">python_3000_has_key</a></td> -<td>The {}.has_key() method is removed in the Python 3.</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="#read_config">read_config</a></td> -<td>Read both user configuration and local configuration.</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="#register_check">register_check</a></td> -<td>Register a new check object.</td> -</tr><tr> -<td><a href="#stdin_get_value">stdin_get_value</a></td> -<td></td> -</tr><tr> -<td><a href="#tabs_obsolete">tabs_obsolete</a></td> -<td>For new projects, spaces-only are strongly recommended over tabs.</td> -</tr><tr> -<td><a href="#tabs_or_spaces">tabs_or_spaces</a></td> -<td>Never mix tabs and spaces.</td> -</tr><tr> -<td><a href="#trailing_blank_lines">trailing_blank_lines</a></td> -<td>JCR: Trailing blank lines are superfluous.</td> -</tr><tr> -<td><a href="#trailing_whitespace">trailing_whitespace</a></td> -<td>JCR: Trailing whitespace is superfluous.</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_keywords">whitespace_around_keywords</a></td> -<td>Avoid extraneous whitespace around keywords.</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="BaseReport" ID="BaseReport"></a> -<h2>BaseReport</h2> -<p> -Collect the results of the checks. -</p> -<h3>Derived from</h3> -object -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</td></tr> -</table> -<h3>Class Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<h3>Methods</h3> -<table> -<tr> -<td><a href="#BaseReport.__init__">BaseReport</a></td> -<td></td> -</tr><tr> -<td><a href="#BaseReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#BaseReport.get_count">get_count</a></td> -<td>Return the total count of errors and warnings.</td> -</tr><tr> -<td><a href="#BaseReport.get_file_results">get_file_results</a></td> -<td>Return the count of errors and warnings for this file.</td> -</tr><tr> -<td><a href="#BaseReport.get_statistics">get_statistics</a></td> -<td>Get statistics for message codes that start with the prefix.</td> -</tr><tr> -<td><a href="#BaseReport.increment_logical_line">increment_logical_line</a></td> -<td>Signal a new logical line.</td> -</tr><tr> -<td><a href="#BaseReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr><tr> -<td><a href="#BaseReport.print_benchmark">print_benchmark</a></td> -<td>Print benchmark numbers.</td> -</tr><tr> -<td><a href="#BaseReport.print_statistics">print_statistics</a></td> -<td>Print overall statistics (number of errors and warnings).</td> -</tr><tr> -<td><a href="#BaseReport.start">start</a></td> -<td>Start the timer.</td> -</tr><tr> -<td><a href="#BaseReport.stop">stop</a></td> -<td>Stop the timer.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="BaseReport.__init__" ID="BaseReport.__init__"></a> -<h4>BaseReport (Constructor)</h4> -<b>BaseReport</b>(<i>options</i>) -<a NAME="BaseReport.error" ID="BaseReport.error"></a> -<h4>BaseReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.error_args" ID="BaseReport.error_args"></a> -<h4>BaseReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="BaseReport.get_count" ID="BaseReport.get_count"></a> -<h4>BaseReport.get_count</h4> -<b>get_count</b>(<i>prefix=''</i>) -<p> -Return the total count of errors and warnings. -</p><a NAME="BaseReport.get_file_results" ID="BaseReport.get_file_results"></a> -<h4>BaseReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Return the count of errors and warnings for this file. -</p><a NAME="BaseReport.get_statistics" ID="BaseReport.get_statistics"></a> -<h4>BaseReport.get_statistics</h4> -<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><a NAME="BaseReport.increment_logical_line" ID="BaseReport.increment_logical_line"></a> -<h4>BaseReport.increment_logical_line</h4> -<b>increment_logical_line</b>(<i></i>) -<p> -Signal a new logical line. -</p><a NAME="BaseReport.init_file" ID="BaseReport.init_file"></a> -<h4>BaseReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p><a NAME="BaseReport.print_benchmark" ID="BaseReport.print_benchmark"></a> -<h4>BaseReport.print_benchmark</h4> -<b>print_benchmark</b>(<i></i>) -<p> -Print benchmark numbers. -</p><a NAME="BaseReport.print_statistics" ID="BaseReport.print_statistics"></a> -<h4>BaseReport.print_statistics</h4> -<b>print_statistics</b>(<i>prefix=''</i>) -<p> -Print overall statistics (number of errors and warnings). -</p><a NAME="BaseReport.start" ID="BaseReport.start"></a> -<h4>BaseReport.start</h4> -<b>start</b>(<i></i>) -<p> -Start the timer. -</p><a NAME="BaseReport.stop" ID="BaseReport.stop"></a> -<h4>BaseReport.stop</h4> -<b>stop</b>(<i></i>) -<p> -Stop the timer. -</p> -<div align="right"><a href="#top">Up</a></div> -<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_ast">check_ast</a></td> -<td></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.generate_tokens">generate_tokens</a></td> -<td></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_invalid_syntax">report_invalid_syntax</a></td> -<td></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=None, lines=None, options=None, report=None, **kwargs</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_ast" ID="Checker.check_ast"></a> -<h4>Checker.check_ast</h4> -<b>check_ast</b>(<i></i>) -<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.generate_tokens" ID="Checker.generate_tokens"></a> -<h4>Checker.generate_tokens</h4> -<b>generate_tokens</b>(<i></i>) -<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_invalid_syntax" ID="Checker.report_invalid_syntax"></a> -<h4>Checker.report_invalid_syntax</h4> -<b>report_invalid_syntax</b>(<i></i>) -<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="DiffReport" ID="DiffReport"></a> -<h2>DiffReport</h2> -<p> -Collect and print the results for the changed lines only. -</p> -<h3>Derived from</h3> -StandardReport -<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="#DiffReport.__init__">DiffReport</a></td> -<td></td> -</tr><tr> -<td><a href="#DiffReport.error">error</a></td> -<td></td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="DiffReport.__init__" ID="DiffReport.__init__"></a> -<h4>DiffReport (Constructor)</h4> -<b>DiffReport</b>(<i>options</i>) -<a NAME="DiffReport.error" ID="DiffReport.error"></a> -<h4>DiffReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) - -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="FileReport" ID="FileReport"></a> -<h2>FileReport</h2> -<p> -Collect the results of the checks and print only the filenames. -</p> -<h3>Derived from</h3> -BaseReport -<h3>Class Attributes</h3> -<table> -<tr><td>print_filename</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="StandardReport" ID="StandardReport"></a> -<h2>StandardReport</h2> -<p> -Collect and print the results of the checks. -</p> -<h3>Derived from</h3> -BaseReport -<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="#StandardReport.__init__">StandardReport</a></td> -<td></td> -</tr><tr> -<td><a href="#StandardReport.error">error</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.error_args">error_args</a></td> -<td>Report an error, according to options.</td> -</tr><tr> -<td><a href="#StandardReport.get_file_results">get_file_results</a></td> -<td>Print the result and return the overall count for this file.</td> -</tr><tr> -<td><a href="#StandardReport.init_file">init_file</a></td> -<td>Signal a new file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StandardReport.__init__" ID="StandardReport.__init__"></a> -<h4>StandardReport (Constructor)</h4> -<b>StandardReport</b>(<i>options</i>) -<a NAME="StandardReport.error" ID="StandardReport.error"></a> -<h4>StandardReport.error</h4> -<b>error</b>(<i>line_number, offset, text, check</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.error_args" ID="StandardReport.error_args"></a> -<h4>StandardReport.error_args</h4> -<b>error_args</b>(<i>line_number, offset, code, check, *args</i>) -<p> -Report an error, according to options. -</p><a NAME="StandardReport.get_file_results" ID="StandardReport.get_file_results"></a> -<h4>StandardReport.get_file_results</h4> -<b>get_file_results</b>(<i></i>) -<p> -Print the result and return the overall count for this file. -</p><a NAME="StandardReport.init_file" ID="StandardReport.init_file"></a> -<h4>StandardReport.init_file</h4> -<b>init_file</b>(<i>filename, lines, expected, line_offset</i>) -<p> -Signal a new file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="StyleGuide" ID="StyleGuide"></a> -<h2>StyleGuide</h2> -<p> -Initialize a PEP-8 instance with few options. -</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="#StyleGuide.__init__">StyleGuide</a></td> -<td></td> -</tr><tr> -<td><a href="#StyleGuide.check_files">check_files</a></td> -<td>Run all checks on the paths.</td> -</tr><tr> -<td><a href="#StyleGuide.excluded">excluded</a></td> -<td>Check if options.exclude contains a pattern that matches filename.</td> -</tr><tr> -<td><a href="#StyleGuide.get_checks">get_checks</a></td> -<td>Find all globally visible functions where the first argument name starts with argument_name and which contain selected tests.</td> -</tr><tr> -<td><a href="#StyleGuide.ignore_code">ignore_code</a></td> -<td>Check if the error code should be ignored.</td> -</tr><tr> -<td><a href="#StyleGuide.init_report">init_report</a></td> -<td>Initialize the report instance.</td> -</tr><tr> -<td><a href="#StyleGuide.input_dir">input_dir</a></td> -<td>Check all files in this directory and all subdirectories.</td> -</tr><tr> -<td><a href="#StyleGuide.input_file">input_file</a></td> -<td>Run all checks on a Python source file.</td> -</tr> -</table> -<h3>Static Methods</h3> -<table> -<tr><td>None</td></tr> -</table> -<a NAME="StyleGuide.__init__" ID="StyleGuide.__init__"></a> -<h4>StyleGuide (Constructor)</h4> -<b>StyleGuide</b>(<i>*args, **kwargs</i>) -<a NAME="StyleGuide.check_files" ID="StyleGuide.check_files"></a> -<h4>StyleGuide.check_files</h4> -<b>check_files</b>(<i>paths=None</i>) -<p> -Run all checks on the paths. -</p><a NAME="StyleGuide.excluded" ID="StyleGuide.excluded"></a> -<h4>StyleGuide.excluded</h4> -<b>excluded</b>(<i>filename, parent=None</i>) -<p> - Check if options.exclude contains a pattern that matches filename. -</p><a NAME="StyleGuide.get_checks" ID="StyleGuide.get_checks"></a> -<h4>StyleGuide.get_checks</h4> -<b>get_checks</b>(<i>argument_name</i>) -<p> - Find all globally visible functions where the first argument name - starts with argument_name and which contain selected tests. -</p><a NAME="StyleGuide.ignore_code" ID="StyleGuide.ignore_code"></a> -<h4>StyleGuide.ignore_code</h4> -<b>ignore_code</b>(<i>code</i>) -<p> - Check if the error code should be ignored. -</p><p> - If 'options.select' contains a prefix of the error code, - return False. Else, if 'options.ignore' contains a prefix of - the error code, return True. -</p><a NAME="StyleGuide.init_report" ID="StyleGuide.init_report"></a> -<h4>StyleGuide.init_report</h4> -<b>init_report</b>(<i>reporter=None</i>) -<p> -Initialize the report instance. -</p><a NAME="StyleGuide.input_dir" ID="StyleGuide.input_dir"></a> -<h4>StyleGuide.input_dir</h4> -<b>input_dir</b>(<i>dirname</i>) -<p> -Check all files in this directory and all subdirectories. -</p><a NAME="StyleGuide.input_file" ID="StyleGuide.input_file"></a> -<h4>StyleGuide.input_file</h4> -<b>input_file</b>(<i>filename, lines=None, expected=None, line_offset=0</i>) -<p> -Run all checks on a Python source file. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="_add_check" ID="_add_check"></a> -<h2>_add_check</h2> -<b>_add_check</b>(<i>check, kind, codes, args</i>) - -<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</i>) -<p> - Separate top-level function and class definitions with two blank lines. -</p><p> - Method definitions inside a class are separated by a single blank line. -</p><p> - 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). -</p><p> - Use blank lines in functions, sparingly, to indicate logical sections. -</p><p> - 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 -</p><p> - 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 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_to_singleton" ID="comparison_to_singleton"></a> -<h2>comparison_to_singleton</h2> -<b>comparison_to_singleton</b>(<i>logical_line, noqa</i>) -<p> - Comparisons to singletons like None should always be done - with "is" or "is not", never the equality operators. -</p><p> - Okay: if arg is not None: - E711: if arg != None: - E712: if arg == True: -</p><p> - Also, beware of writing if x when you really mean if x is not None -- - e.g. when testing whether a variable or argument that defaults to None was - set to some other value. The other value might have a type (such as a - container) that could be false in a boolean context! -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="comparison_type" ID="comparison_type"></a> -<h2>comparison_type</h2> -<b>comparison_type</b>(<i>logical_line</i>) -<p> - Object type comparisons should always use isinstance() instead of - comparing types directly. -</p><p> - Okay: if isinstance(obj, int): - E721: if type(obj) is type(1): -</p><p> - When checking if an object is a string, keep in mind that it might be a - unicode string too! In Python 2.3, str and unicode have a common base - class, basestring, so you can do: -</p><p> - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): -</p> -<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>) -<p> - Compound statements (multiple statements on the same line) are - generally discouraged. -</p><p> - 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! -</p><p> - Okay: if foo == 'blah':\n do_blah_thing() - Okay: do_one() - Okay: do_two() - Okay: do_three() -</p><p> - 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() -</p><p> - E702: do_one(); do_two(); do_three() - E703: do_four(); # useless semicolon -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="continued_indentation" ID="continued_indentation"></a> -<h2>continued_indentation</h2> -<b>continued_indentation</b>(<i>logical_line, tokens, indent_level, hang_closing, noqa, verbose</i>) -<p> - Continuation lines should align wrapped elements either vertically using - Python's implicit line joining inside parentheses, brackets and braces, or - using a hanging indent. -</p><p> - When using a hanging indent the following considerations should be applied: -</p><p> - - there should be no arguments on the first line, and -</p><p> - - further indentation should be used to clearly distinguish itself as a - continuation line. -</p><p> - Okay: a = (\n) - E123: a = (\n ) -</p><p> - Okay: a = (\n 42) - E121: a = (\n 42) - E122: a = (\n42) - E123: a = (\n 42\n ) - E124: a = (24,\n 42\n) - E125: if (a or\n b):\n pass - E126: a = (\n 42) - E127: a = (24,\n 42) - E128: a = (24,\n 42) -</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="explicit_line_join" ID="explicit_line_join"></a> -<h2>explicit_line_join</h2> -<b>explicit_line_join</b>(<i>logical_line, tokens</i>) -<p> - Avoid explicit line join between brackets. -</p><p> - The preferred way of wrapping long lines is by using Python's implied line - continuation inside parentheses, brackets and braces. Long lines can be - broken over multiple lines by wrapping expressions in parentheses. These - should be used in preference to using a backslash for line continuation. -</p><p> - E502: aaa = [123, \\n 123] - E502: aaa = ("bbb " \\n "ccc") -</p><p> - Okay: aaa = [123,\n 123] - Okay: aaa = ("bbb "\n "ccc") - Okay: aaa = "bbb " \\n "ccc" -</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, patterns, default=True</i>) -<p> - Check if patterns contains a pattern that matches filename. - If patterns is unspecified, this always returns True. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="get_parser" ID="get_parser"></a> -<h2>get_parser</h2> -<b>get_parser</b>(<i>prog='pep8', version=__version__</i>) - -<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>) -<p> - Imports should usually be on separate lines. -</p><p> - Okay: import os\nimport sys - E401: import sys, os -</p><p> - 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 -</p> -<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>) -<p> - Use 4 spaces per indentation level. -</p><p> - For really old code that you don't want to mess up, you can continue to - use 8-space tabs. -</p><p> - Okay: a = 1 - Okay: if a == 0:\n a = 1 - E111: a = 1 -</p><p> - Okay: for item in items:\n pass - E112: for item in items:\npass -</p><p> - Okay: a = 1\nb = 2 - E113: a = 1\n b = 2 -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="init_checks_registry" ID="init_checks_registry"></a> -<h2>init_checks_registry</h2> -<b>init_checks_registry</b>(<i></i>) -<p> - Register all globally visible functions where the first argument name - is 'physical_line' or 'logical_line'. -</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, max_line_length</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><p> - Reports error E501. -</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><p> - Reports warning W292. -</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) - E231: [{'a':'b'}] -</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>) -<p> - - 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). -</p><p> - - Use spaces around arithmetic operators. -</p><p> - 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: alpha[:-i] -</p><p> - E225: i=i+1 - E225: submitted +=1 - E225: x = x /2 - 1 - E225: z = x **y - E226: c = (a+b) * (a-b) - E226: hypot2 = x*x + y*y - E227: c = a|b - E228: msg = fmt%(errno, errmsg) -</p> -<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="parse_udiff" ID="parse_udiff"></a> -<h2>parse_udiff</h2> -<b>parse_udiff</b>(<i>diff, patterns=None, parent='.'</i>) -<p> -Return a dictionary of matching lines. -</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, parse_argv=False, config_file=None, parser=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 3. - Use repr() instead. -</p><p> - Okay: val = repr(1 + 2) - W604: val = `1 + 2` -</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 is removed in the Python 3. - Use the 'in' operation instead. -</p><p> - Okay: if "alph" in d:\n print d["alph"] - W601: assert d.has_key('alph') -</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 3. -</p><p> - Okay: if a != 'no': - W603: if a <> 'no': -</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 is removed in Python 3. -</p><p> - Okay: raise DummyError("Message") - W602: raise DummyError, "Message" -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="read_config" ID="read_config"></a> -<h2>read_config</h2> -<b>read_config</b>(<i>options, args, arglist, parser</i>) -<p> -Read both user configuration and local configuration. -</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="register_check" ID="register_check"></a> -<h2>register_check</h2> -<b>register_check</b>(<i>check, codes=None</i>) -<p> - Register a new check object. -</p> -<div align="right"><a href="#top">Up</a></div> -<hr /><hr /> -<a NAME="stdin_get_value" ID="stdin_get_value"></a> -<h2>stdin_get_value</h2> -<b>stdin_get_value</b>(<i></i>) - -<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>) -<p> - For new projects, spaces-only are strongly recommended over tabs. Most - editors have features that make this easy to do. -</p><p> - Okay: if True:\n return - W191: if True:\n\treturn -</p> -<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>) -<p> - Never mix tabs and spaces. -</p><p> - 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! -</p><p> - Okay: if a == 0:\n a = 1\n b = 1 - E101: if a == 0:\n a = 1\n\tb = 1 -</p> -<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>) -<p> - JCR: Trailing blank lines are superfluous. -</p><p> - Okay: spam(1) - W391: spam(1)\n -</p> -<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>) -<p> - 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. -</p><p> - [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines -</p><p> - The warning returned varies on whether the line itself is blank, for easier - filtering for those who want to indent their blank lines. -</p><p> - Okay: spam(1)\n# - W291: spam(1) \n# - W293: class Foo(object):\n \n bang = 12 -</p> -<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_keywords" ID="whitespace_around_keywords"></a> -<h2>whitespace_around_keywords</h2> -<b>whitespace_around_keywords</b>(<i>logical_line</i>) -<p> - Avoid extraneous whitespace around keywords. -</p><p> - Okay: True and False - E271: True and False - E272: True and False - E273: True and\tFalse - E274: True\tand False -</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, tokens</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/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleChecker.py Sun Mar 30 22:00:14 2014 +0200 @@ -7,137 +7,181 @@ Module implementing the code style checker. """ -from __future__ import unicode_literals +import sys -try: - str = unicode # __IGNORE_WARNING__ -except (NameError): - pass - -import os +import pep8 +from NamingStyleChecker import NamingStyleChecker -from PyQt4.QtCore import QProcess, QCoreApplication +# register the name checker +pep8.register_check(NamingStyleChecker, NamingStyleChecker.Codes) -from . import pep8 -from .NamingStyleChecker import NamingStyleChecker -from .DocStyleChecker import DocStyleChecker - -import Preferences -import Utilities - -from eric5config import getConfig +from DocStyleChecker import DocStyleChecker -class CodeStyleCheckerPy2(object): +def initService(): """ - Class implementing the code style checker interface for Python 2. + Initialize the service and return the entry point. + + @return the entry point for the background client (function) """ - def __init__(self, filename, lines, repeat=False, - select="", ignore="", max_line_length=79, - hang_closing=False, docType="pep257"): + return codeStyleCheck + + +class CodeStyleCheckerReport(pep8.BaseReport): + """ + Class implementing a special report to be used with our dialog. + """ + def __init__(self, options): """ Constructor - @param filename name of the file to check (string) - @param lines source of the file (list of strings) (ignored) - @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) - @keyparam max_line_length maximum allowed line length (integer) - @keyparam hang_closing flag indicating to allow hanging closing - brackets (boolean) - @keyparam docType type of the documentation strings - (string, one of 'eric' or 'pep257') - @exception AssertionError raised if the docType argument is not - "eric" or "pep257" + @param options options for the report (optparse.Values) """ - assert docType in ("eric", "pep257") - - self.errors = [] - self.counters = {} + super(CodeStyleCheckerReport, self).__init__(options) - interpreter = Preferences.getDebugger("PythonInterpreter") - if interpreter == "" or not Utilities.isExecutable(interpreter): - self.errors.append( - (filename, 1, 1, QCoreApplication.translate( - "CodeStyleCheckerPy2", - "Python2 interpreter not configured."))) - return - - checker = os.path.join(getConfig('ericDir'), - "UtilitiesPython2", "CodeStyleChecker.py") - - args = [checker] - if repeat: - args.append("-r") - if select: - args.append("-s") - args.append(select) - if ignore: - args.append("-i") - args.append(ignore) - args.append("-m") - args.append(str(max_line_length)) - if hang_closing: - args.append("-h") - args.append("-d") - args.append(docType) - args.append("-f") - args.append(filename) + self.__repeat = options.repeat + self.errors = [] + + def error_args(self, line_number, offset, code, check, *args): + """ + Public method to collect the error messages. - proc = QProcess() - proc.setProcessChannelMode(QProcess.MergedChannels) - proc.start(interpreter, args) - finished = proc.waitForFinished(15000) - if finished: - output = \ - str(proc.readAllStandardOutput(), - Preferences.getSystem("IOEncoding"), - 'replace').splitlines() - if output[0] == "ERROR": - self.errors.append((filename, 1, 1, output[2])) - return - - if output[0] == "NO_PEP8": - return - - index = 0 - while index < len(output): - if output[index] == "PEP8_STATISTICS": - index += 1 - break - - if output[index] == "EXCEPTION": - exceptionText = os.linesep.join(output[index + 2:]) - raise RuntimeError(exceptionText) - - fname = output[index + 1] - lineno = int(output[index + 2]) - position = int(output[index + 3]) - code = output[index + 4] - arglen = int(output[index + 5]) - args = [] - argindex = 0 - while argindex < arglen: - args.append(output[index + 6 + argindex]) - argindex += 1 - index += 6 + arglen - - if code in NamingStyleChecker.Codes: - text = NamingStyleChecker.getMessage(code, *args) - elif code in DocStyleChecker.Codes: - text = DocStyleChecker.getMessage(code, *args) + @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) + @return error code (string) + """ + code = super(CodeStyleCheckerReport, self).error_args( + line_number, offset, code, check, *args) + if code and (self.counters[code] == 1 or self.__repeat): + self.errors.append( + (self.filename, line_number, offset, (code, args)) + ) + return code + + +def extractLineFlags(line, startComment="#", endComment=""): + """ + Function to extract flags starting and ending with '__' from a line + comment. + + @param line line to extract flags from (string) + @keyparam startComment string identifying the start of the comment (string) + @keyparam endComment string identifying the end of a comment (string) + @return list containing the extracted flags (list of strings) + """ + flags = [] + + pos = line.rfind(startComment) + if pos >= 0: + comment = line[pos + len(startComment):].strip() + if endComment: + comment = comment.replace("endComment", "") + flags = [f.strip() for f in comment.split() + if (f.startswith("__") and f.endswith("__"))] + return flags + + +def codeStyleCheck(filename, source, args): + """ + Do the code style check and/ or fix found errors. + + @param filename source filename (string) + @param source string containing the code to check (string) + @param args arguments used by the codeStyleCheck function (list of + excludeMessages (str), includeMessages (str), repeatMessages + (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), + maxLineLength (int), hangClosing (bool), docType (str), errors + (list of str), eol (str), encoding (str)) + @return tuple of stats (dict) and results (tuple for each found violation + of style (tuple of lineno (int), position (int), text (str), fixed + (bool), autofixing (bool), fixedMsg (str))) + """ + excludeMessages, includeMessages, \ + repeatMessages, fixCodes, noFixCodes, fixIssues, maxLineLength, \ + hangClosing, docType, errors, eol, encoding = args + + stats = {} + # avoid 'Encoding declaration in unicode string' exception on Python2 + if sys.version_info[0] == 2: + if encoding == 'utf-8-bom': + enc = 'utf-8' + else: + enc = encoding + source = [line.encode(enc) for line in source] + + if fixIssues: + from CodeStyleFixer import CodeStyleFixer + fixer = CodeStyleFixer( + filename, source, fixCodes, noFixCodes, + maxLineLength, True, eol) # always fix in place + else: + fixer = None + + if not errors: + if includeMessages: + select = [s.strip() for s in + includeMessages.split(',') if s.strip()] + else: + select = [] + if excludeMessages: + ignore = [i.strip() for i in + excludeMessages.split(',') if i.strip()] + else: + ignore = [] + + # check coding style + styleGuide = pep8.StyleGuide( + reporter=CodeStyleCheckerReport, + repeat=repeatMessages, + select=select, + ignore=ignore, + max_line_length=maxLineLength, + hang_closing=hangClosing, + ) + report = styleGuide.check_files([filename]) + stats.update(report.counters) + + # check documentation style + docStyleChecker = DocStyleChecker( + source, filename, select, ignore, [], repeatMessages, + maxLineLength=maxLineLength, docType=docType) + docStyleChecker.run() + stats.update(docStyleChecker.counters) + + errors = report.errors + docStyleChecker.errors + + deferredFixes = {} + results = [] + for fname, lineno, position, text in errors: + if lineno > len(source): + lineno = len(source) + if "__IGNORE_WARNING__" not in \ + extractLineFlags(source[lineno - 1].strip()): + if fixer: + res, msg, id_ = fixer.fixIssue(lineno, position, text) + if res == -1: + itm = [lineno, position, text] + deferredFixes[id_] = itm else: - text = pep8.getMessage(code, *args) - self.errors.append((fname, lineno, position, text)) - while index < len(output): - code, countStr = output[index].split(None, 1) - self.counters[code] = int(countStr) - index += 1 - else: - self.errors.append( - (filename, 1, 1, QCoreApplication.translate( - "CodeStyleCheckerPy2", - "Python2 interpreter did not finish within 15s."))) + itm = [lineno, position, text, res == 1, True, msg] + else: + itm = [lineno, position, text, False, False, ''] + results.append(itm) + + if fixer: + deferredResults = fixer.finalize() + for id_ in deferredResults: + fixed, msg = deferredResults[id_] + itm = deferredFixes[id_] + itm.extend([fixed == 1, fixed == 1, msg]) + results.append(itm) + + errMsg = fixer.saveFile(encoding) + if errMsg: + for result in results: + result[-1] = errMsg + + return stats, results
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Sun Mar 30 22:00:14 2014 +0200 @@ -25,51 +25,6 @@ import Utilities from . import pep8 -from .NamingStyleChecker import NamingStyleChecker - -# register the name checker -pep8.register_check(NamingStyleChecker, NamingStyleChecker.Codes) - -from .DocStyleChecker import DocStyleChecker - - -class CodeStyleCheckerReport(pep8.BaseReport): - """ - Class implementing a special report to be used with our dialog. - """ - def __init__(self, options): - """ - Constructor - - @param options options for the report (optparse.Values) - """ - super(CodeStyleCheckerReport, self).__init__(options) - - self.__repeat = options.repeat - self.errors = [] - - def 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) - @return error code (string) - """ - code = super(CodeStyleCheckerReport, self).error_args( - line_number, offset, code, check, *args) - if code and (self.counters[code] == 1 or self.__repeat): - if code in NamingStyleChecker.Codes: - text = NamingStyleChecker.getMessage(code, *args) - else: - text = pep8.getMessage(code, *args) - self.errors.append( - (self.filename, line_number, offset, text) - ) - return code class CodeStyleCheckerDialog(QDialog, Ui_CodeStyleCheckerDialog): @@ -83,10 +38,12 @@ fixableRole = Qt.UserRole + 5 codeRole = Qt.UserRole + 6 - def __init__(self, parent=None): + def __init__(self, styleCheckService, parent=None): """ Constructor + @param styleCheckService reference to the service + (CodeStyleCheckService) @param parent reference to the parent widget (QWidget) """ super(CodeStyleCheckerDialog, self).__init__(parent) @@ -115,6 +72,10 @@ self.checkProgressLabel.setVisible(False) self.checkProgressLabel.setMaximumWidth(600) + self.styleCheckService = styleCheckService + self.styleCheckService.styleChecked.connect(self.__processResult) + self.filename = None + self.noResults = True self.cancelled = False self.__lastFileItem = None @@ -202,7 +163,7 @@ @param fixed flag indicating a fixed issue (boolean) """ if fixed: - message = itm.data(0, self.messageRole) + text + code, message = text.split(None, 1) itm.setText(2, message) itm.setIcon(0, UI.PixmapCache.getIcon("issueFixed.png")) @@ -228,8 +189,7 @@ self.__statistics[key] += statistics[key] else: self.__statistics[key] = statistics[key] - if fixer: - self.__statistics["_IssuesFixed"] += fixer.fixed + self.__statistics["_IssuesFixed"] += fixer def __updateFixerStatistics(self, fixer): """ @@ -237,7 +197,7 @@ @param fixer reference to the code style fixer (CodeStyleFixer) """ - self.__statistics["_IssuesFixed"] += fixer.fixed + self.__statistics["_IssuesFixed"] += fixer def __resetStatistics(self): """ @@ -327,43 +287,34 @@ self.__fileOrFileList = fn if isinstance(fn, list): - files = fn[:] + self.files = fn[:] elif os.path.isdir(fn): - files = [] + self.files = [] extensions = set(Preferences.getPython("PythonExtensions") + Preferences.getPython("Python3Extensions")) for ext in extensions: - files.extend(Utilities.direntries( + self.files.extend(Utilities.direntries( fn, True, '*{0}'.format(ext), 0)) else: - files = [fn] - + self.files = [fn] + # filter the list depending on the filter string - if files: + if self.files: filterString = self.excludeFilesEdit.text() filterList = [f.strip() for f in filterString.split(",") if f.strip()] for filter in filterList: - files = \ - [f for f in files + self.files = \ + [f for f in self.files if not fnmatch.fnmatch(f, filter.strip())] - + self.__resetStatistics() - self.__clearErrors(files) + self.__clearErrors(self.files) - 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)) - self.checkProgressLabel.setVisible( - len(py3files) + len(py2files) > 1) - self.checkProgress.setVisible( - len(py3files) + len(py2files) > 1) + if len(self.files) > 0: + self.checkProgress.setMaximum(len(self.files)) + self.checkProgressLabel.setVisible(len(self.files) > 1) + self.checkProgress.setVisible(len(self.files) > 1) QApplication.processEvents() # extract the configuration values @@ -378,157 +329,124 @@ docType = self.docTypeComboBox.itemData( self.docTypeComboBox.currentIndex()) - try: - # disable updates of the list for speed - self.resultList.setUpdatesEnabled(False) - self.resultList.setSortingEnabled(False) - - # now go through all the files - progress = 0 - for file in sorted(py3files + py2files): - self.checkProgress.setValue(progress) - self.checkProgressLabel.setPath(file) - QApplication.processEvents() - - if self.cancelled: - self.__resort() - return - - self.__lastFileItem = None - - try: - source, encoding = Utilities.readEncodedFile(file) - source = source.splitlines(True) - except (UnicodeError, IOError) as msg: - self.noResults = False - self.__createResultItem( - file, 1, 1, - self.trUtf8("Error: {0}").format(str(msg)) - .rstrip()[1:-1], False, False) - progress += 1 - continue - - stats = {} - flags = Utilities.extractFlags(source) - ext = os.path.splitext(file)[1] - if fixIssues: - from .CodeStyleFixer import CodeStyleFixer - fixer = CodeStyleFixer( - self.__project, file, source, fixCodes, noFixCodes, - maxLineLength, 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 .CodeStyleChecker import CodeStyleCheckerPy2 - report = CodeStyleCheckerPy2( - file, [], - repeat=repeatMessages, - select=includeMessages, - ignore=excludeMessages, - max_line_length=maxLineLength, - hang_closing=hangClosing, - docType=docType, - ) - errors = report.errors[:] - stats.update(report.counters) - else: - if includeMessages: - select = [s.strip() for s in - includeMessages.split(',') if s.strip()] - else: - select = [] - if excludeMessages: - ignore = [i.strip() for i in - excludeMessages.split(',') if i.strip()] - else: - ignore = [] - - # check coding style - styleGuide = pep8.StyleGuide( - reporter=CodeStyleCheckerReport, - repeat=repeatMessages, - select=select, - ignore=ignore, - max_line_length=maxLineLength, - hang_closing=hangClosing, - ) - report = styleGuide.check_files([file]) - stats.update(report.counters) - - # check documentation style - docStyleChecker = DocStyleChecker( - source, file, select, ignore, [], repeatMessages, - maxLineLength=maxLineLength, docType=docType) - docStyleChecker.run() - stats.update(docStyleChecker.counters) - - errors = report.errors + docStyleChecker.errors - - deferredFixes = {} - for error in errors: - fname, lineno, position, text = error - if lineno > len(source): - lineno = len(source) - if "__IGNORE_WARNING__" not in \ - Utilities.extractLineFlags( - source[lineno - 1].strip()): - self.noResults = False - if fixer: - res, msg, id_ = fixer.fixIssue(lineno, - position, text) - if res == 1: - text += "\n" + \ - self.trUtf8("Fix: {0}").format(msg) - self.__createResultItem( - fname, lineno, position, text, True, - True) - elif res == 0: - self.__createResultItem( - fname, lineno, position, text, False, - True) - else: - itm = self.__createResultItem( - fname, lineno, position, - text, False, False) - deferredFixes[id_] = itm - else: - self.__createResultItem( - fname, lineno, position, text, False, - False) - if fixer: - deferredResults = fixer.finalize() - for id_ in deferredResults: - fixed, msg = deferredResults[id_] - itm = deferredFixes[id_] - if fixed == 1: - text = "\n" + \ - self.trUtf8("Fix: {0}").format(msg) - self.__modifyFixedResultItem(itm, text, True) - else: - self.__modifyFixedResultItem(itm, "", False) - fixer.saveFile(encoding) - self.__updateStatistics(stats, fixer) - progress += 1 - finally: - # reenable updates of the list - self.resultList.setSortingEnabled(True) - self.resultList.setUpdatesEnabled(True) - self.checkProgress.setValue(progress) + self.__options = [excludeMessages, includeMessages, repeatMessages, + fixCodes, noFixCodes, fixIssues, maxLineLength, + hangClosing, docType] + + # now go through all the files + self.progress = 0 + self.files.sort() + self.check() + + def check(self, codestring='', onlyFixes={}): + """ + Start a style check for one file. + + The results are reported to the __processResult slot. + @keyparam codestring optional sourcestring (str) + @keyparam onlyFixes dict which violations should be fixed (dict) + """ + if not self.files: self.checkProgressLabel.setPath("") - QApplication.processEvents() - self.__resort() - else: self.checkProgress.setMaximum(1) self.checkProgress.setValue(1) - self.__finish() + self.__finish() + return + + self.filename = self.files.pop(0) + self.checkProgress.setValue(self.progress) + self.checkProgressLabel.setPath(self.filename) + QApplication.processEvents() + + if self.cancelled: + self.__resort() + return + + self.__lastFileItem = None + + if codestring: + self.source = codestring + else: + try: + self.source, encoding = Utilities.readEncodedFile( + self.filename) + if encoding.endswith( + ('-selected', '-default', '-guessed', '-ignore')): + encoding = encoding.rsplit('-', 1)[0] + + self.source = self.source.splitlines(True) + except (UnicodeError, IOError) as msg: + self.noResults = False + self.__createResultItem( + self.filename, 1, 1, + self.trUtf8("Error: {0}").format(str(msg)) + .rstrip()[1:-1], False, False) + self.progress += 1 + # Continue with next file + self.check() + return + + errors = [] + self.__itms = [] + for error, itm in onlyFixes.get(self.filename, []): + errors.append(error) + self.__itms.append(itm) + + eol = self.__getEol(self.filename) + args = self.__options + [errors, eol, encoding] + self.styleCheckService.styleCheck( + None, self.filename, self.source, args) + + def __processResult(self, fn, codeStyleCheckerStats, fixes, results): + """ + Privat slot called after perfoming a style check on one file. + + @param fn filename of the just checked file (str) + @param codeStyleCheckerStats stats of style and name check (dict) + @param fixes number of applied fixes (int) + @param results tuple for each found violation of style (tuple of + lineno (int), position (int), text (str), fixed (bool), + autofixing (bool)) + """ + # Check if it's the requested file, otherwise ignore signal + if fn != self.filename: + return + + # disable updates of the list for speed + self.resultList.setUpdatesEnabled(False) + self.resultList.setSortingEnabled(False) + + fixed = None + if self.__itms: + for itm, (lineno, position, text, fixed, autofixing) in zip( + self.__itms, results): + self.__modifyFixedResultItem(itm, text, fixed) + self.__updateFixerStatistics(fixes) + else: + for lineno, position, text, fixed, autofixing in results: + self.noResults = False + self.__createResultItem( + fn, lineno, position, text, fixed, autofixing) + + self.__updateStatistics(codeStyleCheckerStats, fixes) + + if fixed: + vm = e5App().getObject("ViewManager") + editor = vm.getOpenEditor(fn) + if editor: + editor.refresh() + + self.progress += 1 + + self.__resort() + # reenable updates of the list + self.resultList.setSortingEnabled(True) + self.resultList.setUpdatesEnabled(True) + + self.checkProgress.setValue(self.progress) + QApplication.processEvents() + + self.check() def __finish(self): """ @@ -557,6 +475,19 @@ self.checkProgress.setVisible(False) self.checkProgressLabel.setVisible(False) + def __getEol(self, fn): + """ + Private method to get the applicable eol string. + + @param fn filename where to determine the line ending (str) + @return eol string (string) + """ + if self.__project.isOpen() and self.__project.isProjectFile(fn): + eol = self.__project.getEolString() + else: + eol = Utilities.linesep() + return eol + @pyqtSlot() def on_startButton_clicked(self): """ @@ -657,7 +588,7 @@ editor.toggleSyntaxError(lineno, 0, True, message, True) else: editor.toggleWarning( - lineno, True, message, warningType=editor.WarningStyle) + lineno, 0, True, message, warningType=editor.WarningStyle) @pyqtSlot() def on_resultList_itemSelectionChanged(self): @@ -690,7 +621,7 @@ lineno = citm.data(0, self.lineRole) message = citm.data(0, self.messageRole) editor.toggleWarning( - lineno, True, message, warningType=editor.WarningStyle) + lineno, 0, True, message, warningType=editor.WarningStyle) # go through the list again to clear warning markers for files, # that are ok @@ -819,82 +750,39 @@ def on_fixButton_clicked(self): """ Private slot to fix selected issues. + + Build a dictionary of issues to fix. Update the initialized __options. + Then call check with the dict as keyparam to fix selected issues. """ - from .CodeStyleFixer import CodeStyleFixer - - # build a dictionary of issues to fix fixableItems = self.__getSelectedFixableItems() - fixesDict = {} # dictionary of lists of tuples containing - # the issue and the item + # dictionary of lists of tuples containing the issue and the item + fixesDict = {} for itm in fixableItems: filename = itm.data(0, self.filenameRole) if filename not in fixesDict: fixesDict[filename] = [] fixesDict[filename].append(( - (itm.data(0, self.lineRole), + (filename, itm.data(0, self.lineRole), itm.data(0, self.positionRole), "{0} {1}".format(itm.data(0, self.codeRole), itm.data(0, self.messageRole))), itm )) - # extract the configuration values - fixCodes = self.fixIssuesEdit.text() - noFixCodes = self.noFixIssuesEdit.text() - maxLineLength = self.lineLengthSpinBox.value() + # update the configuration values (3: fixCodes, 4: noFixCodes, + # 5: fixIssues, 6: maxLineLength) + self.__options[3] = self.fixIssuesEdit.text() + self.__options[4] = self.noFixIssuesEdit.text() + self.__options[5] = True + self.__options[6] = self.lineLengthSpinBox.value() + self.files = list(fixesDict.keys()) # now go through all the files - if fixesDict: - self.checkProgress.setMaximum(len(fixesDict)) - progress = 0 - for file in fixesDict: - self.checkProgress.setValue(progress) - QApplication.processEvents() - - try: - source, encoding = Utilities.readEncodedFile(file) - source = source.splitlines(True) - except (UnicodeError, IOError) as msg: - # skip silently because that should not happen - progress += 1 - continue - - deferredFixes = {} - fixer = CodeStyleFixer( - self.__project, file, source, fixCodes, noFixCodes, - maxLineLength, True) # always fix in place - errors = fixesDict[file] - errors.sort(key=lambda a: a[0][0]) - for error in errors: - (lineno, position, text), itm = error - if lineno > len(source): - lineno = len(source) - fixed, msg, id_ = fixer.fixIssue(lineno, position, text) - if fixed == 1: - text = "\n" + self.trUtf8("Fix: {0}").format(msg) - self.__modifyFixedResultItem(itm, text, True) - elif fixed == 0: - self.__modifyFixedResultItem(itm, "", False) - else: - # remember item for the deferred fix - deferredFixes[id_] = itm - deferredResults = fixer.finalize() - for id_ in deferredResults: - fixed, msg = deferredResults[id_] - itm = deferredFixes[id_] - if fixed == 1: - text = "\n" + self.trUtf8("Fix: {0}").format(msg) - self.__modifyFixedResultItem(itm, text, True) - else: - self.__modifyFixedResultItem(itm, "", False) - fixer.saveFile(encoding) - - self.__updateFixerStatistics(fixer) - progress += 1 - - self.checkProgress.setValue(progress) - QApplication.processEvents() - + self.progress = 0 + self.files.sort() + self.cancelled = False + self.check(onlyFixes=fixesDict) + def __getSelectedFixableItems(self): """ Private method to extract all selected items for fixable issues.
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sun Mar 30 22:00:14 2014 +0200 @@ -7,20 +7,23 @@ Module implementing a class to fix certain code style issues. """ -from __future__ import unicode_literals - +try: + # Python 2 + from StringIO import StringIO # __IGNORE_EXCEPTION__ +except ImportError: + # Python 3 + from io import StringIO # __IGNORE_WARNING__ import os import re +import sys import tokenize -import io - -from PyQt4.QtCore import QObject -from E5Gui import E5MessageBox - -from . import pep8 - -import Utilities +# CodeStyleCheckerDialog tries to import FixableCodeStyleIssues what fail under +# Python3. So ignore it. +try: + import pep8 +except ImportError: + pass FixableCodeStyleIssues = [ "D111", "D112", "D113", "D121", "D131", "D141", @@ -40,16 +43,15 @@ ] -class CodeStyleFixer(QObject): +class CodeStyleFixer(object): """ Class implementing a fixer for certain code style issues. """ - def __init__(self, project, filename, sourceLines, fixCodes, noFixCodes, - maxLineLength, inPlace): + def __init__(self, filename, sourceLines, fixCodes, noFixCodes, + maxLineLength, inPlace, eol): """ Constructor - @param project reference to the project object (Project) @param filename name of the file to be fixed (string) @param sourceLines list of source lines including eol marker (list of string) @@ -59,10 +61,10 @@ separated string (string) @param maxLineLength maximum allowed line length (integer) @param inPlace flag indicating to modify the file in place (boolean) + @param eol end of line character(s) (string) """ super(CodeStyleFixer, self).__init__() - self.__project = project self.__filename = filename self.__origName = "" self.__source = sourceLines[:] # save a copy @@ -73,15 +75,18 @@ self.fixed = 0 self.__reindenter = None - self.__eol = "" self.__indentWord = self.__getIndentWord() - if not inPlace: + if inPlace: + # TODO: Do a backup before any changes + pass + else: self.__origName = self.__filename self.__filename = os.path.join( os.path.dirname(self.__filename), "fixed_" + os.path.basename(self.__filename)) - + self.__eol = eol + self.__fixes = { "D111": self.__fixD111, "D112": self.__fixD112, @@ -174,27 +179,27 @@ Public method to save the modified file. @param encoding encoding of the source file (string) - @return flag indicating success (boolean) + @return error message on failure (tuple of str) """ + import codecs + if not self.__modified: # no need to write - return True + return txt = "".join(self.__source) try: - Utilities.writeEncodedFile(self.__filename, txt, encoding) - except (IOError, Utilities.CodingError, UnicodeError) as err: - E5MessageBox.critical( - self, - self.trUtf8("Fix Code Style Issues"), - self.trUtf8( - """<p>Could not save the file <b>{0}</b>.""" - """ Skipping it.</p><p>Reason: {1}</p>""") - .format(self.__filename, str(err)) - ) - return False - - return True + if sys.version_info[0] == 3: + txt = txt.encode(encoding) + if encoding == 'utf-8-bom': + txt = codecs.BOM_UTF8 + txt + + with open(self.__filename, "wb") as fp: + fp.write(txt) + except (IOError, UnicodeError) as err: + # Could not save the file! Skipping it. Reason: {0} + return ("FWRITE_ERROR", (str(err),)) + return def __codeMatch(self, code): """ @@ -237,7 +242,10 @@ a message for the fix (string) and an ID for a deferred fix (integer) """ - code = message.split(None, 1)[0].strip() + if isinstance(message, (tuple, list)): + code = message[0].strip() + else: + code = message.split(None, 1)[0].strip() if line <= len(self.__source) and \ self.__codeMatch(code) and \ @@ -286,24 +294,6 @@ self.__lastID += 1 return self.__lastID - def __getEol(self): - """ - Private method to get the applicable eol string. - - @return eol string (string) - """ - if not self.__eol: - if self.__origName: - fn = self.__origName - else: - fn = self.__filename - - if self.__project.isOpen() and self.__project.isProjectFile(fn): - self.__eol = self.__project.getEolString() - else: - self.__eol = Utilities.linesep() - return self.__eol - def __findLogical(self): """ Private method to extract the index of all the starts and ends of @@ -315,7 +305,7 @@ logical_start = [] logical_end = [] last_newline = True - sio = io.StringIO("".join(self.__source)) + sio = StringIO("".join(self.__source)) parens = 0 for t in tokenize.generate_tokens(sio.readline): if t[0] in [tokenize.COMMENT, tokenize.DEDENT, @@ -374,7 +364,7 @@ @return string to be used for an indentation (string) """ - sio = io.StringIO("".join(self.__source)) + sio = StringIO("".join(self.__source)) indentWord = " " # default in case of failure try: for token in tokenize.generate_tokens(sio.readline): @@ -405,7 +395,7 @@ """ if self.__multiLineNumbers is None: source = "".join(self.__source) - sio = io.StringIO(source) + sio = StringIO(source) self.__multiLineNumbers = set() self.__docLineNumbers = set() previousTokenType = '' @@ -511,11 +501,8 @@ break line += 1 - return ( - 1, - self.trUtf8( - "Triple single quotes converted to triple double quotes."), - 0) + # Triple single quotes converted to triple double quotes. + return (1, "FD111", 0) def __fixD112(self, code, line, pos): """ @@ -541,11 +528,8 @@ newText = self.__getIndent(self.__source[line]) + \ insertChar + self.__source[line].lstrip() self.__source[line] = newText - return ( - 1, - self.trUtf8('Introductory quotes corrected to be {0}"""') - .format(insertChar), - 0) + # Introductory quotes corrected to be {0}""" + return (1, ('FD112', (insertChar,)), 0) def __fixD121(self, code, line, pos, apply=False): """ @@ -572,17 +556,15 @@ docstring = self.__source[line].rstrip() + \ self.__source[line + 1].strip() if docstring.endswith('"""'): - docstring += self.__getEol() + docstring += self.__eol else: docstring += self.__source[line + 2].lstrip() self.__source[line + 2] = "" self.__source[line] = docstring self.__source[line + 1] = "" - return ( - 1, - self.trUtf8("Single line docstring put on one line."), - 0) + # Single line docstring put on one line. + return (1, "FD121", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -608,18 +590,19 @@ self.__source[line].lstrip().startswith(('"""', 'r"""', 'u"""')): # it is a one-liner newText = self.__source[line].rstrip()[:-3].rstrip() + "." + \ - self.__source[line].rstrip()[-3:] + self.__getEol() + self.__source[line].rstrip()[-3:] + self.__eol else: if line < len(self.__source) - 1 and \ (not self.__source[line + 1].strip() or self.__source[line + 1].lstrip().startswith("@") or (self.__source[line + 1].strip() in ('"""', "'''") and not self.__source[line].lstrip().startswith("@"))): - newText = self.__source[line].rstrip() + "." + self.__getEol() + newText = self.__source[line].rstrip() + "." + self.__eol if newText: self.__source[line] = newText - return (1, self.trUtf8("Period added to summary line."), 0) + # Period added to summary line. + return (1, "FD131", 0) else: return (0, "", 0) @@ -642,11 +625,8 @@ if apply: line = line - 1 self.__source[line - 1] = "" - return ( - 1, - self.trUtf8( - "Blank line before function/method docstring removed."), - 0) + # Blank line before function/method docstring removed. + return (1, "FD141", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -670,11 +650,9 @@ """ if apply: line = line - 1 - self.__source[line] = self.__getEol() + self.__source[line] - return ( - 1, - self.trUtf8("Blank line inserted before class docstring."), - 0) + self.__source[line] = self.__eol + self.__source[line] + # Blank line inserted before class docstring. + return (1, "FD142", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -698,11 +676,9 @@ """ if apply: line = line - 1 - self.__source[line] += self.__getEol() - return ( - 1, - self.trUtf8("Blank line inserted after class docstring."), - 0) + self.__source[line] += self.__eol + # Blank line inserted after class docstring. + return (1, "FD143", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -730,11 +706,9 @@ # only correct summary lines can be fixed here return (0, "", 0) - self.__source[line] += self.__getEol() - return ( - 1, - self.trUtf8("Blank line inserted after docstring summary."), - 0) + self.__source[line] += self.__eol + # Blank line inserted after docstring summary. + return (1, "FD144", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -758,12 +732,9 @@ """ if apply: line = line - 1 - self.__source[line] = self.__getEol() + self.__source[line] - return ( - 1, - self.trUtf8("Blank line inserted after last paragraph" - " of docstring."), - 0) + self.__source[line] = self.__eol + self.__source[line] + # Blank line inserted after last paragraph of docstring. + return (1, "FD145", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -798,13 +769,15 @@ else: # trailing first, second = source[:-3].strip(), source[-3:] - newText = indent + first + self.__getEol() + \ - indent + second + self.__getEol() + newText = indent + first + self.__eol + \ + indent + second + self.__eol self.__source[line] = newText if code == "D221": - msg = self.trUtf8("Leading quotes put on separate line.") + # Leading quotes put on separate line. + msg = "FD221" else: - msg = self.trUtf8("Trailing quotes put on separate line.") + # Trailing quotes put on separate line. + msg = "FD222" return (1, msg, 0) else: id = self.__getID() @@ -831,10 +804,11 @@ line = line - 1 self.__source[line - 1] = "" if code == "D242": - msg = self.trUtf8("Blank line before class docstring removed.") + # Blank line before class docstring removed. + msg = "FD242" else: - msg = self.trUtf8( - "Blank line before function/method docstring removed.") + # Blank line before function/method docstring removed. + msg = "FD244" return (1, msg, 0) else: id = self.__getID() @@ -861,10 +835,11 @@ line = line - 1 self.__source[line + 1] = "" if code == "D243": - msg = self.trUtf8("Blank line after class docstring removed.") + # Blank line after class docstring removed. + msg = "FD243" else: - msg = self.trUtf8( - "Blank line after function/method docstring removed.") + # Blank line after function/method docstring removed. + msg = "FD245" return (1, msg, 0) else: id = self.__getID() @@ -890,10 +865,8 @@ if apply: line = line - 1 self.__source[line - 1] = "" - return ( - 1, - self.trUtf8("Blank line after last paragraph removed."), - 0) + # Blank line after last paragraph removed. + return (1, "FD247", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -919,10 +892,11 @@ if fixedLine is not None and fixedLine != self.__source[line - 1]: self.__source[line - 1] = fixedLine if code in ["E101", "W191"]: - msg = self.trUtf8("Tab converted to 4 spaces.") + # Tab converted to 4 spaces. + msg = "FE101" else: - msg = self.trUtf8( - "Indentation adjusted to be a multiple of four.") + # Indentation adjusted to be a multiple of four. + msg = "FE111" return (1, msg, 0) else: return (0, "", 0) @@ -950,11 +924,11 @@ changed = self.__fixReindent(line, pos, logical) if changed: if code == "E121": - msg = self.trUtf8( - "Indentation of continuation line corrected.") + # Indentation of continuation line corrected. + msg = "FE121" elif code == "E124": - msg = self.trUtf8( - "Indentation of closing bracket corrected.") + # Indentation of closing bracket corrected. + msg = "FE124" return (1, msg, 0) return (0, "", 0) else: @@ -989,11 +963,8 @@ indentation = self.__getIndent(text) self.__source[line] = indentation + \ self.__indentWord + text.lstrip() - return ( - 1, - self.trUtf8( - "Missing indentation of continuation line corrected."), - 0) + # Missing indentation of continuation line corrected. + return (1, "FE122", 0) return (0, "", 0) else: id = self.__getID() @@ -1030,9 +1001,8 @@ self.__source[row] = newText changed = True if changed: - return (1, self.trUtf8( - "Closing bracket aligned to opening bracket."), - 0) + # Closing bracket aligned to opening bracket. + return (1, "FE123", 0) return (0, "", 0) else: id = self.__getID() @@ -1065,7 +1035,8 @@ text = self.__source[row] self.__source[row] = self.__getIndent(text) + \ self.__indentWord + text.lstrip() - return (1, self.trUtf8("Indentation level changed."), 0) + # Indentation level changed. + return (1, "FE125", 0) return (0, "", 0) else: id = self.__getID() @@ -1104,9 +1075,8 @@ self.__source[row] = newText changed = True if changed: - return (1, self.trUtf8( - "Indentation level of hanging indentation changed."), - 0) + # Indentation level of hanging indentation changed. + return (1, "FE126", 0) return (0, "", 0) else: id = self.__getID() @@ -1160,7 +1130,8 @@ self.__source[row] = newText changed = True if changed: - return (1, self.trUtf8("Visual indentation corrected."), 0) + # Visual indentation corrected. + return (1, "FE127", 0) return (0, "", 0) else: id = self.__getID() @@ -1191,7 +1162,8 @@ return (0, "", 0) self.__source[line] = newText - return (1, self.trUtf8("Extraneous whitespace removed."), 0) + # Extraneous whitespace removed. + return (1, "FE201", 0) def __fixE221(self, code, line, pos): """ @@ -1220,9 +1192,11 @@ self.__source[line] = newText if code in ["E225", "E226", "E227", "E228"]: - return (1, self.trUtf8("Missing whitespace added."), 0) + # Missing whitespace added. + return (1, "", 0) else: - return (1, self.trUtf8("Extraneous whitespace removed."), 0) + # Extraneous whitespace removed. + return (1, "", 0) def __fixE231(self, code, line, pos): """ @@ -1241,7 +1215,8 @@ pos = pos + 1 self.__source[line] = self.__source[line][:pos] + \ " " + self.__source[line][pos:] - return (1, self.trUtf8("Missing whitespace added."), 0) + # Missing whitespace added. + return (1, "FE231", 0) def __fixE251(self, code, line, pos): """ @@ -1278,7 +1253,8 @@ self.__source[line + 1] = self.__source[line + 1].lstrip() else: self.__source[line] = newText - return (1, self.trUtf8("Extraneous whitespace removed."), 0) + # Extraneous whitespace removed. + return (1, "FE251", 0) def __fixE261(self, code, line, pos): """ @@ -1299,7 +1275,8 @@ right = text[pos:].lstrip(' \t#') newText = left + (" # " + right if right.strip() else right) self.__source[line] = newText - return (1, self.trUtf8("Whitespace around comment sign corrected."), 0) + # Whitespace around comment sign corrected. + return (1, "FE261", 0) def __fixE301(self, code, line, pos, apply=False): """ @@ -1317,8 +1294,9 @@ fix (integer) """ if apply: - self.__source.insert(line - 1, self.__getEol()) - return (1, self.trUtf8("One blank line inserted."), 0) + self.__source.insert(line - 1, self.__eol) + # One blank line inserted. + return (1, "FE301", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1355,30 +1333,20 @@ if delta < 0: # insert blank lines (one or two) while delta < 0: - self.__source.insert(line, self.__getEol()) + self.__source.insert(line, self.__eol) delta += 1 - changed = True + # %n blank line(s) inserted. + return (1, ("FE302+", 2 - blanks), 0) elif delta > 0: # delete superfluous blank lines while delta > 0: del self.__source[line - 1] line -= 1 delta -= 1 - changed = True + # %n superfluous line(s) removed. + return (1, ("FE302-", blanks - 2), 0) else: - changed = False - - if changed: - if delta < 0: - msg = self.trUtf8( - "%n blank line(s) inserted.", "", -delta) - elif delta > 0: - msg = self.trUtf8( - "%n superfluous lines removed", "", delta) - else: - msg = "" - return (1, msg, 0) - return (0, "", 0) + return (0, "", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1407,7 +1375,8 @@ index -= 1 else: break - return (1, self.trUtf8("Superfluous blank lines removed."), 0) + # Superfluous blank lines removed. + return (1, "FE303", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1437,9 +1406,8 @@ index -= 1 else: break - return (1, self.trUtf8( - "Superfluous blank lines after function decorator removed."), - 0) + # Superfluous blank lines after function decorator removed. + return (1, "FE304", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1472,10 +1440,11 @@ if ';' in text: return (0, "", 0) - newText = text[:pos].rstrip("\t ,") + self.__getEol() + \ + newText = text[:pos].rstrip("\t ,") + self.__eol + \ self.__getIndent(text) + "import " + text[pos:].lstrip("\t ,") self.__source[line] = newText - return (1, self.trUtf8("Imports were put on separate lines."), 0) + # Imports were put on separate lines. + return (1, "FE401", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1512,7 +1481,7 @@ nextText = "" shortener = LineShortener( text, prevText, nextText, - maxLength=self.__maxLineLength, eol=self.__getEol(), + maxLength=self.__maxLineLength, eol=self.__eol, indentWord=self.__indentWord, isDocString=isDocString) changed, newText, newNextText = shortener.shorten() if changed: @@ -1522,7 +1491,8 @@ if newNextText == " ": newNextText = "" self.__source[line + 1] = newNextText - return (1, self.trUtf8("Long lines have been shortened."), 0) + # Long lines have been shortened. + return (1, "FE501", 0) else: return (0, "", 0) else: @@ -1544,8 +1514,9 @@ fix (integer) """ self.__source[line - 1] = \ - self.__source[line - 1].rstrip("\n\r \t\\") + self.__getEol() - return (1, self.trUtf8("Redundant backslash in brackets removed."), 0) + self.__source[line - 1].rstrip("\n\r \t\\") + self.__eol + # Redundant backslash in brackets removed. + return (1, "FE502", 0) def __fixE701(self, code, line, pos, apply=False): """ @@ -1567,11 +1538,12 @@ text = self.__source[line] pos = pos + 1 - newText = text[:pos] + self.__getEol() + self.__getIndent(text) + \ + newText = text[:pos] + self.__eol + self.__getIndent(text) + \ self.__indentWord + text[pos:].lstrip("\n\r \t\\") + \ - self.__getEol() + self.__eol self.__source[line] = newText - return (1, self.trUtf8("Compound statement corrected."), 0) + # Compound statement corrected. + return (1, "FE701", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1601,12 +1573,13 @@ self.__source[line] = text.rstrip("\n\r \t\\") self.__source[line + 1] = self.__source[line + 1].lstrip() elif text.rstrip().endswith(";"): - self.__source[line] = text.rstrip("\n\r \t;") + self.__getEol() + self.__source[line] = text.rstrip("\n\r \t;") + self.__eol else: - first = text[:pos].rstrip("\n\r \t;") + self.__getEol() + first = text[:pos].rstrip("\n\r \t;") + self.__eol second = text[pos:].lstrip("\n\r \t;") self.__source[line] = first + self.__getIndent(text) + second - return (1, self.trUtf8("Compound statement corrected."), 0) + # Compound statement corrected. + return (1, "FE702", 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1647,7 +1620,8 @@ return (0, "", 0) self.__source[line] = " ".join([left, center, right]) - return (1, self.trUtf8("Comparison to None/True/False corrected."), 0) + # Comparison to None/True/False corrected. + return (1, "FE711", 0) def __fixN804(self, code, line, pos, apply=False): """ @@ -1675,7 +1649,7 @@ if text.rstrip().endswith("("): newText = text + self.__getIndent(text) + \ - self.__indentWord + arg + "," + self.__getEol() + self.__indentWord + arg + "," + self.__eol else: index = text.find("(") + 1 left = text[:index] @@ -1686,7 +1660,8 @@ center = arg + ", " newText = left + center + right self.__source[line] = newText - return (1, self.trUtf8("'{0}' argument added.").format(arg), 0) + # '{0}' argument added. + return (1, ("FN804", (arg,)), 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1746,7 +1721,8 @@ else: self.__source[line] = indent + right - return (1, self.trUtf8("'{0}' argument removed.").format(arg), 0) + # '{0}' argument removed. + return (1, ("FN806", arg), 0) else: id = self.__getID() self.__stack.append((id, code, line, pos)) @@ -1767,7 +1743,8 @@ """ self.__source[line - 1] = re.sub(r'[\t ]+(\r?)$', r"\1", self.__source[line - 1]) - return (1, self.trUtf8("Whitespace stripped from end of line."), 0) + # Whitespace stripped from end of line. + return (1, "FW291", 0) def __fixW292(self, code, line, pos): """ @@ -1782,8 +1759,9 @@ a message for the fix (string) and an ID for a deferred fix (integer) """ - self.__source[line - 1] += self.__getEol() - return (1, self.trUtf8("newline added to end of file."), 0) + self.__source[line - 1] += self.__eol + # newline added to end of file. + return (1, "FW292", 0) def __fixW391(self, code, line, pos): """ @@ -1805,8 +1783,8 @@ index -= 1 else: break - return (1, self.trUtf8( - "Superfluous trailing blank lines removed from end of file."), 0) + # Superfluous trailing blank lines removed from end of file. + return (1, "FW391", 0) def __fixW603(self, code, line, pos): """ @@ -1822,7 +1800,8 @@ fix (integer) """ self.__source[line - 1] = self.__source[line - 1].replace("<>", "!=") - return (1, self.trUtf8("'<>' replaced by '!='."), 0) + # '<>' replaced by '!='. + return (1, "FW603", 0) class Reindenter(object): @@ -2043,7 +2022,7 @@ self.lines = physical_lines self.tokens = [] self.rel_indent = None - sio = io.StringIO(''.join(physical_lines)) + sio = StringIO(''.join(physical_lines)) for t in tokenize.generate_tokens(sio.readline): if not len(self.tokens) and t[0] in self.SKIP_TOKENS: continue @@ -2338,7 +2317,7 @@ indent = self.__getIndent(self.__text) source = self.__text[len(indent):] assert source.lstrip() == source - sio = io.StringIO(source) + sio = StringIO(source) # Check for multi line string. try:
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py Sun Mar 30 22:00:14 2014 +0200 @@ -10,12 +10,10 @@ from __future__ import unicode_literals -from PyQt4.QtCore import Qt, QCoreApplication +from PyQt4.QtCore import Qt from PyQt4.QtGui import QDialog, QTreeWidgetItem -from . import pep8 -from .NamingStyleChecker import NamingStyleChecker -from .DocStyleChecker import DocStyleChecker +from .translations import _messages, _messages_sample_args from .Ui_CodeStyleStatisticsDialog import Ui_CodeStyleStatisticsDialog @@ -48,21 +46,13 @@ totalIssues = 0 for code in sorted(stats.keys()): - if code in pep8.pep8_messages_sample_args: - message = QCoreApplication.translate( - "pep8", pep8.pep8_messages[code]).format( - *pep8.pep8_messages_sample_args[code]) - elif code in pep8.pep8_messages: - message = QCoreApplication.translate( - "pep8", pep8.pep8_messages[code]) - elif code in NamingStyleChecker.Messages: - message = QCoreApplication.translate( - "NamingStyleChecker", NamingStyleChecker.Messages[code]) - elif code in DocStyleChecker.Messages: - message = QCoreApplication.translate( - "DocStyleChecker", DocStyleChecker.Messages[code]) - else: + message = _messages.get(code) + if message is None: continue + + if code in _messages_sample_args: + message = message.format(*_messages_sample_args[code]) + self.__createItem(stats[code], code, message) totalIssues += stats[code]
--- a/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/DocStyleChecker.py Sun Mar 30 22:00:14 2014 +0200 @@ -7,8 +7,6 @@ Module implementing a checker for documentation string conventions. """ -from __future__ import unicode_literals - # # The routines of the checker class are modeled after the ones found in # pep257.py (version 0.2.4). @@ -24,10 +22,6 @@ import ast import sys -from PyQt4.QtCore import QT_TRANSLATE_NOOP, QCoreApplication - -PyCF_ONLY_AST = 1024 - class DocStyleContext(object): """ @@ -123,128 +117,7 @@ "D901", ] - - Messages = { - "D101": QT_TRANSLATE_NOOP( - "DocStyleChecker", "module is missing a docstring"), - "D102": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "public function/method is missing a docstring"), - "D103": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "private function/method may be missing a docstring"), - "D104": QT_TRANSLATE_NOOP( - "DocStyleChecker", "public class is missing a docstring"), - "D105": QT_TRANSLATE_NOOP( - "DocStyleChecker", "private class may be missing a docstring"), - "D111": QT_TRANSLATE_NOOP( - "DocStyleChecker", 'docstring not surrounded by """'), - "D112": QT_TRANSLATE_NOOP( - "DocStyleChecker", - 'docstring containing \\ not surrounded by r"""'), - "D113": QT_TRANSLATE_NOOP( - "DocStyleChecker", - 'docstring containing unicode character not surrounded by u"""'), - "D121": QT_TRANSLATE_NOOP( - "DocStyleChecker", "one-liner docstring on multiple lines"), - "D122": QT_TRANSLATE_NOOP( - "DocStyleChecker", "docstring has wrong indentation"), - "D130": QT_TRANSLATE_NOOP( - "DocStyleChecker", "docstring does not contain a summary"), - "D131": QT_TRANSLATE_NOOP( - "DocStyleChecker", "docstring summary does not end with a period"), - "D132": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring summary is not in imperative mood" - " (Does instead of Do)"), - "D133": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring summary looks like a function's/method's signature"), - "D134": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring does not mention the return value type"), - "D141": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "function/method docstring is separated by a blank line"), - "D142": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "class docstring is not preceded by a blank line"), - "D143": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "class docstring is not followed by a blank line"), - "D144": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring summary is not followed by a blank line"), - "D145": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "last paragraph of docstring is not followed by a blank line"), - - "D203": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "private function/method is missing a docstring"), - "D205": QT_TRANSLATE_NOOP( - "DocStyleChecker", "private class is missing a docstring"), - "D221": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "leading quotes of docstring not on separate line"), - "D222": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "trailing quotes of docstring not on separate line"), - "D231": QT_TRANSLATE_NOOP( - "DocStyleChecker", "docstring summary does not end with a period"), - "D234": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring does not contain a @return line but function/method" - " returns something"), - "D235": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring contains a @return line but function/method doesn't" - " return anything"), - "D236": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring does not contain enough @param/@keyparam lines"), - "D237": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring contains too many @param/@keyparam lines"), - "D238": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "keyword only arguments must be documented with @keyparam lines"), - "D239": QT_TRANSLATE_NOOP( - "DocStyleChecker", "order of @param/@keyparam lines does" - " not match the function/method signature"), - "D242": QT_TRANSLATE_NOOP( - "DocStyleChecker", "class docstring is preceded by a blank line"), - "D243": QT_TRANSLATE_NOOP( - "DocStyleChecker", "class docstring is followed by a blank line"), - "D244": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "function/method docstring is preceded by a blank line"), - "D245": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "function/method docstring is followed by a blank line"), - "D246": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring summary is not followed by a blank line"), - "D247": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "last paragraph of docstring is followed by a blank line"), - "D250": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring does not contain a @exception line but function/method" - " raises an exception"), - "D251": QT_TRANSLATE_NOOP( - "DocStyleChecker", - "docstring contains a @exception line but function/method doesn't" - " raise an exception"), - - "D901": QT_TRANSLATE_NOOP( - "DocStyleChecker", "{0}: {1}"), - } - MessagesSampleArgs = { - "D901": ["SyntaxError", "Invalid Syntax"], - } - def __init__(self, source, filename, select, ignore, expected, repeat, maxLineLength=79, docType="pep257"): """ @@ -401,13 +274,9 @@ return if code and (self.counters[code] == 1 or self.__repeat): - if code in DocStyleChecker.Codes: - text = self.getMessage(code, *args) - else: - text = code + " " + QCoreApplication.translate( - "DocStyleChecker", "no message for this code defined") # record the issue with one based line number - self.errors.append((self.__filename, lineNumber + 1, offset, text)) + self.errors.append( + (self.__filename, lineNumber + 1, offset, (code, args))) def __reportInvalidSyntax(self): """ @@ -423,24 +292,6 @@ self.__error(offset[0] - 1, offset[1] or 0, 'D901', exc_type.__name__, exc.args[0]) - @classmethod - def getMessage(cls, code, *args): - """ - Class method to get a translated and formatted message for a - given code. - - @param code message code (string) - @param args arguments for a formatted message (list) - @return translated and formatted message (string) - """ - if code in DocStyleChecker.Messages: - return code + " " + QCoreApplication.translate( - "DocStyleChecker", - DocStyleChecker.Messages[code]).format(*args) - else: - return code + " " + QCoreApplication.translate( - "DocStyleChecker", "no message for this code defined") - def __resetReadline(self): """ Private method to reset the internal readline function. @@ -472,7 +323,7 @@ return try: - compile(''.join(self.__source), '', 'exec', PyCF_ONLY_AST) + compile(''.join(self.__source), '', 'exec', ast.PyCF_ONLY_AST) except (SyntaxError, TypeError): self.__reportInvalidSyntax() return
--- a/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py Sun Mar 30 22:00:14 2014 +0200 @@ -7,14 +7,11 @@ Module implementing a checker for naming conventions. """ -from __future__ import unicode_literals - import collections import ast import re import os - -from PyQt4.QtCore import QT_TRANSLATE_NOOP, QCoreApplication +import sys class NamingStyleChecker(object): @@ -30,51 +27,6 @@ "N801", "N802", "N803", "N804", "N805", "N806", "N807", "N808", "N811", "N812", "N813", "N814", "N821", "N831" ] - Messages = { - "N801": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "class names should use CapWords convention"), - "N802": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "function name should be lowercase"), - "N803": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "argument name should be lowercase"), - "N804": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "first argument of a class method should be named 'cls'"), - "N805": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "first argument of a method should be named 'self'"), - "N806": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "first argument of a static method should not be named" - " 'self' or 'cls"), - "N807": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "module names should be lowercase"), - "N808": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "package names should be lowercase"), - "N811": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "constant imported as non constant"), - "N812": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "lowercase imported as non lowercase"), - "N813": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "camelcase imported as lowercase"), - "N814": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "camelcase imported as constant"), - "N821": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "variable in function should be lowercase"), - "N831": QT_TRANSLATE_NOOP( - "NamingStyleChecker", - "names 'l', 'O' and 'I' should be avoided"), - } def __init__(self, tree, filename, options): """ @@ -132,25 +84,6 @@ else: return () - @classmethod - def getMessage(cls, code, *args): - """ - Class method to get a translated and formatted message for a - given code. - - @param code message code (string) - @param args arguments for a formatted message (list) - @return translated and formatted message (string) - """ - if code in cls.Messages: - return code + " " + QCoreApplication.translate( - "NamingStyleChecker", - cls.Messages[code]).format(*args) - else: - return code + " " + QCoreApplication.translate( - "NamingStyleChecker", - "no message for this code defined") - def __visitTree(self, node): """ Private method to scan the given AST tree. @@ -249,9 +182,27 @@ @param node AST node to extract arguments names from @return list of argument names (list of string) """ - posArgs = [arg.arg for arg in node.args.args] - kwOnly = [arg.arg for arg in node.args.kwonlyargs] - return posArgs + kwOnly + if sys.version_info[0] == 3: + posArgs = [arg.arg for arg in node.args.args] + kwOnly = [arg.arg for arg in node.args.kwonlyargs] + return posArgs + kwOnly + else: + def unpackArgs(args): + """ + Local helper function to unpack function argument names. + + @param args list of AST node arguments + @return list of argument names (list of string) + """ + ret = [] + for arg in args: + if isinstance(arg, ast.Tuple): + ret.extend(unpackArgs(arg.elts)) + else: + ret.append(arg.id) + return ret + + return unpackArgs(node.args.args) def __error(self, node, code): """
--- a/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/pep8.py Sun Mar 30 22:00:14 2014 +0200 @@ -48,8 +48,6 @@ 900 syntax error """ -from __future__ import unicode_literals - # # This is a modified version to make the original pep8.py better suitable # for being called from within the eric5 IDE. The modifications are as @@ -78,8 +76,6 @@ except ImportError: from ConfigParser import RawConfigParser # __IGNORE_WARNING__ -from PyQt4.QtCore import QCoreApplication, QT_TRANSLATE_NOOP - DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__' DEFAULT_IGNORE = 'E123,E226,E24' if sys.platform == 'win32': @@ -130,164 +126,6 @@ ############################################################################## -# Helper functions for translated and formatted messages -############################################################################## - - -pep8_messages = { - "E101": QT_TRANSLATE_NOOP("pep8", - "indentation contains mixed spaces and tabs"), - "E111": QT_TRANSLATE_NOOP("pep8", - "indentation is not a multiple of four"), - "E112": QT_TRANSLATE_NOOP("pep8", - "expected an indented block"), - "E113": QT_TRANSLATE_NOOP("pep8", - "unexpected indentation"), - "E121": QT_TRANSLATE_NOOP("pep8", - "continuation line indentation is not a multiple of four"), - "E122": QT_TRANSLATE_NOOP("pep8", - "continuation line missing indentation or outdented"), - "E123": QT_TRANSLATE_NOOP("pep8", - "closing bracket does not match indentation of opening" - " bracket's line"), - "E124": QT_TRANSLATE_NOOP("pep8", - "closing bracket does not match visual indentation"), - "E125": QT_TRANSLATE_NOOP("pep8", - "continuation line does not distinguish itself from next" - " logical line"), - "E126": QT_TRANSLATE_NOOP("pep8", - "continuation line over-indented for hanging indent"), - "E127": QT_TRANSLATE_NOOP("pep8", - "continuation line over-indented for visual indent"), - "E128": QT_TRANSLATE_NOOP("pep8", - "continuation line under-indented for visual indent"), - "E133": QT_TRANSLATE_NOOP("pep8", - "closing bracket is missing indentation"), - "W191": QT_TRANSLATE_NOOP("pep8", - "indentation contains tabs"), - "E201": QT_TRANSLATE_NOOP("pep8", - "whitespace after '{0}'"), - "E202": QT_TRANSLATE_NOOP("pep8", - "whitespace before '{0}'"), - "E203": QT_TRANSLATE_NOOP("pep8", - "whitespace before '{0}'"), - "E211": QT_TRANSLATE_NOOP("pep8", - "whitespace before '{0}'"), - "E221": QT_TRANSLATE_NOOP("pep8", - "multiple spaces before operator"), - "E222": QT_TRANSLATE_NOOP("pep8", - "multiple spaces after operator"), - "E223": QT_TRANSLATE_NOOP("pep8", - "tab before operator"), - "E224": QT_TRANSLATE_NOOP("pep8", - "tab after operator"), - "E225": QT_TRANSLATE_NOOP("pep8", - "missing whitespace around operator"), - "E226": QT_TRANSLATE_NOOP("pep8", - "missing whitespace around arithmetic operator"), - "E227": QT_TRANSLATE_NOOP("pep8", - "missing whitespace around bitwise or shift operator"), - "E228": QT_TRANSLATE_NOOP("pep8", - "missing whitespace around modulo operator"), - "E231": QT_TRANSLATE_NOOP("pep8", - "missing whitespace after '{0}'"), - "E241": QT_TRANSLATE_NOOP("pep8", - "multiple spaces after '{0}'"), - "E242": QT_TRANSLATE_NOOP("pep8", - "tab after '{0}'"), - "E251": QT_TRANSLATE_NOOP("pep8", - "unexpected spaces around keyword / parameter equals"), - "E261": QT_TRANSLATE_NOOP("pep8", - "at least two spaces before inline comment"), - "E262": QT_TRANSLATE_NOOP("pep8", - "inline comment should start with '# '"), - "E271": QT_TRANSLATE_NOOP("pep8", - "multiple spaces after keyword"), - "E272": QT_TRANSLATE_NOOP("pep8", - "multiple spaces before keyword"), - "E273": QT_TRANSLATE_NOOP("pep8", - "tab after keyword"), - "E274": QT_TRANSLATE_NOOP("pep8", - "tab before keyword"), - "W291": QT_TRANSLATE_NOOP("pep8", - "trailing whitespace"), - "W292": QT_TRANSLATE_NOOP("pep8", - "no newline at end of file"), - "W293": QT_TRANSLATE_NOOP("pep8", - "blank line contains whitespace"), - "E301": QT_TRANSLATE_NOOP("pep8", - "expected 1 blank line, found 0"), - "E302": QT_TRANSLATE_NOOP("pep8", - "expected 2 blank lines, found {0}"), - "E303": QT_TRANSLATE_NOOP("pep8", - "too many blank lines ({0})"), - "E304": QT_TRANSLATE_NOOP("pep8", - "blank lines found after function decorator"), - "W391": QT_TRANSLATE_NOOP("pep8", - "blank line at end of file"), - "E401": QT_TRANSLATE_NOOP("pep8", - "multiple imports on one line"), - "E501": QT_TRANSLATE_NOOP("pep8", - "line too long ({0} > {1} characters)"), - "E502": QT_TRANSLATE_NOOP("pep8", - "the backslash is redundant between brackets"), - "W601": QT_TRANSLATE_NOOP("pep8", - ".has_key() is deprecated, use 'in'"), - "W602": QT_TRANSLATE_NOOP("pep8", - "deprecated form of raising exception"), - "W603": QT_TRANSLATE_NOOP("pep8", - "'<>' is deprecated, use '!='"), - "W604": QT_TRANSLATE_NOOP("pep8", - "backticks are deprecated, use 'repr()'"), - "E701": QT_TRANSLATE_NOOP("pep8", - "multiple statements on one line (colon)"), - "E702": QT_TRANSLATE_NOOP("pep8", - "multiple statements on one line (semicolon)"), - "E703": QT_TRANSLATE_NOOP("pep8", - "statement ends with a semicolon"), - "E711": QT_TRANSLATE_NOOP("pep8", - "comparison to {0} should be {1}"), - "E712": QT_TRANSLATE_NOOP("pep8", - "comparison to {0} should be {1}"), - "E721": QT_TRANSLATE_NOOP("pep8", - "do not compare types, use 'isinstance()'"), - "E901": QT_TRANSLATE_NOOP("pep8", - "{0}: {1}"), -} - -pep8_messages_sample_args = { - "E201": ["([{"], - "E202": ["}])"], - "E203": [",;:"], - "E211": ["(["], - "E231": [",;:"], - "E241": [",;:"], - "E242": [",;:"], - "E302": [1], - "E303": [3], - "E501": [85, 79], - "E711": ["None", "'if cond is None:'"], - "E712": ["True", "'if cond is True:' or 'if cond:'"], - "E901": ["SyntaxError", "Invalid Syntax"], -} - - -def getMessage(code, *args): - """ - Function to get a translated and formatted message for a given code. - - @param code message code (string) - @param args arguments for a formatted message (list) - @return translated and formatted message (string) - """ - if code in pep8_messages: - return code + " " + QCoreApplication.translate("pep8", - pep8_messages[code]).format(*args) - else: - return code + " " + QCoreApplication.translate("pep8", - "no message for this code defined") - -############################################################################## # Plugins (check functions) for physical lines ############################################################################## @@ -396,7 +234,7 @@ # The line could contain multi-byte characters try: length = len(line.decode('utf-8')) - except (UnicodeDecodeError, UnicodeEncodeError): + except UnicodeError: pass if length > max_line_length: return max_line_length, "E501", length, max_line_length @@ -782,6 +620,7 @@ elif len(after) > 1: yield match.start(2), "E222" + def missing_whitespace_around_operator(logical_line, tokens): r""" - Always surround these binary operators with a single space on @@ -1439,8 +1278,8 @@ if result is not None: offset, code = result[:2] args = result[2:] - self.report_error_args(self.line_number, offset, code, check, - *args) + self.report_error_args( + self.line_number, offset, code, check, *args) def build_tokens_line(self): """ @@ -1507,8 +1346,8 @@ if offset >= token_offset: orig_number = token[2][0] orig_offset = (token[2][1] + offset - token_offset) - self.report_error_args(orig_number, orig_offset, code, check, - *args) + self.report_error_args( + orig_number, orig_offset, code, check, *args) self.previous_logical = self.logical_line def check_ast(self): @@ -1629,7 +1468,7 @@ self.counters[code] += 1 else: self.counters[code] = 1 - self.messages[code] = text[5:] + self.messages[code] = [] # Don't care about expected errors or warnings if code in self.expected: return @@ -1643,12 +1482,11 @@ """Report an error, according to options.""" if self._ignore_code(code): return - text = getMessage(code, *args) if code in self.counters: self.counters[code] += 1 else: self.counters[code] = 1 - self.messages[code] = text[5:] + self.messages[code] = args # Don't care about expected errors or warnings if code in self.expected: return @@ -1730,9 +1568,8 @@ code = super(StandardReport, self).error_args(line_number, offset, code, check, *args) if code and (self.counters[code] == 1 or self._repeat): - text = getMessage(code, *args) self._deferred_print.append( - (line_number, offset, code, text[5:], check.__doc__)) + (line_number, offset, code, args, check.__doc__)) return code def get_file_results(self):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,552 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing message translations for the code style plugin messages. +""" + +from PyQt4.QtCore import QCoreApplication + +__all__ = ["getTranslatedMessage"] + +_messages = { + "E101": QCoreApplication.translate( + "pep8", + "indentation contains mixed spaces and tabs"), + "E111": QCoreApplication.translate( + "pep8", + "indentation is not a multiple of four"), + "E112": QCoreApplication.translate( + "pep8", + "expected an indented block"), + "E113": QCoreApplication.translate( + "pep8", + "unexpected indentation"), + "E121": QCoreApplication.translate( + "pep8", + "continuation line indentation is not a multiple of four"), + "E122": QCoreApplication.translate( + "pep8", + "continuation line missing indentation or outdented"), + "E123": QCoreApplication.translate( + "pep8", + "closing bracket does not match indentation of opening" + " bracket's line"), + "E124": QCoreApplication.translate( + "pep8", + "closing bracket does not match visual indentation"), + "E125": QCoreApplication.translate( + "pep8", + "continuation line does not distinguish itself from next" + " logical line"), + "E126": QCoreApplication.translate( + "pep8", + "continuation line over-indented for hanging indent"), + "E127": QCoreApplication.translate( + "pep8", + "continuation line over-indented for visual indent"), + "E128": QCoreApplication.translate( + "pep8", + "continuation line under-indented for visual indent"), + "E133": QCoreApplication.translate( + "pep8", + "closing bracket is missing indentation"), + "W191": QCoreApplication.translate( + "pep8", + "indentation contains tabs"), + "E201": QCoreApplication.translate( + "pep8", + "whitespace after '{0}'"), + "E202": QCoreApplication.translate( + "pep8", + "whitespace before '{0}'"), + "E203": QCoreApplication.translate( + "pep8", + "whitespace before '{0}'"), + "E211": QCoreApplication.translate( + "pep8", + "whitespace before '{0}'"), + "E221": QCoreApplication.translate( + "pep8", + "multiple spaces before operator"), + "E222": QCoreApplication.translate( + "pep8", + "multiple spaces after operator"), + "E223": QCoreApplication.translate( + "pep8", + "tab before operator"), + "E224": QCoreApplication.translate( + "pep8", + "tab after operator"), + "E225": QCoreApplication.translate( + "pep8", + "missing whitespace around operator"), + "E226": QCoreApplication.translate( + "pep8", + "missing whitespace around arithmetic operator"), + "E227": QCoreApplication.translate( + "pep8", + "missing whitespace around bitwise or shift operator"), + "E228": QCoreApplication.translate( + "pep8", + "missing whitespace around modulo operator"), + "E231": QCoreApplication.translate( + "pep8", + "missing whitespace after '{0}'"), + "E241": QCoreApplication.translate( + "pep8", + "multiple spaces after '{0}'"), + "E242": QCoreApplication.translate( + "pep8", + "tab after '{0}'"), + "E251": QCoreApplication.translate( + "pep8", + "unexpected spaces around keyword / parameter equals"), + "E261": QCoreApplication.translate( + "pep8", + "at least two spaces before inline comment"), + "E262": QCoreApplication.translate( + "pep8", + "inline comment should start with '# '"), + "E271": QCoreApplication.translate( + "pep8", + "multiple spaces after keyword"), + "E272": QCoreApplication.translate( + "pep8", + "multiple spaces before keyword"), + "E273": QCoreApplication.translate( + "pep8", + "tab after keyword"), + "E274": QCoreApplication.translate( + "pep8", + "tab before keyword"), + "W291": QCoreApplication.translate( + "pep8", + "trailing whitespace"), + "W292": QCoreApplication.translate( + "pep8", + "no newline at end of file"), + "W293": QCoreApplication.translate( + "pep8", + "blank line contains whitespace"), + "E301": QCoreApplication.translate( + "pep8", + "expected 1 blank line, found 0"), + "E302": QCoreApplication.translate( + "pep8", + "expected 2 blank lines, found {0}"), + "E303": QCoreApplication.translate( + "pep8", + "too many blank lines ({0})"), + "E304": QCoreApplication.translate( + "pep8", + "blank lines found after function decorator"), + "W391": QCoreApplication.translate( + "pep8", + "blank line at end of file"), + "E401": QCoreApplication.translate( + "pep8", + "multiple imports on one line"), + "E501": QCoreApplication.translate( + "pep8", + "line too long ({0} > {1} characters)"), + "E502": QCoreApplication.translate( + "pep8", + "the backslash is redundant between brackets"), + "W601": QCoreApplication.translate( + "pep8", + ".has_key() is deprecated, use 'in'"), + "W602": QCoreApplication.translate( + "pep8", + "deprecated form of raising exception"), + "W603": QCoreApplication.translate( + "pep8", + "'<>' is deprecated, use '!='"), + "W604": QCoreApplication.translate( + "pep8", + "backticks are deprecated, use 'repr()'"), + "E701": QCoreApplication.translate( + "pep8", + "multiple statements on one line (colon)"), + "E702": QCoreApplication.translate( + "pep8", + "multiple statements on one line (semicolon)"), + "E703": QCoreApplication.translate( + "pep8", + "statement ends with a semicolon"), + "E711": QCoreApplication.translate( + "pep8", + "comparison to {0} should be {1}"), + "E712": QCoreApplication.translate( + "pep8", + "comparison to {0} should be {1}"), + "E721": QCoreApplication.translate( + "pep8", + "do not compare types, use 'isinstance()'"), + "E901": QCoreApplication.translate( + "pep8", + "{0}: {1}"), + + # DocStyleChecker messages + "D101": QCoreApplication.translate( + "DocStyleChecker", "module is missing a docstring"), + "D102": QCoreApplication.translate( + "DocStyleChecker", + "public function/method is missing a docstring"), + "D103": QCoreApplication.translate( + "DocStyleChecker", + "private function/method may be missing a docstring"), + "D104": QCoreApplication.translate( + "DocStyleChecker", "public class is missing a docstring"), + "D105": QCoreApplication.translate( + "DocStyleChecker", "private class may be missing a docstring"), + "D111": QCoreApplication.translate( + "DocStyleChecker", 'docstring not surrounded by """'), + "D112": QCoreApplication.translate( + "DocStyleChecker", + 'docstring containing \\ not surrounded by r"""'), + "D113": QCoreApplication.translate( + "DocStyleChecker", + 'docstring containing unicode character not surrounded by u"""'), + "D121": QCoreApplication.translate( + "DocStyleChecker", "one-liner docstring on multiple lines"), + "D122": QCoreApplication.translate( + "DocStyleChecker", "docstring has wrong indentation"), + "D130": QCoreApplication.translate( + "DocStyleChecker", "docstring does not contain a summary"), + "D131": QCoreApplication.translate( + "DocStyleChecker", "docstring summary does not end with a period"), + "D132": QCoreApplication.translate( + "DocStyleChecker", + "docstring summary is not in imperative mood" + " (Does instead of Do)"), + "D133": QCoreApplication.translate( + "DocStyleChecker", + "docstring summary looks like a function's/method's signature"), + "D134": QCoreApplication.translate( + "DocStyleChecker", + "docstring does not mention the return value type"), + "D141": QCoreApplication.translate( + "DocStyleChecker", + "function/method docstring is separated by a blank line"), + "D142": QCoreApplication.translate( + "DocStyleChecker", + "class docstring is not preceded by a blank line"), + "D143": QCoreApplication.translate( + "DocStyleChecker", + "class docstring is not followed by a blank line"), + "D144": QCoreApplication.translate( + "DocStyleChecker", + "docstring summary is not followed by a blank line"), + "D145": QCoreApplication.translate( + "DocStyleChecker", + "last paragraph of docstring is not followed by a blank line"), + + "D203": QCoreApplication.translate( + "DocStyleChecker", + "private function/method is missing a docstring"), + "D205": QCoreApplication.translate( + "DocStyleChecker", "private class is missing a docstring"), + "D221": QCoreApplication.translate( + "DocStyleChecker", + "leading quotes of docstring not on separate line"), + "D222": QCoreApplication.translate( + "DocStyleChecker", + "trailing quotes of docstring not on separate line"), + "D231": QCoreApplication.translate( + "DocStyleChecker", "docstring summary does not end with a period"), + "D234": QCoreApplication.translate( + "DocStyleChecker", + "docstring does not contain a @return line but function/method" + " returns something"), + "D235": QCoreApplication.translate( + "DocStyleChecker", + "docstring contains a @return line but function/method doesn't" + " return anything"), + "D236": QCoreApplication.translate( + "DocStyleChecker", + "docstring does not contain enough @param/@keyparam lines"), + "D237": QCoreApplication.translate( + "DocStyleChecker", + "docstring contains too many @param/@keyparam lines"), + "D238": QCoreApplication.translate( + "DocStyleChecker", + "keyword only arguments must be documented with @keyparam lines"), + "D239": QCoreApplication.translate( + "DocStyleChecker", "order of @param/@keyparam lines does" + " not match the function/method signature"), + "D242": QCoreApplication.translate( + "DocStyleChecker", "class docstring is preceded by a blank line"), + "D243": QCoreApplication.translate( + "DocStyleChecker", "class docstring is followed by a blank line"), + "D244": QCoreApplication.translate( + "DocStyleChecker", + "function/method docstring is preceded by a blank line"), + "D245": QCoreApplication.translate( + "DocStyleChecker", + "function/method docstring is followed by a blank line"), + "D246": QCoreApplication.translate( + "DocStyleChecker", + "docstring summary is not followed by a blank line"), + "D247": QCoreApplication.translate( + "DocStyleChecker", + "last paragraph of docstring is followed by a blank line"), + "D250": QCoreApplication.translate( + "DocStyleChecker", + "docstring does not contain a @exception line but function/method" + " raises an exception"), + "D251": QCoreApplication.translate( + "DocStyleChecker", + "docstring contains a @exception line but function/method doesn't" + " raise an exception"), + + "D901": QCoreApplication.translate( + "DocStyleChecker", "{0}: {1}"), + + # NamingStyleChecker messages + "N801": QCoreApplication.translate( + "NamingStyleChecker", + "class names should use CapWords convention"), + "N802": QCoreApplication.translate( + "NamingStyleChecker", + "function name should be lowercase"), + "N803": QCoreApplication.translate( + "NamingStyleChecker", + "argument name should be lowercase"), + "N804": QCoreApplication.translate( + "NamingStyleChecker", + "first argument of a class method should be named 'cls'"), + "N805": QCoreApplication.translate( + "NamingStyleChecker", + "first argument of a method should be named 'self'"), + "N806": QCoreApplication.translate( + "NamingStyleChecker", + "first argument of a static method should not be named" + " 'self' or 'cls"), + "N807": QCoreApplication.translate( + "NamingStyleChecker", + "module names should be lowercase"), + "N808": QCoreApplication.translate( + "NamingStyleChecker", + "package names should be lowercase"), + "N811": QCoreApplication.translate( + "NamingStyleChecker", + "constant imported as non constant"), + "N812": QCoreApplication.translate( + "NamingStyleChecker", + "lowercase imported as non lowercase"), + "N813": QCoreApplication.translate( + "NamingStyleChecker", + "camelcase imported as lowercase"), + "N814": QCoreApplication.translate( + "NamingStyleChecker", + "camelcase imported as constant"), + "N821": QCoreApplication.translate( + "NamingStyleChecker", + "variable in function should be lowercase"), + "N831": QCoreApplication.translate( + "NamingStyleChecker", + "names 'l', 'O' and 'I' should be avoided"), + + # CodeStyleFixer messages + "FD111": QCoreApplication.translate( + 'CodeStyleFixer', + "Triple single quotes converted to triple double quotes."), + 'FD112': QCoreApplication.translate( + 'CodeStyleFixer', + 'Introductory quotes corrected to be {0}"""'), + "FD121": QCoreApplication.translate( + 'CodeStyleFixer', + "Single line docstring put on one line."), + "FD131": QCoreApplication.translate( + 'CodeStyleFixer', + "Period added to summary line."), + "FD141": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line before function/method docstring removed."), + "FD142": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line inserted before class docstring."), + "FD143": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line inserted after class docstring."), + "FD144": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line inserted after docstring summary."), + "FD145": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line inserted after last paragraph of docstring."), + "FD221": QCoreApplication.translate( + 'CodeStyleFixer', + "Leading quotes put on separate line."), + "FD222": QCoreApplication.translate( + 'CodeStyleFixer', + "Trailing quotes put on separate line."), + "FD242": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line before class docstring removed."), + "FD244": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line before function/method docstring removed."), + "FD243": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line after class docstring removed."), + "FD245": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line after function/method docstring removed."), + "FD247": QCoreApplication.translate( + 'CodeStyleFixer', + "Blank line after last paragraph removed."), + "FE101": QCoreApplication.translate( + 'CodeStyleFixer', + "Tab converted to 4 spaces."), + "FE111": QCoreApplication.translate( + 'CodeStyleFixer', + "Indentation adjusted to be a multiple of four."), + "FE121": QCoreApplication.translate( + 'CodeStyleFixer', + "Indentation of continuation line corrected."), + "FE124": QCoreApplication.translate( + 'CodeStyleFixer', + "Indentation of closing bracket corrected."), + "FE122": QCoreApplication.translate( + 'CodeStyleFixer', + "Missing indentation of continuation line corrected."), + "FE123": QCoreApplication.translate( + 'CodeStyleFixer', + "Closing bracket aligned to opening bracket."), + "FE125": QCoreApplication.translate( + 'CodeStyleFixer', + "Indentation level changed."), + "FE126": QCoreApplication.translate( + 'CodeStyleFixer', + "Indentation level of hanging indentation changed."), + "FE127": QCoreApplication.translate( + 'CodeStyleFixer', + "Visual indentation corrected."), + "FE201": QCoreApplication.translate( + 'CodeStyleFixer', + "Extraneous whitespace removed."), + "FE225": QCoreApplication.translate( + 'CodeStyleFixer', + "Missing whitespace added."), + "FE221": QCoreApplication.translate( + 'CodeStyleFixer', + "Extraneous whitespace removed."), + "FE231": QCoreApplication.translate( + 'CodeStyleFixer', + "Missing whitespace added."), + "FE251": QCoreApplication.translate( + 'CodeStyleFixer', + "Extraneous whitespace removed."), + "FE261": QCoreApplication.translate( + 'CodeStyleFixer', + "Whitespace around comment sign corrected."), + "FE301": QCoreApplication.translate( + 'CodeStyleFixer', + "One blank line inserted."), + + "FE302+": lambda n=1: QCoreApplication.translate( + 'CodeStyleFixer', + "%n blank line(s) inserted.", '', QCoreApplication.CodecForTr, n), + "FE302-": lambda n=1: QCoreApplication.translate( + 'CodeStyleFixer', + "%n superfluous lines removed", '', QCoreApplication.CodecForTr, n), + + "FE303": QCoreApplication.translate( + 'CodeStyleFixer', + "Superfluous blank lines removed."), + "FE304": QCoreApplication.translate( + 'CodeStyleFixer', + "Superfluous blank lines after function decorator removed."), + "FE401": QCoreApplication.translate( + 'CodeStyleFixer', + "Imports were put on separate lines."), + "FE501": QCoreApplication.translate( + 'CodeStyleFixer', + "Long lines have been shortened."), + "FE502": QCoreApplication.translate( + 'CodeStyleFixer', + "Redundant backslash in brackets removed."), + "FE701": QCoreApplication.translate( + 'CodeStyleFixer', + "Compound statement corrected."), + "FE702": QCoreApplication.translate( + 'CodeStyleFixer', + "Compound statement corrected."), + "FE711": QCoreApplication.translate( + 'CodeStyleFixer', + "Comparison to None/True/False corrected."), + "FN804": QCoreApplication.translate( + 'CodeStyleFixer', + "'{0}' argument added."), + "FN806": QCoreApplication.translate( + 'CodeStyleFixer', + "'{0}' argument removed."), + "FW291": QCoreApplication.translate( + 'CodeStyleFixer', + "Whitespace stripped from end of line."), + "FW292": QCoreApplication.translate( + 'CodeStyleFixer', + "newline added to end of file."), + "FW391": QCoreApplication.translate( + 'CodeStyleFixer', + "Superfluous trailing blank lines removed from end of file."), + "FW603": QCoreApplication.translate( + 'CodeStyleFixer', + "'<>' replaced by '!='."), + + "FWRITE_ERROR": QCoreApplication.translate( + 'CodeStyleFixer', + "Could not save the file! Skipping it. Reason: {0}"), +} + +_messages_sample_args = { + "E201": ["([{"], + "E202": ["}])"], + "E203": [",;:"], + "E211": ["(["], + "E231": [",;:"], + "E241": [",;:"], + "E242": [",;:"], + "E302": [1], + "E303": [3], + "E501": [85, 79], + "E711": ["None", "'if cond is None:'"], + "E712": ["True", "'if cond is True:' or 'if cond:'"], + "E901": ["SyntaxError", "Invalid Syntax"], + "D901": ["SyntaxError", "Invalid Syntax"], +} + + +def getTranslatedMessage(message): + """ + Module function to get a translated and formatted message for a + given pyflakes message ID. + + @param message the message ID (string) + @return translated and formatted message (string) + """ + if isinstance(message, list): + message, args = message + else: + args = [] + if message in _messages: + if isinstance(args, int): + # Retranslate with correct plural form + return _messages[message](args) + else: + if message.startswith('F'): + prefix = '' + else: + prefix = message + ' ' + return prefix + _messages[message].format(*args) + elif ' ' in message: + # already translated + return message + else: + return QCoreApplication.translate( + "CodeStyleFixer", " no message defined for code '{0}'")\ + .format(message)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,185 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# pylint: disable=C0103 + +""" +Module implementing the syntax check for Python 2/3. +""" +import re +import sys +import traceback + +try: + from pyflakes.checker import Checker + from pyflakes.messages import ImportStarUsed +except ImportError: + pass + + +def initService(): + """ + Initialize the service and return the entry point. + + @return the entry point for the background client (function) + """ + return syntaxAndPyflakesCheck + + +def normalizeCode(codestring): + """ + Function to normalize the given code. + + @param codestring code to be normalized (string) + @return normalized code (string) + """ + codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") + + if codestring and codestring[-1] != '\n': + codestring = codestring + '\n' + + # Check type for py2: if not str it's unicode + if sys.version_info[0] == 2: + try: + codestring = codestring.encode('utf-8') + except UnicodeError: + pass + + return codestring + + +def extractLineFlags(line, startComment="#", endComment=""): + """ + Function to extract flags starting and ending with '__' from a line + comment. + + @param line line to extract flags from (string) + @keyparam startComment string identifying the start of the comment (string) + @keyparam endComment string identifying the end of a comment (string) + @return list containing the extracted flags (list of strings) + """ + flags = [] + + pos = line.rfind(startComment) + if pos >= 0: + comment = line[pos + len(startComment):].strip() + if endComment: + comment = comment.replace("endComment", "") + flags = [f.strip() for f in comment.split() + if (f.startswith("__") and f.endswith("__"))] + return flags + + +def syntaxAndPyflakesCheck(filename, codestring, checkFlakes=True, + ignoreStarImportWarnings=False): + """ + Function to compile one Python source file to Python bytecode + and to perform a pyflakes check. + + @param filename source filename (string) + @param codestring string containing the code to compile (string) + @keyparam checkFlakes flag indicating to do a pyflakes check (boolean) + @keyparam ignoreStarImportWarnings flag indicating to + ignore 'star import' warnings (boolean) + @return dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message, a list with arguments for the message) + """ + try: + import builtins + except ImportError: + import __builtin__ as builtins #__IGNORE_WARNING__ + + try: + if sys.version_info[0] == 2: + file_enc = filename.encode(sys.getfilesystemencoding()) + else: + file_enc = filename + + # It also encode the code back to avoid 'Encoding declaration in + # unicode string' exception on Python2 + codestring = normalizeCode(codestring) + + if filename.endswith('.ptl'): + try: + import quixote.ptl_compile + except ImportError: + return [{'error': (filename, 0, 0, '', + 'Quixote plugin not found.')}] + template = quixote.ptl_compile.Template(codestring, file_enc) + template.compile() + else: + # ast.PyCF_ONLY_AST = 1024, speed optimisation + module = builtins.compile(codestring, file_enc, 'exec', 1024) + except SyntaxError as detail: + index = 0 + code = "" + error = "" + lines = traceback.format_exception_only(SyntaxError, detail) + if sys.version_info[0] == 2: + lines = [x.decode(sys.getfilesystemencoding()) for x in lines] + match = re.match('\s*File "(.+)", line (\d+)', + lines[0].replace('<string>', '{0}'.format(filename))) + if match is not None: + fn, line = match.group(1, 2) + if lines[1].startswith('SyntaxError:'): + error = re.match('SyntaxError: (.+)', lines[1]).group(1) + else: + code = re.match('(.+)', lines[1]).group(1) + for seLine in lines[2:]: + if seLine.startswith('SyntaxError:'): + error = re.match('SyntaxError: (.+)', seLine).group(1) + elif seLine.rstrip().endswith('^'): + index = len(seLine.rstrip()) - 4 + else: + fn = detail.filename + line = detail.lineno or 1 + error = detail.msg + return [{'error': (fn, int(line), index, code.strip(), error)}] + except ValueError as detail: + try: + fn = detail.filename + line = detail.lineno + error = detail.msg + except AttributeError: + fn = filename + line = 1 + error = str(detail) + return [{'error': (fn, line, 0, "", error)}] + except Exception as detail: + try: + fn = detail.filename + line = detail.lineno + error = detail.msg + return [{'error': (fn, line, 0, "", error)}] + except: # this catchall is intentional + pass + + # pyflakes + if not checkFlakes: + return [{}] + + results = [] + lines = codestring.splitlines() + try: + warnings = Checker(module, filename) + warnings.messages.sort(key=lambda a: a.lineno) + for warning in warnings.messages: + if ignoreStarImportWarnings and \ + isinstance(warning, ImportStarUsed): + continue + + _fn, lineno, col, message, msg_args = warning.getMessageData() + if "__IGNORE_WARNING__" not in extractLineFlags( + lines[lineno - 1].strip()): + results.append((_fn, lineno, col, "", message, msg_args)) + except SyntaxError as err: + if err.text.strip(): + msg = err.text.strip() + else: + msg = err.msg + results.append((filename, err.lineno, 0, "FLAKES_ERROR", msg, [])) + + return [{'warnings': results}]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckService.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# pylint: disable=C0103 + +""" +Module implementing an interface to add different languages to do a syntax +check. +""" + +from __future__ import unicode_literals + +from PyQt4.QtCore import QObject, pyqtSignal + +from E5Gui.E5Application import e5App +from Utilities import determinePythonVersion + + +class SyntaxCheckService(QObject): + """ + Implement the syntax check service. + + Plugins can add other languages to the syntax check by calling addLanguage + and support of an extra checker module on the client side which has to + connect directly to the background service. + + @signal syntaxChecked(str, dict) emited when the syntax check was done. + """ + syntaxChecked = pyqtSignal(str, dict) + + def __init__(self): + """ + Contructor of SyntaxCheckService. + """ + super(SyntaxCheckService, self).__init__() + self.backgroundService = e5App().getObject("BackgroundService") + self.__supportedLanguages = {} + + def __determineLanguage(self, filename, source): + """ + Private methode to determine the language of the file. + + @param filename of the sourcefile (str) + @param source code of the file (str) + @return language of the file or None if not found (str or None) + """ + pyVer = determinePythonVersion(filename, source) + if pyVer: + return 'Python{0}'.format(pyVer) + + for lang, (getArgs, getExt) in self.__supportedLanguages.items(): + if filename.endswith(tuple(getExt())): + return lang + + return None + + def addLanguage( + self, lang, path, module, getArgs, getExt, callback, onError): + """ + Register the new language to the supported languages. + + @param lang new language to check syntax (str) + @param path full path to the module (str) + @param module name to import (str) + @param getArgs function to collect the required arguments to call the + syntax checker on client side (function) + @param getExt function that returns the supported file extensions of + the syntax checker (function) + @param callback function on service response (function) + @param onError callback function if client or service isn't available + (function) + """ + self.__supportedLanguages[lang] = getArgs, getExt + # Connect to the background service + self.backgroundService.serviceConnect( + 'syntax', lang, path, module, callback, onError) + + def getLanguages(self): + """ + Return the supported language names. + + @return list of languanges supported (list of str) + """ + return list(self.__supportedLanguages.keys()) + + def removeLanguage(self, lang): + """ + Remove the language from syntax check. + + @param lang language to remove (str) + """ + self.__supportedLanguages.pop(lang, None) + self.backgroundService.serviceDisconnect('syntax', lang) + + def getExtensions(self): + """ + Return all supported file extensions for the syntax checker dialog. + + @return set of all supported file extensions (set of str) + """ + extensions = set() + for getArgs, getExt in self.__supportedLanguages.values(): + for ext in getExt(): + extensions.add(ext) + return extensions + + def syntaxCheck(self, lang, filename, source): + """ + Method to prepare to compile one Python source file to Python bytecode + and to perform a pyflakes check in another task. + + @param lang language of the file or None to determine by internal + algorithm (str or None) + @param filename source filename (string) + @param source string containing the code to check (string) + """ + if not lang: + lang = self.__determineLanguage(filename, source) + if lang not in self.getLanguages(): + return + data = [source] + # Call the getArgs function to get the required arguments + args = self.__supportedLanguages[lang][0]() + data.extend(args) + self.backgroundService.enqueueRequest('syntax', lang, filename, data)
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Sun Mar 30 22:00:14 2014 +0200 @@ -21,7 +21,6 @@ from .Ui_SyntaxCheckerDialog import Ui_SyntaxCheckerDialog import Utilities -import Preferences import UI.PixmapCache @@ -66,6 +65,10 @@ self.checkProgressLabel.setVisible(False) self.checkProgressLabel.setMaximumWidth(600) + self.syntaxCheckService = e5App().getObject('SyntaxCheckService') + self.syntaxCheckService.syntaxChecked.connect(self.__processResult) + self.filename = None + def __resort(self): """ Private method to resort the tree. @@ -135,7 +138,7 @@ @param fn file or list of files or directory to be checked (string or list of strings) @param codestring string containing the code to be checked (string). - If this is given, file must be a single file name. + If this is given, fn must be a single file name. """ if self.__project is None: self.__project = e5App().getObject("Project") @@ -148,90 +151,104 @@ QApplication.processEvents() if isinstance(fn, list): - files = fn + self.files = fn elif os.path.isdir(fn): - files = [] - extensions = set(Preferences.getPython("PythonExtensions") + - Preferences.getPython("Python3Extensions")) - for ext in extensions: - files.extend( + self.files = [] + for ext in self.syntaxCheckService.getExtensions(): + self.files.extend( Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) else: - files = [fn] + self.files = [fn] - self.__clearErrors(files) + self.__clearErrors(self.files) - if codestring or len(files) > 0: - self.checkProgress.setMaximum(max(1, len(files))) - self.checkProgress.setVisible(len(files) > 1) - self.checkProgressLabel.setVisible(len(files) > 1) + if codestring or len(self.files) > 0: + self.checkProgress.setMaximum(max(1, len(self.files))) + self.checkProgress.setVisible(len(self.files) > 1) + self.checkProgressLabel.setVisible(len(self.files) > 1) QApplication.processEvents() - + # now go through all the files - progress = 0 - for file in files: - self.checkProgress.setValue(progress) - self.checkProgressLabel.setPath(file) - QApplication.processEvents() - self.__resort() - - if self.cancelled: - return - - self.__lastFileItem = None - - if codestring: - source = codestring - else: - try: - source = Utilities.readEncodedFile(file)[0] - source = Utilities.normalizeCode(source) - except (UnicodeError, IOError) as msg: - self.noResults = False - self.__createResultItem( - file, 1, 0, - self.trUtf8("Error: {0}").format(str(msg)) - .rstrip()[1:-1], "") - progress += 1 - continue - - flags = Utilities.extractFlags(source) - ext = os.path.splitext(file)[1] - if "FileType" in flags: - isPy2 = flags["FileType"] in ["Python", "Python2"] - elif (Preferences.getProject("DeterminePyFromProject") and - self.__project.isOpen() and - self.__project.isProjectFile(file)): - isPy2 = self.__project.getProjectLanguage() in \ - ["Python", "Python2"] - else: - isPy2 = flags.get("FileType") in ["Python", "Python2"] or \ - ext in Preferences.getPython("PythonExtensions") - - nok, fname, line, index, code, error, warnings = \ - Utilities.compile(file, source, isPy2) - if nok: - self.noResults = False - self.__createResultItem( - fname, line, index, error, code.strip(), False) - else: - source = source.splitlines() - for warning in warnings: - self.noResults = False - scr_line = source[warning[2] - 1].strip() - self.__createResultItem( - warning[1], warning[2], 0, - warning[3], scr_line, True) + self.progress = 0 + self.check(codestring) + + def check(self, codestring=''): + """ + Start a check for one file. + + The results are reported to the __processResult slot. + @keyparam codestring optional sourcestring (str) + """ + self.filename = self.files.pop(0) + self.checkProgress.setValue(self.progress) + self.checkProgressLabel.setPath(self.filename) + QApplication.processEvents() + self.__resort() + + if self.cancelled: + return + + self.__lastFileItem = None + + if codestring: + self.source = codestring + else: + try: + self.source = Utilities.readEncodedFile(self.filename)[0] + self.source = Utilities.normalizeCode(self.source) + except (UnicodeError, IOError) as msg: + self.noResults = False + self.__createResultItem( + self.filename, 1, 0, + self.trUtf8("Error: {0}").format(str(msg)) + .rstrip()[1:-1], "") + self.progress += 1 + # Continue with next file + self.check() + return + + self.syntaxCheckService.syntaxCheck(None, self.filename, self.source) - progress += 1 - self.checkProgress.setValue(progress) + def __processResult(self, fn, problems): + """ + Slot to display the reported messages. + + @param fn filename of the checked file (str) + @param problems dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message) (dict) + """ + # Check if it's the requested file, otherwise ignore signal + if fn != self.filename: + return + + error = problems.get('error') + if error: + self.noResults = False + _fn, lineno, col, code, msg = error + self.__createResultItem(_fn, lineno, col, msg, code, False) + + warnings = problems.get('warnings', []) + if warnings: + source = self.source.splitlines() + for _fn, lineno, col, code, msg in warnings: + self.noResults = False + scr_line = source[lineno - 1].strip() + self.__createResultItem(_fn, lineno, col, msg, scr_line, True) + + self.progress += 1 + self.checkProgress.setValue(self.progress) + QApplication.processEvents() + self.__resort() + + if self.files: + self.check() + else: self.checkProgressLabel.setPath("") - QApplication.processEvents() - self.__resort() - else: self.checkProgress.setMaximum(1) self.checkProgress.setValue(1) - self.__finish() + self.__finish() def __finish(self): """ @@ -314,7 +331,7 @@ editor = vm.getOpenEditor(fn) if itm.data(0, self.warningRole): - editor.toggleWarning(lineno, True, error) + editor.toggleWarning(lineno, 0, True, error) else: editor.toggleSyntaxError(lineno, index, True, error, show=True) else: @@ -328,7 +345,7 @@ index = citm.data(0, self.indexRole) error = citm.data(0, self.errorRole) if citm.data(0, self.warningRole): - editor.toggleWarning(lineno, True, error) + editor.toggleWarning(lineno, 0, True, error) else: editor.toggleSyntaxError( lineno, index, True, error, show=True) @@ -359,7 +376,7 @@ index = citm.data(0, self.indexRole) error = citm.data(0, self.errorRole) if citm.data(0, self.warningRole): - editor.toggleWarning(lineno, True, error) + editor.toggleWarning(lineno, 0, True, error) else: editor.toggleSyntaxError( lineno, index, True, error, show=True)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Package containg pyflakes adapted for Qt. +""" + +""" License +Copyright 2005-2011 Divmod, Inc. +Copyright 2013 Florent Xicluna + +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. +""" + +""" Changes +0.7.3 (2013-07-02): + - Do not report undefined name for generator expression and dict or + set comprehension at class level. + - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`: + use `Checker.pushScope` instead. + - Remove dependency on Unittest2 for the tests. + +0.7.2 (2013-04-24): + - Fix computation of `DoctestSyntaxError.lineno` and `col`. + - Add boolean attribute `Checker.withDoctest` to ignore doctests. + - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests. + - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated + list of additional built-in names. + +0.7.1 (2013-04-23): + - File `bin/pyflakes` was missing in tarball generated with distribute. + - Fix reporting errors in non-ASCII filenames (Python 2.x). + +0.7.0 (2013-04-17): + - Add --version and --help options. + - Support `python -m pyflakes` (Python 2.7 and Python 3.x). + - Add attribute `Message.col` to report column offset. + - Do not report redefinition of variable for a variable used in a list + comprehension in a conditional. + - Do not report redefinition of variable for generator expressions and + set or dict comprehensions. + - Do not report undefined name when the code is protected with a + `NameError` exception handler. + - Do not report redefinition of variable when unassigning a module imported + for its side-effect. + - Support special locals like `__tracebackhide__` for py.test. + - Support checking doctests. + - Fix issue with Turkish locale where `'i'.upper() == 'i'` in Python 2. + +0.6.1 (2013-01-29): + - Fix detection of variables in augmented assignments. + +0.6.0 (2013-01-29): + - Support Python 3 up to 3.3, based on the pyflakes3k project. + - Preserve compatibility with Python 2.5 and all recent versions of Python. + - Support custom reporters in addition to the default Reporter. + - Allow function redefinition for modern property construction via + property.setter/deleter. + - Fix spurious redefinition warnings in conditionals. + - Do not report undefined name in __all__ if import * is used. + - Add WindowsError as a known built-in name on all platforms. + - Support specifying additional built-ins in the `Checker` constructor. + - Don't issue Unused Variable warning when using locals() in current scope. + - Handle problems with the encoding of source files. + - Remove dependency on Twisted for the tests. + - Support `python setup.py test` and `python setup.py develop`. + - Create script using setuptools `entry_points` to support all platforms, + including Windows. + +0.5.0 (2011-09-02): + - Convert pyflakes to use newer _ast infrastructure rather than compiler. + - Support for new syntax in 2.7 (including set literals, set comprehensions, + and dictionary comprehensions). + - Make sure class names don't get bound until after class definition. +""" + +__version__ = '0.7.3'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,857 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# Original (c) 2005-2010 Divmod, Inc. +# +# This module is based on pyflakes but was modified to work with eric5 +""" +Main module. + +Implement the central Checker class. +Also, it models the Bindings and Scopes. +""" +import doctest +import os +import sys +try: + builtin_vars = dir(__import__('builtins')) + PY2 = False +except ImportError: + builtin_vars = dir(__import__('__builtin__')) + PY2 = True + +try: + import ast + iter_child_nodes = ast.iter_child_nodes +except ImportError: # Python 2.5 + import _ast as ast + + if 'decorator_list' not in ast.ClassDef._fields: + # Patch the missing attribute 'decorator_list' + ast.ClassDef.decorator_list = () + ast.FunctionDef.decorator_list = property(lambda s: s.decorators) + + def iter_child_nodes(node): + """ + Yield all direct child nodes of *node*, that is, all fields that + are nodes and all items of fields that are lists of nodes. + """ + for name in node._fields: + field = getattr(node, name, None) + if isinstance(field, ast.AST): + yield field + elif isinstance(field, list): + for item in field: + yield item +# Python >= 3.3 uses ast.Try instead of (ast.TryExcept + ast.TryFinally) +if hasattr(ast, 'Try'): + ast_TryExcept = ast.Try + ast_TryFinally = () +else: + ast_TryExcept = ast.TryExcept + ast_TryFinally = ast.TryFinally + +from . import messages + + +if PY2: + def getNodeType(node_class): + # workaround str.upper() which is locale-dependent + return str(unicode(node_class.__name__).upper()) # __IGNORE_WARNING__ +else: + def getNodeType(node_class): + return node_class.__name__.upper() + + +class Binding(object): + """ + Represents the binding of a value to a name. + + 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. + + @ivar used: pair of (L{Scope}, line-number) indicating the scope and + line number that this binding was last used + """ + + def __init__(self, name, source): + self.name = name + self.source = source + self.used = False + + def __str__(self): + return self.name + + def __repr__(self): + return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__, + self.name, + self.source.lineno, + id(self)) + + +class Importation(Binding): + """ + A binding created by an import statement. + + @ivar fullName: The complete name given to the import statement, + possibly including multiple dotted components. + @type fullName: C{str} + """ + def __init__(self, name, source): + self.fullName = name + name = name.split('.')[0] + super(Importation, self).__init__(name, source) + + +class Argument(Binding): + """ + Represents binding a name as an argument. + """ + + +class Definition(Binding): + """ + A binding that defines a function or a class. + """ + + +class Assignment(Binding): + """ + Represents binding a name with an explicit assignment. + + 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. + """ + + +class FunctionDefinition(Definition): + pass + + +class ClassDefinition(Definition): + pass + + +class ExportBinding(Binding): + """ + A binding created by an C{__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. + + The only C{__all__} assignment that can be recognized is one which takes + the value of a literal list containing literal strings. For example:: + + __all__ = ["foo", "bar"] + + Names which are imported and not otherwise used but appear in the value of + C{__all__} will not have an unused import warning reported for them. + """ + def names(self): + """ + Return a list of the names referenced by this binding. + """ + names = [] + if isinstance(self.source, ast.List): + for node in self.source.elts: + if isinstance(node, ast.Str): + names.append(node.s) + return names + + +class Scope(dict): + importStarred = False # set to True when import * is found + + def __repr__(self): + scope_cls = self.__class__.__name__ + return '<%s at 0x%x %s>' % (scope_cls, id(self), dict.__repr__(self)) + + +class ClassScope(Scope): + pass + + +class FunctionScope(Scope): + """ + I represent a name scope for a function. + + @ivar globals: Names declared 'global' in this function. + """ + usesLocals = False + alwaysUsed = set(['__tracebackhide__', + '__traceback_info__', '__traceback_supplement__']) + + def __init__(self): + super(FunctionScope, self).__init__() + # Simplify: manage the special locals as globals + self.globals = self.alwaysUsed.copy() + + def unusedAssignments(self): + """ + Return a generator for the assignments which have not been used. + """ + for name, binding in self.items(): + if (not binding.used and name not in self.globals + and not self.usesLocals + and isinstance(binding, Assignment)): + yield name, binding + + +class GeneratorScope(Scope): + pass + + +class ModuleScope(Scope): + pass + + +# Globally defined names which are not attributes of the builtins module, or +# are only present on some platforms. +_MAGIC_GLOBALS = ['__file__', '__builtins__', 'WindowsError'] + + +def getNodeName(node): + # Returns node.id, or node.name, or None + if hasattr(node, 'id'): # One of the many nodes with an id + return node.id + if hasattr(node, 'name'): # a ExceptHandler node + return node.name + + +class Checker(object): + """ + I check the cleanliness and sanity of Python code. + + @ivar _deferredFunctions: Tracking list used by L{deferFunction}. Elements + of the list are two-tuples. The first element is the callable passed + to L{deferFunction}. The second element is a copy of the scope stack + at the time L{deferFunction} was called. + + @ivar _deferredAssignments: Similar to C{_deferredFunctions}, but for + callables which are deferred assignment checks. + """ + + nodeDepth = 0 + offset = None + traceTree = False + withDoctest = ('PYFLAKES_NODOCTEST' not in os.environ) + + builtIns = set(builtin_vars).union(_MAGIC_GLOBALS) + _customBuiltIns = os.environ.get('PYFLAKES_BUILTINS') + if _customBuiltIns: + builtIns.update(_customBuiltIns.split(',')) + del _customBuiltIns + + def __init__(self, tree, filename='(none)', builtins=None): + self._nodeHandlers = {} + self._deferredFunctions = [] + self._deferredAssignments = [] + self.deadScopes = [] + self.messages = [] + self.filename = filename + if builtins: + self.builtIns = self.builtIns.union(builtins) + self.scopeStack = [ModuleScope()] + self.exceptHandlers = [()] + self.futuresAllowed = True + self.root = tree + self.handleChildren(tree) + self.runDeferred(self._deferredFunctions) + # Set _deferredFunctions to None so that deferFunction will fail + # noisily if called after we've run through the deferred functions. + self._deferredFunctions = None + self.runDeferred(self._deferredAssignments) + # Set _deferredAssignments to None so that deferAssignment will fail + # noisily if called after we've run through the deferred assignments. + self._deferredAssignments = None + del self.scopeStack[1:] + self.popScope() + self.checkDeadScopes() + + def deferFunction(self, callable): + """ + Schedule a function handler to be called just before completion. + + 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. + """ + self._deferredFunctions.append((callable, self.scopeStack[:], self.offset)) + + def deferAssignment(self, callable): + """ + Schedule an assignment handler to be called just after deferred + function handlers. + """ + self._deferredAssignments.append((callable, self.scopeStack[:], self.offset)) + + def runDeferred(self, deferred): + """ + Run the callables in C{deferred} using their associated scope stack. + """ + for handler, scope, offset in deferred: + self.scopeStack = scope + self.offset = offset + handler() + + @property + def scope(self): + return self.scopeStack[-1] + + def popScope(self): + self.deadScopes.append(self.scopeStack.pop()) + + def checkDeadScopes(self): + """ + Look at scopes which have been fully examined and report names in them + which were imported but unused. + """ + for scope in self.deadScopes: + export = isinstance(scope.get('__all__'), ExportBinding) + if export: + all = scope['__all__'].names() + if not scope.importStarred and \ + os.path.basename(self.filename) != '__init__.py': + # Look for possible mistakes in the export list + undefined = set(all) - set(scope) + for name in undefined: + self.report(messages.UndefinedExport, + scope['__all__'].source, name) + else: + all = [] + + # Look for imported names that aren't used. + for importation in scope.values(): + if isinstance(importation, Importation): + if not importation.used and importation.name not in all: + self.report(messages.UnusedImport, + importation.source, importation.name) + + def pushScope(self, scopeClass=FunctionScope): + self.scopeStack.append(scopeClass()) + + def pushFunctionScope(self): # XXX Deprecated + self.pushScope(FunctionScope) + + def pushClassScope(self): # XXX Deprecated + self.pushScope(ClassScope) + + def report(self, messageClass, *args, **kwargs): + self.messages.append(messageClass(self.filename, *args, **kwargs)) + + def hasParent(self, node, kind): + while hasattr(node, 'parent'): + node = node.parent + if isinstance(node, kind): + return True + + def getCommonAncestor(self, lnode, rnode, stop=None): + if not stop: + stop = self.root + if lnode is rnode: + return lnode + if stop in (lnode, rnode): + return stop + + if not hasattr(lnode, 'parent') or not hasattr(rnode, 'parent'): + return + if (lnode.level > rnode.level): + return self.getCommonAncestor(lnode.parent, rnode, stop) + if (rnode.level > lnode.level): + return self.getCommonAncestor(lnode, rnode.parent, stop) + return self.getCommonAncestor(lnode.parent, rnode.parent, stop) + + def descendantOf(self, node, ancestors, stop=None): + for a in ancestors: + if self.getCommonAncestor(node, a, stop) not in (stop, None): + return True + return False + + def onFork(self, parent, lnode, rnode, items): + return (self.descendantOf(lnode, items, parent) ^ + self.descendantOf(rnode, items, parent)) + + def differentForks(self, lnode, rnode): + """True, if lnode and rnode are located on different forks of IF/TRY""" + ancestor = self.getCommonAncestor(lnode, rnode) + if isinstance(ancestor, ast.If): + for fork in (ancestor.body, ancestor.orelse): + if self.onFork(ancestor, lnode, rnode, fork): + return True + elif isinstance(ancestor, ast_TryExcept): + body = ancestor.body + ancestor.orelse + for fork in [body] + [[hdl] for hdl in ancestor.handlers]: + if self.onFork(ancestor, lnode, rnode, fork): + return True + elif isinstance(ancestor, ast_TryFinally): + if self.onFork(ancestor, lnode, rnode, ancestor.body): + return True + return False + + def addBinding(self, node, value, reportRedef=True): + """ + Called when a binding is altered. + + - `node` is the statement responsible for the change + - `value` is the optional new value, a Binding instance, associated + with the binding; if None, the binding is deleted if it exists. + - if `reportRedef` is True (default), rebinding while unused will be + reported. + """ + redefinedWhileUnused = False + if not isinstance(self.scope, ClassScope): + for scope in self.scopeStack[::-1]: + existing = scope.get(value.name) + if (isinstance(existing, Importation) + and not existing.used + and (not isinstance(value, Importation) or + value.fullName == existing.fullName) + and reportRedef + and not self.differentForks(node, existing.source)): + redefinedWhileUnused = True + self.report(messages.RedefinedWhileUnused, + node, value.name, existing.source) + + existing = self.scope.get(value.name) + if not redefinedWhileUnused and self.hasParent(value.source, ast.ListComp): + if (existing and reportRedef + and not self.hasParent(existing.source, (ast.For, ast.ListComp)) + and not self.differentForks(node, existing.source)): + self.report(messages.RedefinedInListComp, + node, value.name, existing.source) + + if (isinstance(existing, Definition) + and not existing.used + and not self.differentForks(node, existing.source)): + self.report(messages.RedefinedWhileUnused, + node, value.name, existing.source) + else: + self.scope[value.name] = value + + def getNodeHandler(self, node_class): + try: + return self._nodeHandlers[node_class] + except KeyError: + nodeType = getNodeType(node_class) + self._nodeHandlers[node_class] = handler = getattr(self, nodeType) + return handler + + def handleNodeLoad(self, node): + name = getNodeName(node) + if not name: + return + # try local scope + try: + self.scope[name].used = (self.scope, node) + except KeyError: + pass + else: + return + + scopes = [scope for scope in self.scopeStack[:-1] + if isinstance(scope, (FunctionScope, ModuleScope))] + if isinstance(self.scope, GeneratorScope) and scopes[-1] != self.scopeStack[-2]: + scopes.append(self.scopeStack[-2]) + + # try enclosing function scopes and global scope + importStarred = self.scope.importStarred + for scope in reversed(scopes): + importStarred = importStarred or scope.importStarred + try: + scope[name].used = (self.scope, node) + except KeyError: + pass + else: + return + + # look in the built-ins + if importStarred or name in self.builtIns: + return + if name == '__path__' and os.path.basename(self.filename) == '__init__.py': + # the special name __path__ is valid only in packages + return + + # protected with a NameError handler? + if 'NameError' not in self.exceptHandlers[-1]: + self.report(messages.UndefinedName, node, name) + + def handleNodeStore(self, node): + name = getNodeName(node) + if not name: + return + # if the name hasn't already been defined in the current scope + if isinstance(self.scope, FunctionScope) and name not in self.scope: + # for each function or module scope above us + for scope in self.scopeStack[:-1]: + if not isinstance(scope, (FunctionScope, ModuleScope)): + continue + # if the name was defined in that scope, and the name has + # been accessed already in the current scope, and hasn't + # been declared global + used = name in scope and scope[name].used + if used and used[0] is self.scope and name not in self.scope.globals: + # then it's probably a mistake + self.report(messages.UndefinedLocal, + scope[name].used[1], name, scope[name].source) + break + + parent = getattr(node, 'parent', None) + if isinstance(parent, (ast.For, ast.comprehension, ast.Tuple, ast.List)): + binding = Binding(name, node) + elif (parent is not None and name == '__all__' and + isinstance(self.scope, ModuleScope)): + binding = ExportBinding(name, parent.value) + else: + binding = Assignment(name, node) + if name in self.scope: + binding.used = self.scope[name].used + self.addBinding(node, binding) + + def handleNodeDelete(self, node): + name = getNodeName(node) + if not name: + return + if isinstance(self.scope, FunctionScope) and name in self.scope.globals: + self.scope.globals.remove(name) + else: + try: + del self.scope[name] + except KeyError: + self.report(messages.UndefinedName, node, name) + + def handleChildren(self, tree): + for node in iter_child_nodes(tree): + self.handleNode(node, tree) + + def isDocstring(self, node): + """ + Determine if the given node is a docstring, as long as it is at the + correct place in the node tree. + """ + return isinstance(node, ast.Str) or (isinstance(node, ast.Expr) and + isinstance(node.value, ast.Str)) + + def getDocstring(self, node): + if isinstance(node, ast.Expr): + node = node.value + if not isinstance(node, ast.Str): + return (None, None) + # Computed incorrectly if the docstring has backslash + doctest_lineno = node.lineno - node.s.count('\n') - 1 + return (node.s, doctest_lineno) + + def handleNode(self, node, parent): + if node is None: + return + if self.offset and getattr(node, 'lineno', None) is not None: + node.lineno += self.offset[0] + node.col_offset += self.offset[1] + if self.traceTree: + print(' ' * self.nodeDepth + node.__class__.__name__) + if self.futuresAllowed and not (isinstance(node, ast.ImportFrom) or + self.isDocstring(node)): + self.futuresAllowed = False + self.nodeDepth += 1 + node.level = self.nodeDepth + node.parent = parent + try: + handler = self.getNodeHandler(node.__class__) + handler(node) + finally: + self.nodeDepth -= 1 + if self.traceTree: + print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__) + + _getDoctestExamples = doctest.DocTestParser().get_examples + + def handleDoctests(self, node): + try: + docstring, node_lineno = self.getDocstring(node.body[0]) + if not docstring: + return + examples = self._getDoctestExamples(docstring) + except (ValueError, IndexError): + # e.g. line 6 of the docstring for <string> has inconsistent + # leading whitespace: ... + return + node_offset = self.offset or (0, 0) + self.pushScope() + for example in examples: + try: + tree = compile(example.source, "<doctest>", "exec", ast.PyCF_ONLY_AST) + except SyntaxError: + e = sys.exc_info()[1] + position = (node_lineno + example.lineno + e.lineno, + example.indent + 4 + e.offset) + self.report(messages.DoctestSyntaxError, node, position) + else: + self.offset = (node_offset[0] + node_lineno + example.lineno, + node_offset[1] + example.indent + 4) + self.handleChildren(tree) + self.offset = node_offset + self.popScope() + + def ignore(self, node): + pass + + # "stmt" type nodes + RETURN = DELETE = PRINT = WHILE = IF = WITH = WITHITEM = RAISE = \ + TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren + + CONTINUE = BREAK = PASS = ignore + + # "expr" type nodes + BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = YIELDFROM = \ + COMPARE = CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = \ + STARRED = handleChildren + + NUM = STR = BYTES = ELLIPSIS = ignore + + # "slice" type nodes + SLICE = EXTSLICE = INDEX = handleChildren + + # expression contexts are node instances too, though being constants + LOAD = STORE = DEL = AUGLOAD = AUGSTORE = PARAM = ignore + + # same for operators + AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \ + BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \ + EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore + + # additional node types + COMPREHENSION = KEYWORD = handleChildren + + def GLOBAL(self, node): + """ + Keep track of globals declarations. + """ + if isinstance(self.scope, FunctionScope): + self.scope.globals.update(node.names) + + NONLOCAL = GLOBAL + + def LISTCOMP(self, node): + # handle generators before element + for gen in node.generators: + self.handleNode(gen, node) + self.handleNode(node.elt, node) + + def GENERATOREXP(self, node): + self.pushScope(GeneratorScope) + # handle generators before element + for gen in node.generators: + self.handleNode(gen, node) + self.handleNode(node.elt, node) + self.popScope() + + SETCOMP = GENERATOREXP + + def DICTCOMP(self, node): + self.pushScope(GeneratorScope) + for gen in node.generators: + self.handleNode(gen, node) + self.handleNode(node.key, node) + self.handleNode(node.value, node) + self.popScope() + + def FOR(self, node): + """ + Process bindings for loop variables. + """ + vars = [] + + def collectLoopVars(n): + if isinstance(n, ast.Name): + vars.append(n.id) + elif isinstance(n, ast.expr_context): + return + else: + for c in iter_child_nodes(n): + collectLoopVars(c) + + collectLoopVars(node.target) + for varn in vars: + if (isinstance(self.scope.get(varn), Importation) + # unused ones will get an unused import warning + and self.scope[varn].used): + self.report(messages.ImportShadowedByLoopVar, + node, varn, self.scope[varn].source) + + self.handleChildren(node) + + def NAME(self, node): + """ + Handle occurrence of Name (which can be a load/store/delete access.) + """ + # Locate the name in locals / function / globals scopes. + if isinstance(node.ctx, (ast.Load, ast.AugLoad)): + self.handleNodeLoad(node) + if (node.id == 'locals' and isinstance(self.scope, FunctionScope) + and isinstance(node.parent, ast.Call)): + # we are doing locals() call in current scope + self.scope.usesLocals = True + elif isinstance(node.ctx, (ast.Store, ast.AugStore)): + self.handleNodeStore(node) + elif isinstance(node.ctx, ast.Del): + self.handleNodeDelete(node) + else: + # must be a Param context -- this only happens for names in function + # arguments, but these aren't dispatched through here + raise RuntimeError("Got impossible expression context: %r" % (node.ctx,)) + + def FUNCTIONDEF(self, node): + for deco in node.decorator_list: + self.handleNode(deco, node) + self.addBinding(node, FunctionDefinition(node.name, node)) + self.LAMBDA(node) + if self.withDoctest: + self.deferFunction(lambda: self.handleDoctests(node)) + + def LAMBDA(self, node): + args = [] + + if PY2: + def addArgs(arglist): + for arg in arglist: + if isinstance(arg, ast.Tuple): + addArgs(arg.elts) + else: + if arg.id in args: + self.report(messages.DuplicateArgument, + node, arg.id) + args.append(arg.id) + addArgs(node.args.args) + defaults = node.args.defaults + else: + for arg in node.args.args + node.args.kwonlyargs: + if arg.arg in args: + self.report(messages.DuplicateArgument, + node, arg.arg) + args.append(arg.arg) + self.handleNode(arg.annotation, node) + if hasattr(node, 'returns'): # Only for FunctionDefs + for annotation in (node.args.varargannotation, + node.args.kwargannotation, node.returns): + self.handleNode(annotation, node) + defaults = node.args.defaults + node.args.kw_defaults + + # vararg/kwarg identifiers are not Name nodes + for wildcard in (node.args.vararg, node.args.kwarg): + if not wildcard: + continue + if wildcard in args: + self.report(messages.DuplicateArgument, node, wildcard) + args.append(wildcard) + for default in defaults: + self.handleNode(default, node) + + def runFunction(): + + self.pushScope() + for name in args: + self.addBinding(node, Argument(name, node), reportRedef=False) + if isinstance(node.body, list): + # case for FunctionDefs + for stmt in node.body: + self.handleNode(stmt, node) + else: + # case for Lambdas + self.handleNode(node.body, node) + + def checkUnusedAssignments(): + """ + Check to see if any assignments have not been used. + """ + for name, binding in self.scope.unusedAssignments(): + self.report(messages.UnusedVariable, binding.source, name) + self.deferAssignment(checkUnusedAssignments) + self.popScope() + + self.deferFunction(runFunction) + + def CLASSDEF(self, node): + """ + 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. + """ + for deco in node.decorator_list: + self.handleNode(deco, node) + for baseNode in node.bases: + self.handleNode(baseNode, node) + if not PY2: + for keywordNode in node.keywords: + self.handleNode(keywordNode, node) + self.pushScope(ClassScope) + if self.withDoctest: + self.deferFunction(lambda: self.handleDoctests(node)) + for stmt in node.body: + self.handleNode(stmt, node) + self.popScope() + self.addBinding(node, ClassDefinition(node.name, node)) + + def ASSIGN(self, node): + self.handleNode(node.value, node) + for target in node.targets: + self.handleNode(target, node) + + def AUGASSIGN(self, node): + self.handleNodeLoad(node.target) + self.handleNode(node.value, node) + self.handleNode(node.target, node) + + def IMPORT(self, node): + for alias in node.names: + name = alias.asname or alias.name + importation = Importation(name, node) + self.addBinding(node, importation) + + def IMPORTFROM(self, node): + if node.module == '__future__': + if not self.futuresAllowed: + self.report(messages.LateFutureImport, + node, [n.name for n in node.names]) + else: + self.futuresAllowed = False + + for alias in node.names: + if alias.name == '*': + self.scope.importStarred = True + self.report(messages.ImportStarUsed, node, node.module) + continue + name = alias.asname or alias.name + importation = Importation(name, node) + if node.module == '__future__': + importation.used = (self.scope, node) + self.addBinding(node, importation) + + def TRY(self, node): + handler_names = [] + # List the exception handlers + for handler in node.handlers: + if isinstance(handler.type, ast.Tuple): + for exc_type in handler.type.elts: + handler_names.append(getNodeName(exc_type)) + elif handler.type: + handler_names.append(getNodeName(handler.type)) + # Memorize the except handlers and process the body + self.exceptHandlers.append(handler_names) + for child in node.body: + self.handleNode(child, node) + self.exceptHandlers.pop() + # Process the other nodes: "except:", "else:", "finally:" + for child in iter_child_nodes(node): + if child not in node.body: + self.handleNode(child, node) + + TRYEXCEPT = TRY + + def EXCEPTHANDLER(self, node): + # 3.x: in addition to handling children, we must handle the name of + # the exception, which is not a Name node, but a simple string. + if isinstance(node.name, str): + self.handleNodeStore(node) + self.handleChildren(node)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# Original (c) 2005 Divmod, Inc. See __init__.py file for details +# +# This module is based on pyflakes but was heavily hacked to +# work within Eric5 and Qt (translatable messages) + +""" +Provide the class Message and its subclasses. +""" + +# Tell 'lupdate' which strings to keep for translation. +QT_TRANSLATE_NOOP = lambda mod, txt: txt + + +class Message(object): + """ + Class defining the base for all specific message classes. + """ + message = '' + message_args = () + + def __init__(self, filename, loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + """ + self.filename = filename + self.lineno = loc.lineno + self.col = getattr(loc, 'col_offset', 0) + + def __str__(self): + """ + Special method return a string representation of the instance object. + + @return string representation of the object (string) + """ + return '%s:%s: %s' % (self.filename, self.lineno, + self.message % self.message_args) + + def getMessageData(self): + """ + Public method to get the individual message data elements. + + @return tuple containing file name, line number and message + (string, integer, string) + """ + return (self.filename, self.lineno, self.col, self.message, + self.message_args) + + +class UnusedImport(Message): + """ + Class defining the "Unused Import" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + '{0!r} imported but unused.') + + def __init__(self, filename, loc, name): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the unused import (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (name,) + + +class RedefinedWhileUnused(Message): + """ + Class defining the "Redefined While Unused" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Redefinition of unused {0!r} from line {1!r}.') + + def __init__(self, filename, loc, name, orig_loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the redefined object (string) + @param orig_loc location of the original definition (object) + """ + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class RedefinedInListComp(Message): + """ + Class defining the list comprehension redefinition. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'List comprehension redefines {0!r} from line {1!r}.') + + def __init__(self, filename, loc, name, orig_loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the redefined object (string) + @param orig_loc location of the original definition (object) + """ + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class ImportShadowedByLoopVar(Message): + """ + Class defining the "Import Shadowed By Loop Var" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Import {0!r} from line {1!r} shadowed by loop variable.') + + def __init__(self, filename, loc, name, orig_loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the shadowed import (string) + @param orig_loc location of the import (object) + """ + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class ImportStarUsed(Message): + """ + Class defining the "Import Star Used" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + "'from {0} import *' used; unable to detect undefined names.") + + def __init__(self, filename, loc, modname): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param modname name of the module imported using star import (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (modname,) + + +class UndefinedName(Message): + """ + Class defining the "Undefined Name" message. + """ + message = QT_TRANSLATE_NOOP('py3Flakes', 'Undefined name {0!r}.') + + def __init__(self, filename, loc, name): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name undefined name (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (name,) + + +class DoctestSyntaxError(Message): + """ + Class defining the "Syntax error in doctest" message. + """ + message = QT_TRANSLATE_NOOP('py3Flakes', 'Syntax error in doctest.') + + def __init__(self, filename, loc, position=None): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @keyparam position of warning if existent (object) + """ + Message.__init__(self, filename, loc) + if position: + (self.lineno, self.col) = position + self.message_args = () + + +class UndefinedExport(Message): + """ + Class defining the "Undefined Export" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Undefined name {0!r} in __all__.') + + def __init__(self, filename, loc, name): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name undefined exported name (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (name,) + + +class UndefinedLocal(Message): + """ + Class defining the "Undefined Local Variable" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + "Local variable {0!r} (defined in enclosing scope on line {1!r})" + " referenced before assignment.") + + def __init__(self, filename, loc, name, orig_loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the prematurely referenced variable (string) + @param orig_loc location of the variable definition (object) + """ + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class DuplicateArgument(Message): + """ + Class defining the "Duplicate Argument" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Duplicate argument {0!r} in function definition.') + + def __init__(self, filename, loc, name): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the duplicate argument (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (name,) + + +class Redefined(Message): + """ + Class defining the "Redefined" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Redefinition of {0!r} from line {1!r}.') + + def __init__(self, filename, loc, name, orig_loc): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param name name of the redefined function (string) + @param orig_loc location of the original definition (object) + """ + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class LateFutureImport(Message): + """ + Class defining the "Late Future Import" message. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Future import(s) {0!r} after other statements.') + + def __init__(self, filename, loc, names): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param names names of the imported futures (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (names,) + + +class UnusedVariable(Message): + """ + Class defining the "Unused Variable" message. + + Indicates that a variable has been explicitly assigned to but not actually + used. + """ + message = QT_TRANSLATE_NOOP( + 'py3Flakes', + 'Local variable {0!r} is assigned to but never used.') + + def __init__(self, filename, loc, names): + """ + Constructor + + @param filename name of the file (string) + @param loc location of warning (object) + @param names names of the unused variable (string) + """ + Message.__init__(self, filename, loc) + self.message_args = (names,)
--- a/Plugins/CheckerPlugins/Tabnanny/Tabnanny.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/Tabnanny/Tabnanny.py Sun Mar 30 22:00:14 2014 +0200 @@ -49,14 +49,21 @@ except (ImportError): import io # __IGNORE_WARNING__ -import Utilities - if not hasattr(tokenize, 'NL'): raise ValueError("tokenize.NL doesn't exist -- tokenize module too old") __all__ = ["check", "NannyNag", "process_tokens"] +def initService(): + """ + Initialize the service and return the entry point. + + @return the entry point for the background client (function) + """ + return check + + class NannyNag(Exception): """ Class implementing an exception for indentation issues. @@ -114,34 +121,29 @@ global indents, check_equal indents = [Whitespace("")] check_equal = 0 - if not text: - try: - text = Utilities.readEncodedFile(file)[0] - text = Utilities.normalizeCode(text) - except (UnicodeError, IOError) as msg: - return (True, file, "1", "Error: {0}".format(str(msg))) + return (True, "1", "Error: source code missing.") source = io.StringIO(text) try: process_tokens(tokenize.generate_tokens(source.readline)) except tokenize.TokenError as msg: - return (True, file, "1", "Token Error: {0}".format(str(msg))) + return (True, "1", "Token Error: {0}".format(str(msg))) except IndentationError as err: - return (True, file, err.lineno, + return (True, str(err.lineno), "Indentation Error: {0}".format(str(err.msg))) except NannyNag as nag: badline = nag.get_lineno() line = nag.get_line() - return (True, file, str(badline), line) + return (True, str(badline), line) except Exception as err: - return (True, file, "1", "Unspecific Error: {0}".format(str(err))) + return (True, "1", "Unspecific Error: {0}".format(str(err))) - return (False, None, None, None) + return (False, None, None) class Whitespace(object):
--- a/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/CheckerPlugins/Tabnanny/TabnannyDialog.py Sun Mar 30 22:00:14 2014 +0200 @@ -10,7 +10,7 @@ from __future__ import unicode_literals try: - str = unicode # __IGNORE_WARNING__ + str = unicode except (NameError): pass @@ -33,10 +33,11 @@ """ Class implementing a dialog to show the results of the tabnanny check run. """ - def __init__(self, parent=None): + def __init__(self, indentCheckService, parent=None): """ Constructor + @param indentCheckService reference to the service (IndentCheckService) @param parent The parent widget (QWidget). """ super(TabnannyDialog, self).__init__(parent) @@ -48,6 +49,10 @@ self.resultList.headerItem().setText(self.resultList.columnCount(), "") self.resultList.header().setSortIndicator(0, Qt.AscendingOrder) + self.indentCheckService = indentCheckService + self.indentCheckService.indentChecked.connect(self.__processResult) + self.filename = None + self.noResults = True self.cancelled = False @@ -120,61 +125,91 @@ QApplication.processEvents() if isinstance(fn, list): - files = fn + self.files = fn elif os.path.isdir(fn): - files = [] + self.files = [] extensions = set(Preferences.getPython("PythonExtensions") + Preferences.getPython("Python3Extensions")) for ext in extensions: - files.extend( + self.files.extend( Utilities.direntries(fn, True, '*{0}'.format(ext), 0)) else: - files = [fn] + self.files = [fn] - if len(files) > 0: - self.checkProgress.setMaximum(len(files)) - self.checkProgress.setVisible(len(files) > 1) - self.checkProgressLabel.setVisible(len(files) > 1) + if len(self.files) > 0: + self.checkProgress.setMaximum(len(self.files)) + self.checkProgress.setVisible(len(self.files) > 1) + self.checkProgressLabel.setVisible(len(self.files) > 1) QApplication.processEvents() - - # now go through all the files - progress = 0 - for file in files: - self.checkProgress.setValue(progress) - self.checkProgressLabel.setPath(file) - QApplication.processEvents() - self.__resort() - - if self.cancelled: - return - - try: - source = Utilities.readEncodedFile(file)[0] - source = Utilities.normalizeCode(source) - except (UnicodeError, IOError) as msg: - self.noResults = False - self.__createResultItem( - file, 1, - "Error: {0}".format(str(msg)).rstrip()[1:-1]) - progress += 1 - continue + + # now go through all the files + self.progress = 0 + self.check() - from . import Tabnanny - nok, fname, line, error = Tabnanny.check(file, source) - if nok: - self.noResults = False - self.__createResultItem(fname, line, error.rstrip()) - progress += 1 - - self.checkProgress.setValue(progress) + def check(self, codestring=''): + """ + Start a style check for one file. + + The results are reported to the __processResult slot. + @keyparam codestring optional sourcestring (str) + """ + if not self.files: self.checkProgressLabel.setPath("") - QApplication.processEvents() - self.__resort() - else: self.checkProgress.setMaximum(1) self.checkProgress.setValue(1) - self.__finish() + self.__finish() + return + + self.filename = self.files.pop(0) + self.checkProgress.setValue(self.progress) + self.checkProgressLabel.setPath(self.filename) + QApplication.processEvents() + self.__resort() + + if self.cancelled: + return + try: + self.source = Utilities.readEncodedFile(self.filename)[0] + self.source = Utilities.normalizeCode(self.source) + except (UnicodeError, IOError) as msg: + self.noResults = False + self.__createResultItem( + self.filename, 1, + "Error: {0}".format(str(msg)).rstrip()) + self.progress += 1 + # Continue with next file + self.check() + return + + self.indentCheckService.indentCheck( + None, self.filename, self.source) + + def __processResult(self, fn, nok, line, error): + """ + Privat slot called after perfoming a style check on one file. + + @param fn filename of the just checked file (str) + @param nok flag if a problem was found (bool) + @param line line number (str) + @param error text of the problem (str) + """ + # Check if it's the requested file, otherwise ignore signal + if fn != self.filename: + return + + if nok: + self.noResults = False + self.__createResultItem(fn, line, error.rstrip()) + self.progress += 1 + + self.checkProgress.setValue(self.progress) + self.checkProgressLabel.setPath("") + QApplication.processEvents() + self.__resort() + + self.check() + def __finish(self): """ Private slot called when the action or the user pressed the button.
--- a/Plugins/PluginCodeStyleChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/PluginCodeStyleChecker.py Sun Mar 30 22:00:14 2014 +0200 @@ -11,12 +11,13 @@ import os -from PyQt4.QtCore import QObject +from PyQt4.QtCore import QObject, pyqtSignal +from PyQt4.QtGui import QApplication from E5Gui.E5Application import e5App - from E5Gui.E5Action import E5Action +from Utilities import determinePythonVersion import Preferences # Start-Of-Header @@ -44,7 +45,12 @@ class CodeStyleCheckerPlugin(QObject): """ Class implementing the code style checker plug-in. + + @signal styleChecked(str, dict, int, list) emited when the style check was + done. """ + styleChecked = pyqtSignal(str, dict, int, list) + def __init__(self, ui): """ Constructor @@ -55,6 +61,17 @@ self.__ui = ui self.__initialize() + self.backgroundService = e5App().getObject("BackgroundService") + + path = os.path.join( + os.path.dirname(__file__), 'CheckerPlugins', 'CodeStyleChecker') + for lang in ['Python2', 'Python3']: + self.backgroundService.serviceConnect( + 'style', lang, path, 'CodeStyleChecker', + self.__translateStyleCheck, + lambda fx, fn, ver, msg: self.styleChecked.emit( + fn, {}, 0, [[1, 1, '---- ' + msg, False, False]])) + def __initialize(self): """ Private slot to (re)initialize the plugin. @@ -70,6 +87,57 @@ self.__editorAct = None self.__editorCodeStyleCheckerDialog = None + def styleCheck(self, lang, filename, source, args): + """ + Method to prepare a style check on one Python source file in another + task. + + @param lang language of the file or None to determine by internal + algorithm (str or None) + @param filename source filename (string) + @param source string containing the code to check (string) + @param args arguments used by the codeStyleCheck function (list of + excludeMessages (str), includeMessages (str), repeatMessages + (bool), fixCodes (str), noFixCodes (str), fixIssues (bool), + maxLineLength (int), hangClosing (bool), docType (str), errors + (list of str), eol (str), encoding (str)) + """ + if lang is None: + lang = 'Python{0}'.format(determinePythonVersion(filename, source)) + if lang not in ['Python2', 'Python3']: + return + + data = [source, args] + self.backgroundService.enqueueRequest('style', lang, filename, data) + + def __translateStyleCheck(self, fn, codeStyleCheckerStats, results): + """ + Privat slot called after perfoming a style check on one file. + + @param fn filename of the just checked file (str) + @param codeStyleCheckerStats stats of style and name check (dict) + @param results tuple for each found violation of style (tuple of + lineno (int), position (int), text (str), fixed (bool), + autofixing (bool), fixedMsg (str)) + """ + from CheckerPlugins.CodeStyleChecker.translations import \ + getTranslatedMessage + + fixes = 0 + for result in results: + msg = getTranslatedMessage(result[2]) + + fixedMsg = result.pop() + if fixedMsg: + fixes += 1 + trFixedMsg = getTranslatedMessage(fixedMsg) + + msg += "\n" + QApplication.translate( + 'CodeStyleCheckerDialog', "Fix: {0}").format(trFixedMsg) + + result[2] = msg + self.styleChecked.emit(fn, codeStyleCheckerStats, fixes, results) + def activate(self): """ Public method to activate this plugin. @@ -203,7 +271,7 @@ from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog import \ CodeStyleCheckerDialog - self.__projectCodeStyleCheckerDialog = CodeStyleCheckerDialog() + self.__projectCodeStyleCheckerDialog = CodeStyleCheckerDialog(self) self.__projectCodeStyleCheckerDialog.show() self.__projectCodeStyleCheckerDialog.prepare(files, project) @@ -224,7 +292,8 @@ from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog import \ CodeStyleCheckerDialog - self.__projectBrowserCodeStyleCheckerDialog = CodeStyleCheckerDialog() + self.__projectBrowserCodeStyleCheckerDialog = CodeStyleCheckerDialog( + self) self.__projectBrowserCodeStyleCheckerDialog.show() if isDir: self.__projectBrowserCodeStyleCheckerDialog.start( @@ -268,8 +337,7 @@ if menuName == "Checks": if not self.__editorAct in menu.actions(): menu.addAction(self.__editorAct) - self.__editorAct.setEnabled( - editor.isPy3File() or editor.isPy2File()) + self.__editorAct.setEnabled(editor.getPyVersion()) def __editorCodeStyleCheck(self): """ @@ -281,7 +349,8 @@ if editor.checkDirty() and editor.getFileName() is not None: from CheckerPlugins.CodeStyleChecker.CodeStyleCheckerDialog \ import CodeStyleCheckerDialog - self.__editorCodeStyleCheckerDialog = CodeStyleCheckerDialog() + self.__editorCodeStyleCheckerDialog = CodeStyleCheckerDialog( + self) self.__editorCodeStyleCheckerDialog.show() self.__editorCodeStyleCheckerDialog.start( editor.getFileName(),
--- a/Plugins/PluginSyntaxChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/PluginSyntaxChecker.py Sun Mar 30 22:00:14 2014 +0200 @@ -12,10 +12,11 @@ import os from PyQt4.QtCore import QObject - -from E5Gui.E5Application import e5App +from PyQt4.QtGui import QApplication from E5Gui.E5Action import E5Action +from E5Gui.E5Application import e5App +from eric5config import getConfig import Preferences @@ -51,6 +52,33 @@ self.__ui = ui self.__initialize() + from Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService import \ + SyntaxCheckService + self.syntaxCheckService = SyntaxCheckService() + e5App().registerObject("SyntaxCheckService", self.syntaxCheckService) + + ericPath = getConfig('ericDir') + path = os.path.join(ericPath, 'Plugins', 'CheckerPlugins', + 'SyntaxChecker') + + self.syntaxCheckService.addLanguage( + 'Python2', path, 'SyntaxCheck', + self.__getPythonOptions, + lambda: Preferences.getPython("PythonExtensions"), + self.__translateSyntaxCheck, + lambda fx, lng, fn, msg: + self.syntaxCheckService.syntaxChecked.emit( + fn, {'error': (fn, 0, 0, '', msg)})) + + self.syntaxCheckService.addLanguage( + 'Python3', path, 'SyntaxCheck', + self.__getPythonOptions, + lambda: Preferences.getPython("Python3Extensions"), + self.__translateSyntaxCheck, + lambda fx, lng, fn, msg: + self.syntaxCheckService.syntaxChecked.emit( + fn, {'error': (fn, 0, 0, '', msg)})) + def __initialize(self): """ Private slot to (re)initialize the plugin. @@ -66,6 +94,45 @@ self.__editorAct = None self.__editorSyntaxCheckerDialog = None + def __getPythonOptions(self): + """ + Private methode to determine the syntax check options. + + @return state of checkFlakes and ignoreStarImportWarnings (bool, bool) + """ + checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck") + ignoreStarImportWarnings = Preferences.getFlakes( + "IgnoreStarImportWarnings") + return checkFlakes, ignoreStarImportWarnings + + def __translateSyntaxCheck(self, fn, problems): + """ + Slot to translate the resulting messages. + + If checkFlakes is True, warnings contains a list of strings containing + the warnings (marker, file name, line number, message) + The values are only valid, if nok is False. + + @param fn filename of the checked file (str) + @param problems dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message, a list with arguments for the message) + """ + warnings = problems.get('warnings', []) + for warning in warnings: + # Translate messages + msg_args = warning.pop() + translated = QApplication.translate( + 'py3Flakes', warning[4]).format(*msg_args) + # Avoid leading "u" at Python2 unicode strings + if translated.startswith("u'"): + translated = translated[1:] + warning[4] = translated.replace(" u'", " '") + + problems['warnings'] = warnings + self.syntaxCheckService.syntaxChecked.emit(fn, problems) + def activate(self): """ Public method to activate this plugin. @@ -152,7 +219,7 @@ if menuName == "Checks" and self.__projectAct is not None: self.__projectAct.setEnabled( e5App().getObject("Project").getProjectLanguage() in - ["Python3", "Python2", "Python"]) + self.syntaxCheckService.getLanguages()) def __projectBrowserShowMenu(self, menuName, menu): """ @@ -164,7 +231,7 @@ """ if menuName == "Checks" and \ e5App().getObject("Project").getProjectLanguage() in \ - ["Python3", "Python2", "Python"]: + self.syntaxCheckService.getLanguages(): self.__projectBrowserMenu = menu if self.__projectBrowserAct is None: self.__projectBrowserAct = E5Action( @@ -187,11 +254,10 @@ project = e5App().getObject("Project") project.saveAllScripts() ppath = project.getProjectPath() + extensions = tuple(self.syntaxCheckService.getExtensions()) files = [os.path.join(ppath, file) for file in project.pdata["SOURCES"] - if file.endswith( - tuple(Preferences.getPython("Python3Extensions")) + - tuple(Preferences.getPython("PythonExtensions")))] + if file.endswith(extensions)] from CheckerPlugins.SyntaxChecker.SyntaxCheckerDialog import \ SyntaxCheckerDialog @@ -254,7 +320,7 @@ if not self.__editorAct in menu.actions(): menu.addAction(self.__editorAct) self.__editorAct.setEnabled( - editor.isPy3File() or editor.isPy2File()) + editor.getLanguage() in self.syntaxCheckService.getLanguages()) def __editorSyntaxCheck(self): """
--- a/Plugins/PluginTabnanny.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/PluginTabnanny.py Sun Mar 30 22:00:14 2014 +0200 @@ -11,12 +11,12 @@ import os -from PyQt4.QtCore import QObject +from PyQt4.QtCore import QObject, pyqtSignal from E5Gui.E5Application import e5App - from E5Gui.E5Action import E5Action +from Utilities import determinePythonVersion import Preferences # Start-Of-Header @@ -40,7 +40,12 @@ class TabnannyPlugin(QObject): """ Class implementing the Tabnanny plugin. + + @signal indentChecked(str, bool, str, str) emited when the indent + check was done. """ + indentChecked = pyqtSignal(str, bool, str, str) + def __init__(self, ui): """ Constructor @@ -51,6 +56,17 @@ self.__ui = ui self.__initialize() + self.backgroundService = e5App().getObject("BackgroundService") + + path = os.path.join( + os.path.dirname(__file__), 'CheckerPlugins', 'Tabnanny') + for lang in ['Python2', 'Python3']: + self.backgroundService.serviceConnect( + 'indent', lang, path, 'Tabnanny', + lambda *args: self.indentChecked.emit(*args), + lambda fx, fn, ver, msg: self.indentChecked.emit( + fn, True, "1", msg)) + def __initialize(self): """ Private slot to (re)initialize the plugin. @@ -66,6 +82,24 @@ self.__editorAct = None self.__editorTabnannyDialog = None + def indentCheck(self, lang, filename, source): + """ + Method to prepare a style check on one Python source file in another + task. + + @param lang language of the file or None to determine by internal + algorithm (str or None) + @param filename source filename (string) + @param source string containing the code to check (string) + """ + if lang is None: + lang = 'Python{0}'.format(determinePythonVersion(filename, source)) + if lang not in ['Python2', 'Python3']: + return + + self.backgroundService.enqueueRequest( + 'indent', lang, filename, [source]) + def activate(self): """ Public method to activate this plugin. @@ -197,7 +231,7 @@ tuple(Preferences.getPython("PythonExtensions")))] from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog - self.__projectTabnannyDialog = TabnannyDialog() + self.__projectTabnannyDialog = TabnannyDialog(self) self.__projectTabnannyDialog.show() self.__projectTabnannyDialog.prepare(files, project) @@ -215,7 +249,7 @@ fn = itm.dirName() from CheckerPlugins.Tabnanny.TabnannyDialog import TabnannyDialog - self.__projectBrowserTabnannyDialog = TabnannyDialog() + self.__projectBrowserTabnannyDialog = TabnannyDialog(self) self.__projectBrowserTabnannyDialog.show() self.__projectBrowserTabnannyDialog.start(fn) @@ -254,8 +288,7 @@ if menuName == "Checks": if not self.__editorAct in menu.actions(): menu.addAction(self.__editorAct) - self.__editorAct.setEnabled( - editor.isPy3File() or editor.isPy2File()) + self.__editorAct.setEnabled(editor.getPyVersion()) def __editorTabnanny(self): """ @@ -266,6 +299,6 @@ if editor.checkDirty() and editor.getFileName() is not None: from CheckerPlugins.Tabnanny.TabnannyDialog import \ TabnannyDialog - self.__editorTabnannyDialog = TabnannyDialog() + self.__editorTabnannyDialog = TabnannyDialog(self) self.__editorTabnannyDialog.show() self.__editorTabnannyDialog.start(editor.getFileName())
--- a/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Plugins/WizardPlugins/FileDialogWizard/FileDialogWizardDialog.py Sun Mar 30 22:00:14 2014 +0200 @@ -281,9 +281,9 @@ if (self.__pyqtVariant == 4 and self.__typeButtonsGroup.checkedButton() in [ self.rfOpenFile, self.rfOpenFiles, self.rfSaveFile]) or \ - (self.__pyqtVariant == 5 and - self.__typeButtonsGroup.checkedButton() in [ - self.rOpenFile, self.rOpenFiles, self.rSaveFile]): + (self.__pyqtVariant == 5 and + self.__typeButtonsGroup.checkedButton() in [ + self.rOpenFile, self.rOpenFiles, self.rSaveFile]): filterVariable = ", selectedFilter" else: filterVariable = ""
--- a/QScintilla/Editor.py Sun Jan 05 23:22:17 2014 +0100 +++ b/QScintilla/Editor.py Sun Mar 30 22:00:14 2014 +0200 @@ -8,9 +8,9 @@ """ from __future__ import unicode_literals try: - str = unicode # __IGNORE_WARNING__ - chr = unichr # __IGNORE_WARNING__ -except (NameError): + str = unicode + chr = unichr +except NameError: pass import os @@ -312,6 +312,8 @@ self.__setTextDisplay() # initialize the online syntax check timer + self.syntaxCheckService = e5App().getObject('SyntaxCheckService') + self.syntaxCheckService.syntaxChecked.connect(self.__processResult) self.__initOnlineSyntaxCheck() self.isResourcesFile = False @@ -331,9 +333,8 @@ if not res: raise IOError() self.readFile(self.fileName, True) - bindName = self.__bindName(self.text(0)) - self.__bindLexer(bindName) - self.__bindCompleter(bindName) + self.__bindLexer(self.fileName) + self.__bindCompleter(self.fileName) self.__autoSyntaxCheck() self.isResourcesFile = self.fileName.endswith(".qrc") @@ -1464,28 +1465,24 @@ self.SCN_STYLENEEDED.disconnect(self.__styleNeeded) language = "" + basename = os.path.basename(filename) if self.project.isOpen() and self.project.isProjectFile(filename): - language = self.project.getEditorLexerAssoc( - os.path.basename(filename)) + language = self.project.getEditorLexerAssoc(basename) + if not language: + language = Preferences.getEditorLexerAssoc(basename) if not language: - ext = os.path.splitext(filename)[1] - if ext in [".py", ".pyw"]: - if self.isPy3File(): - language = "Python3" - elif self.isPy2File(): - language = "Python2" - else: - # default is Python 3 - language = "Python3" - else: - filename = os.path.basename(filename) - language = Preferences.getEditorLexerAssoc(filename) - if language == "Python": - # correction for Python - if self.isPy2File(): - language = "Python2" - else: - language = "Python3" + bindName = self.__bindName(self.text(0)) + language = Preferences.getEditorLexerAssoc(bindName) + if language == "Python": + # correction for Python + pyVer = Utilities.determinePythonVersion( + filename, self.text(0), self) + language = "Python{0}".format(pyVer) + if language in ['Python2', 'Python3']: + self.filetype = language + else: + self.filetype = "" + if language.startswith("Pygments|"): pyname = language.split("|", 1)[1] language = "" @@ -1593,10 +1590,9 @@ filename = os.path.basename(filename) apiLanguage = Preferences.getEditorLexerAssoc(filename) if apiLanguage == "": - if self.isPy3File(): - apiLanguage = "Python3" - elif self.isPy2File(): - apiLanguage = "Python2" + pyVer = self.getPyVersion() + if pyVer: + apiLanguage = "Python{0}".format(pyVer) elif self.isRubyFile(): apiLanguage = "Ruby" @@ -1725,12 +1721,9 @@ """ ftype = self.filetype if not ftype: - ftype = self.getFileTypeByFlag() - if not ftype: - if self.isPy3File(): - ftype = "Python3" - elif self.isPy2File(): - ftype = "Python2" + pyVer = self.getPyVersion() + if pyVer: + ftype = "Python{0}".format(pyVer) elif self.isRubyFile(): ftype = "Ruby" else: @@ -1745,51 +1738,24 @@ @return current encoding (string) """ return self.encoding - + + def getPyVersion(self): + """ + Public methode to return the Python main version (2 or 3) or 0 if it's + not a Python file at all. + + @return Python version (2 or 3) or 0 if it's not a Python file (int) + """ + return Utilities.determinePythonVersion( + self.fileName, self.text(0), self) + def isPy2File(self): """ Public method to return a flag indicating a Python file. @return flag indicating a Python file (boolean) """ - if self.filetype in ["Python", "Python2"]: - return True - - if self.filetype == "": - # 1) Determine by first line - line0 = self.text(0) - if line0.startswith("#!") and \ - ("python2" in line0 or - ("python" in line0 and not "python3" in line0)): - self.filetype = "Python2" - return True - - if self.fileName is not None: - ext = os.path.splitext(self.fileName)[1] - if ext in [".py", ".pyw"]: - # 2) .py and .pyw are ambiguous; determine from project - if Preferences.getProject("DeterminePyFromProject") and \ - self.project.isOpen() and \ - self.project.isProjectFile(self.fileName): - isProjectPy2 = \ - self.project.getProjectLanguage() in ["Python", - "Python2"] - if isProjectPy2: - self.filetype = "Python2" - return isProjectPy2 - else: - # 3) determine by compiling the sources - syntaxError = Utilities.compile( - self.fileName, self.text(), True)[0] - if not syntaxError: - self.filetype = "Python2" - return True - - if ext in self.dbs.getExtensions('Python2'): - self.filetype = "Python2" - return True - - return False + return self.getPyVersion() == 2 def isPy3File(self): """ @@ -1797,42 +1763,7 @@ @return flag indicating a Python3 file (boolean) """ - if self.filetype in ["Python3"]: - return True - - if self.filetype == "": - # 1) Determine by first line - line0 = self.text(0) - if line0.startswith("#!") and \ - "python3" in line0: - self.filetype = "Python3" - return True - - if self.fileName is not None: - ext = os.path.splitext(self.fileName)[1] - if ext in [".py", ".pyw"]: - # 2) .py and .pyw are ambiguous; determine from project - if Preferences.getProject("DeterminePyFromProject") and \ - self.project.isOpen() and \ - self.project.isProjectFile(self.fileName): - isProjectPy3 = \ - self.project.getProjectLanguage() in ["Python3"] - if isProjectPy3: - self.filetype = "Python3" - return isProjectPy3 - else: - # 3) determine by compiling the sources - syntaxError = Utilities.compile( - self.fileName, self.text(), False)[0] - if not syntaxError: - self.filetype = "Python3" - return True - - if ext in self.dbs.getExtensions('Python3'): - self.filetype = "Python3" - return True - - return False + return self.getPyVersion() == 3 def isRubyFile(self): """ @@ -2085,7 +2016,7 @@ @param temporary flag indicating a temporary breakpoint (boolean) """ if self.fileName and \ - (self.isPy3File() or self.isPy2File() or self.isRubyFile()): + (self.getPyVersion() or self.isRubyFile()): self.breakpointModel.addBreakPoint( self.fileName, line, ('', temporary, True, 0)) self.breakpointToggled.emit(self) @@ -3770,7 +3701,7 @@ @param goUp flag indicating the move direction (boolean) """ - if self.isPy3File() or self.isPy2File() or self.isRubyFile(): + if self.getPyVersion() or self.isRubyFile(): lineNo = self.getCursorPosition()[0] line = self.text(lineNo) if line.strip().startswith(("class ", "def ", "module ")): @@ -4604,13 +4535,12 @@ self.menuActs["Cut"].setEnabled(self.hasSelectedText()) self.menuActs["Copy"].setEnabled(self.hasSelectedText()) if not self.isResourcesFile: - if self.fileName and \ - (self.isPy3File() or self.isPy2File()): + if self.fileName and self.getPyVersion(): self.menuActs["Show"].setEnabled(True) else: self.menuActs["Show"].setEnabled(False) if self.fileName and \ - (self.isPy3File() or self.isPy2File() or self.isRubyFile()): + (self.getPyVersion() or self.isRubyFile()): self.menuActs["Diagrams"].setEnabled(True) else: self.menuActs["Diagrams"].setEnabled(False) @@ -4746,8 +4676,7 @@ Private slot handling the aboutToShow signal of the margins context menu. """ - if self.fileName and \ - (self.isPy3File() or self.isPy2File() or self.isRubyFile()): + if self.fileName and (self.getPyVersion() or self.isRubyFile()): self.marginMenuActs["Breakpoint"].setEnabled(True) self.marginMenuActs["TempBreakpoint"].setEnabled(True) if self.markersAtLine(self.line) & self.breakpointMask: @@ -4984,26 +4913,43 @@ """ Private method to perform an automatic syntax check of the file. """ - isPy2 = self.isPy2File() - if (isPy2 or self.isPy3File()) is False: + if self.filetype not in self.syntaxCheckService.getLanguages(): return if Preferences.getEditor("AutoCheckSyntax"): if Preferences.getEditor("OnlineSyntaxCheck"): self.__onlineSyntaxCheckTimer.stop() - self.clearSyntaxError() - self.clearFlakesWarnings() + + self.syntaxCheckService.syntaxCheck( + self.filetype, self.fileName or "(Unnamed)", self.text()) - syntaxError, _fn, errorline, errorindex, _code, _error, warnings =\ - Utilities.compile( - self.fileName or "(Unnamed)", self.text(), isPy2) - if syntaxError: - self.toggleSyntaxError(errorline, errorindex, True, _error) - else: - for warning in warnings: - self.toggleWarning( - warning[2], True, warning[3]) - + def __processResult(self, fn, problems): + """ + Slot to report the resulting messages. + + @param fn filename of the checked file (str) + @param problems dictionary with the keys 'error' and 'warnings' which + hold a list containing details about the error/ warnings + (file name, line number, column, codestring (only at syntax + errors), the message) (dict) + """ + # Check if it's the requested file, otherwise ignore signal + if fn != self.fileName and ( + self.fileName is not None or fn != "(Unnamed)"): + return + + self.clearSyntaxError() + self.clearFlakesWarnings() + + error = problems.get('error') + if error: + _fn, lineno, col, code, msg = error + self.toggleSyntaxError(lineno, col, True, msg) + + warnings = problems.get('warnings', []) + for _fn, lineno, col, code, msg in warnings: + self.toggleWarning(lineno, col, True, msg) + def __initOnlineSyntaxCheck(self): """ Private slot to initialize the online syntax check. @@ -5390,13 +5336,15 @@ ## Warning handling methods below ########################################################################### - def toggleWarning(self, line, warning, msg="", warningType=WarningCode): + def toggleWarning( + self, line, col, warning, msg="", warningType=WarningCode): """ Public method to toggle a warning indicator. Note: This method is used to set pyflakes and code style warnings. @param line line number of the warning + @param col column of the warning @param warning flag indicating if the warning marker should be set or deleted (boolean) @param msg warning message (string) @@ -5882,6 +5830,8 @@ self.breakpointModel.rowsInserted.disconnect( self.__addBreakPoints) + self.syntaxCheckService.syntaxChecked.disconnect(self.__processResult) + if self.spell: self.spell.stopIncrementalCheck()
--- a/UI/UserInterface.py Sun Jan 05 23:22:17 2014 +0100 +++ b/UI/UserInterface.py Sun Mar 30 22:00:14 2014 +0200 @@ -202,6 +202,10 @@ from Debugger.DebugServer import DebugServer debugServer = DebugServer() + # Create the background service object + from Utilities.BackgroundService import BackgroundService + self.backgroundService = BackgroundService() + # Generate an empty project object and multi project object from Project.Project import Project self.project = Project(self) @@ -450,6 +454,7 @@ e5App().registerObject("UserInterface", self) e5App().registerObject("DebugUI", self.debuggerUI) e5App().registerObject("DebugServer", debugServer) + e5App().registerObject("BackgroundService", self.backgroundService) e5App().registerObject("ViewManager", self.viewmanager) e5App().registerObject("Project", self.project) e5App().registerObject("ProjectBrowser", self.projectBrowser) @@ -5372,8 +5377,7 @@ self.utEditorOpen = cap & HasUnittest return - if self.viewmanager.getOpenEditor(fn).isPy3File() or \ - self.viewmanager.getOpenEditor(fn).isPy2File(): + if self.viewmanager.getOpenEditor(fn).getPyVersion(): self.utScriptAct.setEnabled(True) self.utEditorOpen = True @@ -5399,7 +5403,7 @@ self.utEditorOpen = cap & HasUnittest return - if editor.isPy3File() or editor.isPy2File(): + if editor.getPyVersion(): self.utScriptAct.setEnabled(True) self.utEditorOpen = True return @@ -5741,6 +5745,8 @@ return False self.debuggerUI.shutdown() + self.backgroundService.shutdown() + self.cooperation.shutdown() self.pluginManager.doShutdown()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Utilities/BackgroundClient.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,143 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# pylint: disable=C0103 + +""" +Module implementing a Qt free version of a background client for the various +checkers and other python interpreter dependent functions. +""" + +from __future__ import unicode_literals +try: + bytes = unicode + import StringIO as io # __IGNORE_EXCEPTION__ +except NameError: + import io # __IGNORE_WARNING__ + +import json +import socket +import struct +import sys +import traceback +from zlib import adler32 + + +class BackgroundClient(object): + """ + Class implementing the main part of the background client. + """ + def __init__(self, host, port): + """ + Constructor of the BackgroundClient class. + + @param host ip address the background service is listening + @param port port of the background service + """ + self.services = {} + + self.connection = socket.create_connection((host, port)) + ver = b'Python2' if sys.version_info[0] == 2 else b'Python3' + self.connection.sendall(ver) + + def __initClientService(self, fn, path, module): + """ + Import the given module and register it as service. + + @param fn service name to register (str) + @param path contains the path to the module (str) + @param module name to import (str) + @return text result of the import action (str) + """ + sys.path.append(path) + try: + importedModule = __import__(module, globals(), locals(), [], 0) + self.services[fn] = importedModule.initService() + return 'ok' + except ImportError: + return 'Import Error' + + def __send(self, fx, fn, data): + """ + Private method to send a job response back to the BackgroundService. + + @param fx remote function name to execute (str) + @param fn filename for identification (str) + @param data return value(s) (any basic datatype) + """ + packedData = json.dumps([fx, fn, data]) + if sys.version_info[0] == 3: + packedData = bytes(packedData, 'utf-8') + header = struct.pack( + b'!II', len(packedData), adler32(packedData) & 0xffffffff) + self.connection.sendall(header) + self.connection.sendall(packedData) + + def __receive(self, length): + """ + Private methode to receive the given length of bytes. + + @param length bytes to receive (int) + @return received bytes or None if connection closed (str) + """ + data = b'' + while len(data) < length: + newData = self.connection.recv(length - len(data)) + if not newData: + return None + data += newData + return data + + def run(self): + """ + Implement the main loop of the client. + """ + try: + while True: + header = self.__receive(8) + # Leave main loop if connection was closed. + if not header: + break + + length, datahash = struct.unpack(b'!II', header) + packedData = self.__receive(length) + + assert adler32(packedData) & 0xffffffff == datahash, \ + 'Hashes not equal' + if sys.version_info[0] == 3: + packedData = packedData.decode('utf-8') + + fx, fn, data = json.loads(packedData) + if fx == 'INIT': + ret = self.__initClientService(fn, *data) + else: + callback = self.services.get(fx) + if callback: + ret = callback(fn, *data) + else: + ret = 'Unknown service.' + + self.__send(fx, fn, ret) + except: + exctype, excval, exctb = sys.exc_info() + tbinfofile = io.StringIO() + traceback.print_tb(exctb, None, tbinfofile) + tbinfofile.seek(0) + tbinfo = tbinfofile.read() + del exctb + self.__send( + 'EXCEPTION', '?', [str(exctype), str(excval), tbinfo]) + + self.connection.shutdown(socket.SHUT_RDWR) + self.connection.close() + +if __name__ == '__main__': + if len(sys.argv) != 3: + print('Host and port parameters are missing. Abort.') + sys.exit(1) + + host, port = sys.argv[1:] + backgroundClient = BackgroundClient(host, int(port)) + # Start the main loop + backgroundClient.run()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Utilities/BackgroundService.py Sun Mar 30 22:00:14 2014 +0200 @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# +# pylint: disable=C0103 + +""" +Module implementing a background service for the various checkers and other +python interpreter dependent functions. +""" + +from __future__ import unicode_literals + +import json +import os +import struct +import sys +import threading +from zlib import adler32 + +from PyQt4.QtCore import QProcess, pyqtSignal +from PyQt4.QtGui import QApplication +from PyQt4.QtNetwork import QTcpServer, QHostAddress + +import Preferences +import Utilities +from Utilities.BackgroundClient import BackgroundClient + +from eric5config import getConfig + + +class BackgroundService(QTcpServer): + """ + Class implementing the main part of the background service. + """ + serviceNotAvailable = pyqtSignal(str, str, str, str) + + def __init__(self): + """ + Constructor of the BackgroundService class. + """ + self.processes = [] + self.connections = {} + self.isWorking = None + self.__queue = [] + self.services = {} + + super(BackgroundService, self).__init__() + + networkInterface = Preferences.getDebugger("NetworkInterface") + if networkInterface == "all" or '.' in networkInterface: + self.hostAddress = '127.0.0.1' + else: + self.hostAddress = '::1' + self.listen(QHostAddress(self.hostAddress)) + + self.newConnection.connect(self.on_newConnection) + + port = self.serverPort() + ## NOTE: Need the port if started external in debugger: + print('BackgroundService listening on: %i' % port) + if sys.platform == 'win32': + interpreterCompare = Utilities.samefilepath + else: + interpreterCompare = Utilities.samepath + + for pyName in ['Python', 'Python3']: + interpreter = Preferences.getDebugger( + pyName + "Interpreter") + + if interpreterCompare(interpreter, sys.executable): + process = self.__startInternalClient(port) + else: + process = self.__startExternalClient(interpreter, port) + if process: + self.processes.append(process) + + def __startExternalClient(self, interpreter, port): + """ + Private method to start the background client as external process. + + @param interpreter path and name of the executable to start (string) + @param port socket port to which the interpreter should connect (int) + @return the process object (QProcess or None) + """ + if interpreter == "" or not Utilities.isinpath(interpreter): + return None + + backgroundClient = os.path.join( + getConfig('ericDir'), + "Utilities", "BackgroundClient.py") + proc = QProcess() + args = [backgroundClient, self.hostAddress, str(port)] + proc.start(interpreter, args) + if not proc.waitForStarted(10000): + proc = None + return proc + + def __startInternalClient(self, port): + """ + Private method to start the background client as internal thread. + + @param port socket port to which the interpreter should connect (int) + @return the thread object (Thread) or None + """ + backgroundClient = BackgroundClient( + self.hostAddress, port) + thread = threading.Thread(target=backgroundClient.run) + thread.start() + return thread + + def __processQueue(self): + """ + Private method to take the next service request and send it to the + client. + """ + if self.__queue and self.isWorking is None: + fx, lang, fn, data = self.__queue.pop(0) + self.isWorking = lang + self.__send(fx, lang, fn, data) + + def __send(self, fx, lang, fn, data): + """ + Private method to send a job request to one of the clients. + + @param fx remote function name to execute (str) + @param lang language to connect to (str) + @param fn filename for identification (str) + @param data function argument(s) (any basic datatype) + """ + connection = self.connections.get(lang) + if connection is None: + if fx != 'INIT': + self.serviceNotAvailable.emit( + fx, lang, fn, self.trUtf8( + '{0} not configured.').format(lang)) + # Reset flag and continue processing queue + self.isWorking = None + self.__processQueue() + else: + packedData = json.dumps([fx, fn, data]) + if sys.version_info[0] == 3: + packedData = bytes(packedData, 'utf-8') + header = struct.pack( + b'!II', len(packedData), adler32(packedData) & 0xffffffff) + connection.write(header) + connection.write(packedData) + + def __receive(self, lang): + """ + Private method to receive the response from the clients. + + @param lang language of the incomming connection (str) + """ + connection = self.connections[lang] + header = connection.read(8) + length, datahash = struct.unpack(b'!II', header) + + packedData = b'' + while len(packedData) < length: + connection.waitForReadyRead(50) + packedData += connection.read(length - len(packedData)) + + assert adler32(packedData) & 0xffffffff == datahash, 'Hashes not equal' + if sys.version_info[0] == 3: + packedData = packedData.decode('utf-8') + # "check" if is's a tuple of 3 values + fx, fn, data = json.loads(packedData) + + if fx == 'INIT': + pass + elif fx == 'EXCEPTION': + # Call sys.excepthook(type, value, traceback) to emulate the + # exception which was caught on the client + sys.excepthook(*data) + QApplication.processEvents() + elif data == 'Unknown service.': + callback = self.services.get((fx, lang)) + if callback: + callback[3](fx, lang, fn, data) + else: + callback = self.services.get((fx, lang)) + if callback: + callback[2](fn, *data) + + self.isWorking = None + self.__processQueue() + + def enqueueRequest(self, fx, lang, fn, data): + """ + Implement a queued processing of incomming events. + + Dublicate service requests updates an older request to avoid overrun or + starving of the services. + @param fx function name of the service (str) + @param lang language to connect to (str) + @param fn filename for identification (str) + @param data function argument(s) (any basic datatype(s)) + """ + args = [fx, lang, fn, data] + if fx == 'INIT': + self.__queue.insert(0, args) + else: + for pendingArg in self.__queue: + # Check if it's the same service request (fx, lang, fn equal) + if pendingArg[:3] == args[:3]: + # Update the data + pendingArg[3] = args[3] + break + else: + self.__queue.append(args) + self.__processQueue() + + def serviceConnect( + self, fx, lang, modulepath, module, callback, + onErrorCallback=None): + """ + Announce a new service to the background service/ client. + + @param fx function name of the service (str) + @param lang language of the new service (str) + @param modulepath full path to the module (str) + @param module name to import (str) + @param callback function on service response (function) + @param onErrorCallback function if client isn't available (function) + """ + self.services[(fx, lang)] = \ + modulepath, module, callback, onErrorCallback + self.enqueueRequest('INIT', lang, fx, [modulepath, module]) + if onErrorCallback: + self.serviceNotAvailable.connect(onErrorCallback) + + def serviceDisconnect(self, fx, lang): + """ + Remove the service from the service list. + + @param fx function name of the service (function) + @param lang language of the service (str) + """ + serviceArgs = self.services.pop((fx, lang), None) + if serviceArgs and serviceArgs[3]: + self.serviceNotAvailable.disconnect(serviceArgs[3]) + + def on_newConnection(self): + """ + Slot for new incomming connections from the clients. + """ + connection = self.nextPendingConnection() + if not connection.waitForReadyRead(1000): + return + lang = connection.read(64) + if sys.version_info[0] == 3: + lang = lang.decode('utf-8') + # Avoid hanging of eric on shutdown + if self.connections.get(lang): + self.connections[lang].close() + if self.isWorking == lang: + self.isWorking = None + self.connections[lang] = connection + connection.readyRead.connect( + lambda x=lang: self.__receive(x)) + connection.disconnected.connect( + lambda x=lang: self.on_disconnectSocket(x)) + + for (fx, lng), args in self.services.items(): + if lng == lang: + # Register service with modulepath and module + self.enqueueRequest('INIT', lng, fx, args[:2]) + + def on_disconnectSocket(self, lang): + """ + Slot when connection to a client is lost. + + @param lang client language which connection is lost (str) + """ + self.connections.pop(lang) + # Maybe the task is killed while ideling + if self.isWorking == lang: + self.isWorking = None + # Remove pending jobs and send warning to the waiting caller + # Make a copy of the list because it's modified in the loop + for args in self.__queue[:]: + fx, lng, fn, data = args + if lng == lang: + # Call onErrorCallback with error message + self.__queue.remove(args) + self.services[(fx, lng)][3](fx, fn, lng, self.tr( + 'Error in Erics background service stopped service.')) + + def shutdown(self): + """ + Cleanup the connections and processes when Eric is shuting down. + """ + # Make copy of dictionary values because the list is changed by + # on_disconnectSocket + for connection in list(self.connections.values()): + if connection: + connection.close() + + for process in self.processes: + if isinstance(process, QProcess): + process.close() + process = None + elif isinstance(process, threading.Thread): + process.join(0.1) + process = None
--- a/Utilities/SyntaxCheck.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing the syntax check for Python 2/3. -""" - -import sys -if sys.version_info[0] >= 3: - if __name__ == '__main__': - from py3flakes.checker import Checker - from py3flakes.messages import ImportStarUsed - else: - from .py3flakes.checker import Checker #__IGNORE_WARNING__ - from .py3flakes.messages import ImportStarUsed #__IGNORE_WARNING__ -else: - str = unicode #__IGNORE_WARNING__ - if __name__ == '__main__': - from py2flakes.checker import Checker #__IGNORE_WARNING__ - from py2flakes.messages import ImportStarUsed #__IGNORE_WARNING__ - else: - from .py2flakes.checker import Checker #__IGNORE_WARNING__ - from .py2flakes.messages import ImportStarUsed #__IGNORE_WARNING__ - -import re -import traceback -from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF32 - -try: - import Preferences -except (ImportError): - pass - -codingBytes_regexps = [ - (2, re.compile(br'''coding[:=]\s*([-\w_.]+)''')), - (1, re.compile(br'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')), -] - - -def get_codingBytes(text): - """ - Function to get the coding of a bytes text. - - @param text bytes text to inspect (bytes) - @return coding string - """ - lines = text.splitlines() - for coding in codingBytes_regexps: - coding_re = coding[1] - head = lines[:coding[0]] - for l in head: - m = coding_re.search(l) - if m: - return str(m.group(1), "ascii").lower() - return None - - -def decode(text): - """ - Function to decode some byte text into a string. - - @param text byte text to decode (bytes) - @return tuple of decoded text and encoding (string, string) - """ - try: - if text.startswith(BOM_UTF8): - # UTF-8 with BOM - return str(text[len(BOM_UTF8):], 'utf-8'), 'utf-8-bom' - elif text.startswith(BOM_UTF16): - # UTF-16 with BOM - return str(text[len(BOM_UTF16):], 'utf-16'), 'utf-16' - elif text.startswith(BOM_UTF32): - # UTF-32 with BOM - return str(text[len(BOM_UTF32):], 'utf-32'), 'utf-32' - coding = get_codingBytes(text) - if coding: - return str(text, coding), coding - except (UnicodeError, LookupError): - pass - - # Assume UTF-8 - try: - return str(text, 'utf-8'), 'utf-8-guessed' - except (UnicodeError, LookupError): - pass - - try: - guess = None - if Preferences.getEditor("AdvancedEncodingDetection"): - # Try the universal character encoding detector - try: - import ThirdParty.CharDet.chardet - guess = ThirdParty.CharDet.chardet.detect(text) - if guess and guess['confidence'] > 0.95 \ - and guess['encoding'] is not None: - codec = guess['encoding'].lower() - return str(text, codec), '{0}-guessed'.format(codec) - except (UnicodeError, LookupError, ImportError): - pass - except (NameError): - pass - - # Try default encoding - try: - codec = Preferences.getEditor("DefaultEncoding") - return str(text, codec), '{0}-default'.format(codec) - except (UnicodeError, LookupError, NameError): - pass - - try: - if Preferences.getEditor("AdvancedEncodingDetection"): - # Use the guessed one even if confifence level is low - if guess and guess['encoding'] is not None: - try: - codec = guess['encoding'].lower() - return str(text, codec), '{0}-guessed'.format(codec) - except (UnicodeError, LookupError): - pass - except (NameError): - pass - - # Assume UTF-8 loosing information - return str(text, "utf-8", "ignore"), 'utf-8-ignore' - - -def readEncodedFile(filename): - """ - Function to read a file and decode it's contents into proper text. - - @param filename name of the file to read (string) - @return tuple of decoded text and encoding (string, string) - """ - try: - filename = filename.encode(sys.getfilesystemencoding()) - except (UnicodeDecodeError): - pass - f = open(filename, "rb") - text = f.read() - f.close() - return decode(text) - - -def normalizeCode(codestring): - """ - Function to normalize the given code. - - @param codestring code to be normalized (string) - @return normalized code (string) - """ - codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") - - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - - # Check type for py2: if not str it's unicode - if sys.version_info[0] == 2: - try: - codestring = codestring.encode('utf-8') - except: - pass - - return codestring - - -def extractLineFlags(line, startComment="#", endComment=""): - """ - Function to extract flags starting and ending with '__' from a line - comment. - - @param line line to extract flags from (string) - @keyparam startComment string identifying the start of the comment (string) - @keyparam endComment string identifying the end of a comment (string) - @return list containing the extracted flags (list of strings) - """ - flags = [] - - pos = line.rfind(startComment) - if pos >= 0: - comment = line[pos + len(startComment):].strip() - if endComment: - comment = comment.replace("endComment", "") - flags = [f.strip() for f in comment.split() - if (f.startswith("__") and f.endswith("__"))] - return flags - - -def compile_and_check(file_, codestring="", checkFlakes=True, - ignoreStarImportWarnings=False): - """ - Function to compile one Python source file to Python bytecode - and to perform a pyflakes check. - - @param file_ source filename (string) - @param codestring string containing the code to compile (string) - @keyparam checkFlakes flag indicating to do a pyflakes check (boolean) - @keyparam ignoreStarImportWarnings flag indicating to - ignore 'star import' warnings (boolean) - @return 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). If checkFlakes is True, a list of strings containing the - warnings (marker, file name, line number, message) - The values are only valid, if the status is True. - """ - try: - import builtins - except ImportError: - import __builtin__ as builtins #__IGNORE_WARNING__ - - try: - if sys.version_info[0] == 2: - file_enc = file_.encode(sys.getfilesystemencoding()) - else: - file_enc = file_ - - if not codestring: - try: - codestring = readEncodedFile(file_)[0] - except (UnicodeDecodeError, IOError): - return (False, None, None, None, None, None, []) - - codestring = normalizeCode(codestring) - - if file_.endswith('.ptl'): - try: - import quixote.ptl_compile - except ImportError: - return (False, None, None, None, None, None, []) - template = quixote.ptl_compile.Template(codestring, file_enc) - template.compile() - - # ast.PyCF_ONLY_AST = 1024, speed optimisation - module = builtins.compile(codestring, file_enc, 'exec', 1024) - except SyntaxError as detail: - index = 0 - code = "" - error = "" - lines = traceback.format_exception_only(SyntaxError, detail) - match = re.match('\s*File "(.+)", line (\d+)', - lines[0].replace('<string>', '{0}'.format(file_))) - if match is not None: - fn, line = match.group(1, 2) - if lines[1].startswith('SyntaxError:'): - error = re.match('SyntaxError: (.+)', lines[1]).group(1) - else: - code = re.match('(.+)', lines[1]).group(1) - for seLine in lines[2:]: - if seLine.startswith('SyntaxError:'): - error = re.match('SyntaxError: (.+)', seLine).group(1) - elif seLine.rstrip().endswith('^'): - index = len(seLine.rstrip()) - 4 - else: - fn = detail.filename - line = detail.lineno or 1 - error = detail.msg - return (True, fn, int(line), index, code, error, []) - except ValueError as detail: - index = 0 - code = "" - try: - fn = detail.filename - line = detail.lineno - error = detail.msg - except AttributeError: - fn = file_ - line = 1 - error = str(detail) - return (True, fn, line, index, code, error, []) - except Exception as detail: - try: - fn = detail.filename - line = detail.lineno - index = 0 - code = "" - error = detail.msg - return (True, fn, line, index, code, error, []) - except: # this catchall is intentional - pass - - # pyflakes - if not checkFlakes: - return (False, "", -1, -1, "", "", []) - - strings = [] - lines = codestring.splitlines() - try: - warnings = Checker(module, file_) - warnings.messages.sort(key=lambda a: a.lineno) - for warning in warnings.messages: - if ignoreStarImportWarnings and \ - isinstance(warning, ImportStarUsed): - continue - - _fn, lineno, message, msg_args = warning.getMessageData() - if "__IGNORE_WARNING__" not in extractLineFlags( - lines[lineno - 1].strip()): - strings.append([ - "FLAKES_WARNING", _fn, lineno, message, msg_args]) - except SyntaxError as err: - if err.text.strip(): - msg = err.text.strip() - else: - msg = err.msg - strings.append(["FLAKES_ERROR", file_, err.lineno, msg, ()]) - - return (False, "", -1, -1, "", "", strings) - - -if __name__ == "__main__": - if len(sys.argv) < 2 or \ - len(sys.argv) > 3 or \ - (len(sys.argv) == 3 and sys.argv[1] not in ["-fi", "-fs"]): - print("ERROR") - print("") - print("") - print("") - print("") - print("No file name given.") - else: - filename = sys.argv[-1] - checkFlakes = len(sys.argv) == 3 - # Setting is ignored if checkFlakes is False - ignoreStarImportWarnings = sys.argv[1] == "-fi" - - try: - codestring = readEncodedFile(filename)[0] - - syntaxerror, fname, line, index, code, error, warnings = \ - compile_and_check(filename, codestring, checkFlakes, - ignoreStarImportWarnings) - except IOError as msg: - # fake a syntax error - syntaxerror, fname, line, index, code, error, warnings = \ - True, filename, 1, 0, "", "I/O Error: %s" % str(msg), [] - - if syntaxerror: - print("ERROR") - else: - print("NO_ERROR") - print(fname) - print(line) - print(index) - print(code) - print(error) - - if not syntaxerror: - for warningLine in warnings: - msg_args = warningLine.pop() - for warning in warningLine: - print(warning) - msg_args = [str(x) for x in msg_args] - print('#'.join(msg_args)) - - sys.exit(0)
--- a/Utilities/__init__.py Sun Jan 05 23:22:17 2014 +0100 +++ b/Utilities/__init__.py Sun Mar 30 22:00:14 2014 +0200 @@ -61,22 +61,26 @@ from PyQt4.Qsci import QSCINTILLA_VERSION_STR, QsciScintilla # import these methods into the Utilities namespace -from Globals import (isWindowsPlatform, isLinuxPlatform, # __IGNORE_WARNING__ - isMacPlatform, getConfigDir, setConfigDir, getPythonModulesDirectory, - getPyQt4ModulesDirectory, getQtBinariesPath) +from Globals import ( # __IGNORE_WARNING__ + isWindowsPlatform, isLinuxPlatform, isMacPlatform, getConfigDir, + setConfigDir, getPythonModulesDirectory, getPyQt4ModulesDirectory, + getQtBinariesPath) from E5Gui.E5Application import e5App from UI.Info import Program, Version import Preferences -from .SyntaxCheck import (readEncodedFile, decode, # __IGNORE_WARNING__ - extractLineFlags, normalizeCode, compile_and_check) +from Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck import normalizeCode from eric5config import getConfig configDir = None +codingBytes_regexps = [ + (2, re.compile(br'''coding[:=]\s*([-\w_.]+)''')), + (1, re.compile(br'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')), +] coding_regexps = [ (2, re.compile(r'''coding[:=]\s*([-\w_.]+)''')), (1, re.compile(r'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')), @@ -134,6 +138,24 @@ return str(self.errorMessage) +def get_codingBytes(text): + """ + Function to get the coding of a bytes text. + + @param text bytes text to inspect (bytes) + @return coding string + """ + lines = text.splitlines() + for coding in codingBytes_regexps: + coding_re = coding[1] + head = lines[:coding[0]] + for l in head: + m = coding_re.search(l) + if m: + return str(m.group(1), "ascii").lower() + return None + + def get_coding(text): """ Function to get the coding of a text. @@ -152,6 +174,19 @@ return None +def readEncodedFile(filename): + """ + Function to read a file and decode its contents into proper text. + + @param filename name of the file to read (string) + @return tuple of decoded text and encoding (string, string) + """ + f = open(filename, "rb") + text = f.read() + f.close() + return decode(text) + + def readEncodedFileWithHash(filename): """ Function to read a file, calculate a hash value and decode its contents @@ -170,6 +205,70 @@ return decode(text) + (hash, ) +def decode(text): + """ + Function to decode some byte text into a string. + + @param text byte text to decode (bytes) + @return tuple of decoded text and encoding (string, string) + """ + try: + if text.startswith(BOM_UTF8): + # UTF-8 with BOM + return str(text[len(BOM_UTF8):], 'utf-8'), 'utf-8-bom' + elif text.startswith(BOM_UTF16): + # UTF-16 with BOM + return str(text[len(BOM_UTF16):], 'utf-16'), 'utf-16' + elif text.startswith(BOM_UTF32): + # UTF-32 with BOM + return str(text[len(BOM_UTF32):], 'utf-32'), 'utf-32' + coding = get_codingBytes(text) + if coding: + return str(text, coding), coding + except (UnicodeError, LookupError): + pass + + # Assume UTF-8 + try: + return str(text, 'utf-8'), 'utf-8-guessed' + except (UnicodeError, LookupError): + pass + + guess = None + if Preferences.getEditor("AdvancedEncodingDetection"): + # Try the universal character encoding detector + try: + import ThirdParty.CharDet.chardet + guess = ThirdParty.CharDet.chardet.detect(text) + if guess and guess['confidence'] > 0.95 and \ + guess['encoding'] is not None: + codec = guess['encoding'].lower() + return str(text, codec), '{0}-guessed'.format(codec) + except (UnicodeError, LookupError): + pass + except ImportError: + pass + + # Try default encoding + try: + codec = Preferences.getEditor("DefaultEncoding") + return str(text, codec), '{0}-default'.format(codec) + except (UnicodeError, LookupError): + pass + + if Preferences.getEditor("AdvancedEncodingDetection"): + # Use the guessed one even if confifence level is low + if guess and guess['encoding'] is not None: + try: + codec = guess['encoding'].lower() + return str(text, codec), '{0}-guessed'.format(codec) + except (UnicodeError, LookupError): + pass + + # Assume UTF-8 loosing information + return str(text, "utf-8", "ignore"), 'utf-8-ignore' + + def writeEncodedFile(filename, text, orig_coding): """ Function to write a file with properly encoded text. @@ -523,6 +622,28 @@ return extractFlags(source) +def extractLineFlags(line, startComment="#", endComment=""): + """ + Function to extract flags starting and ending with '__' from a line + comment. + + @param line line to extract flags from (string) + @keyparam startComment string identifying the start of the comment (string) + @keyparam endComment string identifying the end of a comment (string) + @return list containing the extracted flags (list of strings) + """ + flags = [] + + pos = line.rfind(startComment) + if pos >= 0: + comment = line[pos + len(startComment):].strip() + if endComment: + comment = comment.replace("endComment", "") + flags = [f.strip() for f in comment.split() + if (f.startswith("__") and f.endswith("__"))] + return flags + + def toNativeSeparators(path): """ Function returning a path, that is using native separator characters. @@ -1173,127 +1294,68 @@ @return An integer representing major and minor version number (integer) """ return sys.hexversion >> 16 - - -def compile(file, codestring="", isPy2=False): - """ - Function to compile one Python source file to Python bytecode. - - @param file source filename (string) - @param codestring string containing the code to compile (string) - @param isPy2 shows which interperter to use (boolean) - @return 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 is True. - """ - from PyQt4.QtCore import QCoreApplication - - interpreter_name = 'Python' if isPy2 else 'Python3' - interpreter = Preferences.getDebugger( - interpreter_name + "Interpreter") - checkFlakes = Preferences.getFlakes("IncludeInSyntaxCheck") - ignoreStarImportWarnings = Preferences.getFlakes( - "IgnoreStarImportWarnings") - if samefilepath(interpreter, sys.executable): - ret = compile_and_check( - file, codestring, checkFlakes, ignoreStarImportWarnings) - else: - #TODO: create temporary file if only a codestring is given - ret = compile_extern( - file, isPy2, checkFlakes, ignoreStarImportWarnings) - - # Translate messages - for warning in ret[6]: - msg_args = warning.pop() - translated = QCoreApplication.translate( - 'py3Flakes', warning[-1]).format(*msg_args) - # Avoid leading "u" at Python2 unicode strings - if translated.startswith("u'"): - translated = translated[1:] - warning[3] = translated.replace(" u'", " '") - - return ret -def compile_extern( - file, isPy2, checkFlakes=True, ignoreStarImportWarnings=False): +def determinePythonVersion(filename, source, editor=None): """ - Function to compile one Python source file to Python bytecode. + Determine the python version of a given file. - @param file source filename (string) - @param isPy2 flag indicating if it's a Python 2 or 3 file (boolean) - @keyparam checkFlakes flag indicating to do a pyflakes check (boolean) - @keyparam ignoreStarImportWarnings flag if star import warnings should be - suppressed (boolean) - @return A tuple indicating status (True = an error was found), the - file name, the line number, the index number, the code string, - the error message and a list of tuples of pyflakes warnings indicating - file name, line number and message (boolean, string, string, string, - string, string, list of (string, string, string)). The syntax error - values are only valid, if the status is True. The pyflakes list will - be empty, if a syntax error was detected by the syntax checker. + @param filename name of the file with extension (str) + @param source of the file (str) + @keyparam editor if the file is opened already (Editor object) + @return Python version if file is Python2 or Python3 (int) """ - interpreter_name = 'Python' if isPy2 else 'Python3' - interpreter = Preferences.getDebugger(interpreter_name + "Interpreter") - if interpreter == "" or not isinpath(interpreter): - return (True, file, 1, 0, "", - QCoreApplication.translate( - "Utilities", - "{0} interpreter not configured.") - .format(interpreter_name), []) - syntaxChecker = os.path.join(getConfig('ericDir'), - "Utilities", "SyntaxCheck.py") - args = [syntaxChecker] - if checkFlakes: - if ignoreStarImportWarnings: - args.append("-fi") - else: - args.append("-fs") - args.append(file) - proc = QProcess() - proc.setProcessChannelMode(QProcess.MergedChannels) - proc.start(interpreter, args) - finished = proc.waitForFinished(30000) - if finished: - output = codecs.decode( - proc.readAllStandardOutput(), - sys.getfilesystemencoding(), 'strict').splitlines() - - if output: - syntaxerror = output[0] == "ERROR" - if syntaxerror: - fn = output[1] - line = int(output[2]) - index = int(output[3]) - code = output[4] - error = output[5] - return (True, fn, line, index, code, error, []) - else: - index = 6 - warnings = [] - while len(output) - index > 3: - if output[index] == "FLAKES_ERROR": - return (True, output[index + 1], - int(output[index + 2]), -1, - '', output[index + 3], []) - else: - msg_args = output[index + 4].split('#') - warnings.append([ - output[index], output[index + 1], - int(output[index + 2]), output[index + 3], - msg_args]) - index += 5 - - return (False, None, None, None, None, None, warnings) - else: - return (False, "", -1, -1, "", "", []) + pyAssignment = {"Python": 2, "Python2": 2, "Python3": 3} + + if not editor: + viewManager = e5App().getObject('ViewManager') + editor = viewManager.getOpenEditor(filename) + + # Maybe the user has changed the language + if editor and editor.getFileType() in pyAssignment: + return pyAssignment[editor.getFileType()] + + pyVer = 0 + flags = extractFlags(source) + ext = os.path.splitext(filename)[1] + py2Ext = Preferences.getPython("PythonExtensions") + py3Ext = Preferences.getPython("Python3Extensions") + project = e5App().getObject('Project') + basename = os.path.basename(filename) - return (True, file, 1, 0, "", - QCoreApplication.translate( - "Utilities", - "{0} interpreter did not finish within 30s.").format( - interpreter_name), []) + if "FileType" in flags: + pyVer = pyAssignment.get(flags["FileType"], 0) + elif project.isOpen() and project.isProjectFile(filename): + language = project.getEditorLexerAssoc(basename) + if not language: + language = Preferences.getEditorLexerAssoc(basename) + if language in ['Python2', 'Python3']: + pyVer = pyAssignment[language] + + if pyVer: + # Skip the next tests + pass + elif (Preferences.getProject("DeterminePyFromProject") and + project.isOpen() and + project.isProjectFile(filename)): + pyVer = pyAssignment.get(project.getProjectLanguage(), 0) + elif ext in py2Ext and ext not in py3Ext: + pyVer = 2 + elif ext in py3Ext and ext not in py2Ext: + pyVer = 3 + elif source.startswith("#!"): + line0 = source.splitlines()[0] + if "python3" in line0: + pyVer = 3 + elif "python" in line0: + pyVer = 2 + + if pyVer == 0 and ext in py2Ext + py3Ext: + pyVer = sys.version_info[0] + + if editor and pyVer: + editor.filetype = "Python{0}".format(pyVer) + return pyVer ###############################################################################
--- a/Utilities/py2flakes/__init__.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Package containg the pyflakes Python2 port adapted for Qt. -""" - -""" License -Copyright 2005-2011 Divmod, Inc. -Copyright 2013 Florent Xicluna - -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. -""" - -""" Changes -0.6.1 (2013-01-29): - - Fix detection of variables in augmented assignments. - -0.6.0 (2013-01-29): - - Support Python 3 up to 3.3, based on the pyflakes3k project. - - Preserve compatibility with Python 2.5 and all recent versions of Python. - - Support custom reporters in addition to the default Reporter. - - Allow function redefinition for modern property construction via - property.setter/deleter. - - Fix spurious redefinition warnings in conditionals. - - Do not report undefined name in __all__ if import * is used. - - Add WindowsError as a known built-in name on all platforms. - - Support specifying additional built-ins in the `Checker` constructor. - - Don't issue Unused Variable warning when using locals() in current scope. - - Handle problems with the encoding of source files. - - Remove dependency on Twisted for the tests. - - Support `python setup.py test` and `python setup.py develop`. - - Create script using setuptools `entry_points` to support all platforms, - including Windows. - -0.5.0 (2011-09-02): - - Convert pyflakes to use newer _ast infrastructure rather than compiler. - - Support for new syntax in 2.7 (including set literals, set comprehensions, - and dictionary comprehensions). - - Make sure class names don't get bound until after class definition. -""" - -__version__ = '0.6.1'
--- a/Utilities/py2flakes/checker.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,711 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# -# Original (c) 2005-2010 Divmod, Inc. -# -# This module is based on pyflakes for Python2 but was modified to -# work with eric5 - -import os.path -try: - import builtins - PY2 = False -except ImportError: - import __builtin__ as builtins #__IGNORE_WARNING__ - PY2 = True - -try: - import ast - iter_child_nodes = ast.iter_child_nodes -except (ImportError, AttributeError): # Python 2.5 - import _ast as ast - - def iter_child_nodes(node, astcls=ast.AST): - """ - Yield all direct child nodes of *node*, that is, all fields that are nodes - and all items of fields that are lists of nodes. - """ - for name in node._fields: - field = getattr(node, name, None) - if isinstance(field, astcls): - yield field - elif isinstance(field, list): - for item in field: - yield item -# Python >= 3.3 uses ast.Try instead of (ast.TryExcept + ast.TryFinally) -if hasattr(ast, 'Try'): - ast_TryExcept = ast.Try - ast_TryFinally = () -else: - ast_TryExcept = ast.TryExcept - ast_TryFinally = ast.TryFinally - -from . import messages - - -class Binding(object): - """ - Represents the binding of a value to a name. - - 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. - """ - - def __init__(self, name, source): - self.name = name - self.source = source - self.used = False - - def __str__(self): - return self.name - - def __repr__(self): - return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__, - self.name, - self.source.lineno, - id(self)) - - -class UnBinding(Binding): - """Created by the 'del' operator.""" - - -class Importation(Binding): - """ - A binding created by an import statement. - """ - def __init__(self, name, source): - self.fullName = name - name = name.split('.')[0] - super(Importation, self).__init__(name, source) - - -class Argument(Binding): - """ - Represents binding a name as an argument. - """ - - -class Definition(Binding): - """ - A binding that defines a function or a class. - """ - - -class Assignment(Binding): - """ - Represents binding a name with an explicit assignment. - - 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. - """ - - -class FunctionDefinition(Definition): - pass - - -class ClassDefinition(Definition): - pass - - -class ExportBinding(Binding): - """ - A binding created by an C{__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. - - The only C{__all__} assignment that can be recognized is one which takes - the value of a literal list containing literal strings. For example:: - - __all__ = ["foo", "bar"] - - Names which are imported and not otherwise used but appear in the value of - C{__all__} will not have an unused import warning reported for them. - """ - def names(self): - """ - Return a list of the names referenced by this binding. - """ - names = [] - if isinstance(self.source, ast.List): - for node in self.source.elts: - if isinstance(node, ast.Str): - names.append(node.s) - return names - - -class Scope(dict): - importStarred = False # set to True when import * is found - usesLocals = False - - def __repr__(self): - return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), dict.__repr__(self)) - - -class ClassScope(Scope): - pass - - -class FunctionScope(Scope): - """ - I represent a name scope for a function. - """ - def __init__(self): - super(FunctionScope, self).__init__() - self.globals = {} - - -class ModuleScope(Scope): - pass - - -# Globally defined names which are not attributes of the builtins module, or -# are only present on some platforms. -_MAGIC_GLOBALS = ['__file__', '__builtins__', 'WindowsError'] - - -def getNodeName(node): - # Returns node.id, or node.name, or None - if hasattr(node, 'id'): # One of the many nodes with an id - return node.id - if hasattr(node, 'name'): # a ExceptHandler node - return node.name - - -class Checker(object): - """ - I check the cleanliness and sanity of Python code. - """ - - nodeDepth = 0 - traceTree = False - builtIns = set(dir(builtins)) | set(_MAGIC_GLOBALS) - - def __init__(self, tree, filename='(none)', builtins=None): - self._deferredFunctions = [] - self._deferredAssignments = [] - self.deadScopes = [] - self.messages = [] - self.filename = filename - if builtins: - self.builtIns = self.builtIns.union(builtins) - self.scopeStack = [ModuleScope()] - self.futuresAllowed = True - self.root = tree - self.handleChildren(tree) - self.runDeferred(self._deferredFunctions) - # Set _deferredFunctions to None so that deferFunction will fail - # noisily if called after we've run through the deferred functions. - self._deferredFunctions = None - self.runDeferred(self._deferredAssignments) - # Set _deferredAssignments to None so that deferAssignment will fail - # noisily if called after we've run through the deferred assignments. - self._deferredAssignments = None - del self.scopeStack[1:] - self.popScope() - self.checkDeadScopes() - - def deferFunction(self, callable): - """ - Schedule a function handler to be called just before completion. - - 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. - """ - self._deferredFunctions.append((callable, self.scopeStack[:])) - - def deferAssignment(self, callable): - """ - Schedule an assignment handler to be called just after deferred - function handlers. - """ - self._deferredAssignments.append((callable, self.scopeStack[:])) - - def runDeferred(self, deferred): - """ - Run the callables in C{deferred} using their associated scope stack. - """ - for handler, scope in deferred: - self.scopeStack = scope - handler() - - @property - def scope(self): - return self.scopeStack[-1] - - def popScope(self): - self.deadScopes.append(self.scopeStack.pop()) - - def checkDeadScopes(self): - """ - Look at scopes which have been fully examined and report names in them - which were imported but unused. - """ - for scope in self.deadScopes: - export = isinstance(scope.get('__all__'), ExportBinding) - if export: - all = scope['__all__'].names() - if not scope.importStarred and os.path.basename(self.filename) != '__init__.py': - # Look for possible mistakes in the export list - undefined = set(all) - set(scope) - for name in undefined: - self.report(messages.UndefinedExport, - scope['__all__'].source.lineno, name) - else: - all = [] - - # Look for imported names that aren't used. - for importation in scope.values(): - if isinstance(importation, Importation): - if not importation.used and importation.name not in all: - self.report(messages.UnusedImport, - importation.source.lineno, importation.name) - - def pushFunctionScope(self): - self.scopeStack.append(FunctionScope()) - - def pushClassScope(self): - self.scopeStack.append(ClassScope()) - - def report(self, messageClass, *args, **kwargs): - self.messages.append(messageClass(self.filename, *args, **kwargs)) - - def hasParent(self, node, kind): - while hasattr(node, 'parent'): - node = node.parent - if isinstance(node, kind): - return True - - def getCommonAncestor(self, lnode, rnode, stop=None): - if not stop: - stop = self.root - if lnode is rnode: - return lnode - if stop in (lnode, rnode): - return stop - - if not hasattr(lnode, 'parent') or not hasattr(rnode, 'parent'): - return - if (lnode.level > rnode.level): - return self.getCommonAncestor(lnode.parent, rnode, stop) - if (rnode.level > lnode.level): - return self.getCommonAncestor(lnode, rnode.parent, stop) - return self.getCommonAncestor(lnode.parent, rnode.parent, stop) - - def descendantOf(self, node, ancestors, stop=None): - for a in ancestors: - if self.getCommonAncestor(node, a, stop) not in (stop, None): - return True - return False - - def onFork(self, parent, lnode, rnode, items): - return (self.descendantOf(lnode, items, parent) ^ - self.descendantOf(rnode, items, parent)) - - def differentForks(self, lnode, rnode): - """True, if lnode and rnode are located on different forks of IF/TRY""" - ancestor = self.getCommonAncestor(lnode, rnode) - if isinstance(ancestor, ast.If): - for fork in (ancestor.body, ancestor.orelse): - if self.onFork(ancestor, lnode, rnode, fork): - return True - elif isinstance(ancestor, ast_TryExcept): - body = ancestor.body + ancestor.orelse - for fork in [body] + [[hdl] for hdl in ancestor.handlers]: - if self.onFork(ancestor, lnode, rnode, fork): - return True - elif isinstance(ancestor, ast_TryFinally): - if self.onFork(ancestor, lnode, rnode, ancestor.body): - return True - return False - - def addBinding(self, node, value, reportRedef=True): - """ - Called when a binding is altered. - - - `node` is the statement responsible for the change - - `value` is the optional new value, a Binding instance, associated - with the binding; if None, the binding is deleted if it exists. - - if `reportRedef` is True (default), rebinding while unused will be - reported. - """ - redefinedWhileUnused = False - if not isinstance(self.scope, ClassScope): - for scope in self.scopeStack[::-1]: - existing = scope.get(value.name) - if (isinstance(existing, Importation) - and not existing.used - and (not isinstance(value, Importation) or value.fullName == existing.fullName) - and reportRedef - and not self.differentForks(node, existing.source)): - redefinedWhileUnused = True - self.report(messages.RedefinedWhileUnused, - node.lineno, value.name, existing.source.lineno) - - existing = self.scope.get(value.name) - if not redefinedWhileUnused and self.hasParent(value.source, ast.ListComp): - if (existing and reportRedef - and not self.hasParent(existing.source, (ast.For, ast.ListComp))): - self.report(messages.RedefinedInListComp, - node.lineno, value.name, existing.source.lineno) - - if isinstance(value, UnBinding): - try: - del self.scope[value.name] - except KeyError: - self.report(messages.UndefinedName, node.lineno, value.name) - elif (isinstance(existing, Definition) - and not existing.used - and not self.differentForks(node, existing.source)): - self.report(messages.RedefinedWhileUnused, - node.lineno, value.name, existing.source.lineno) - else: - self.scope[value.name] = value - - def handleNodeLoad(self, node): - name = getNodeName(node) - if not name: - return - # try local scope - importStarred = self.scope.importStarred - try: - self.scope[name].used = (self.scope, node.lineno) - except KeyError: - pass - else: - return - - # try enclosing function scopes - for scope in self.scopeStack[-2:0:-1]: - importStarred = importStarred or scope.importStarred - if not isinstance(scope, FunctionScope): - continue - try: - scope[name].used = (self.scope, node.lineno) - except KeyError: - pass - else: - return - - # try global scope - importStarred = importStarred or self.scopeStack[0].importStarred - try: - self.scopeStack[0][name].used = (self.scope, node.lineno) - except KeyError: - if not importStarred and name not in self.builtIns: - if (os.path.basename(self.filename) == '__init__.py' and name == '__path__'): - # the special name __path__ is valid only in packages - pass - else: - self.report(messages.UndefinedName, node.lineno, name) - - def handleNodeStore(self, node): - name = getNodeName(node) - if not name: - return - # if the name hasn't already been defined in the current scope - if isinstance(self.scope, FunctionScope) and name not in self.scope: - # for each function or module scope above us - for scope in self.scopeStack[:-1]: - if not isinstance(scope, (FunctionScope, ModuleScope)): - continue - # if the name was defined in that scope, and the name has - # been accessed already in the current scope, and hasn't - # been declared global - if (name in scope and scope[name].used and scope[name].used[0] is self.scope - and name not in self.scope.globals): - # then it's probably a mistake - self.report(messages.UndefinedLocal, - scope[name].used[1], name, scope[name].source.lineno) - break - - parent = getattr(node, 'parent', None) - if isinstance(parent, (ast.For, ast.comprehension, ast.Tuple, ast.List)): - binding = Binding(name, node) - elif parent is not None and name == '__all__' and isinstance(self.scope, ModuleScope): - binding = ExportBinding(name, parent.value) - else: - binding = Assignment(name, node) - if name in self.scope: - binding.used = self.scope[name].used - self.addBinding(node, binding) - - def handleNodeDelete(self, node): - name = getNodeName(node) - if not name: - return - if isinstance(self.scope, FunctionScope) and name in self.scope.globals: - del self.scope.globals[name] - else: - self.addBinding(node, UnBinding(name, node)) - - def handleChildren(self, tree): - for node in iter_child_nodes(tree): - self.handleNode(node, tree) - - def isDocstring(self, node): - """ - Determine if the given node is a docstring, as long as it is at the - correct place in the node tree. - """ - return isinstance(node, ast.Str) or (isinstance(node, ast.Expr) and - isinstance(node.value, ast.Str)) - - def handleNode(self, node, parent): - if node is None: - return - node.parent = parent - if self.traceTree: - print(' ' * self.nodeDepth + node.__class__.__name__) - self.nodeDepth += 1 - if self.futuresAllowed and not (isinstance(node, ast.ImportFrom) or - self.isDocstring(node)): - self.futuresAllowed = False - nodeType = node.__class__.__name__.upper() - node.level = self.nodeDepth - try: - handler = getattr(self, nodeType) - handler(node) - finally: - self.nodeDepth -= 1 - if self.traceTree: - print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__) - - def ignore(self, node): - pass - - # "stmt" type nodes - RETURN = DELETE = PRINT = WHILE = IF = WITH = WITHITEM = RAISE = \ - TRYEXCEPT = TRYFINALLY = TRY = ASSERT = EXEC = EXPR = handleChildren - - CONTINUE = BREAK = PASS = ignore - - # "expr" type nodes - BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = YIELDFROM = \ - COMPARE = CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = \ - STARRED = handleChildren - - NUM = STR = BYTES = ELLIPSIS = ignore - - # "slice" type nodes - SLICE = EXTSLICE = INDEX = handleChildren - - # expression contexts are node instances too, though being constants - LOAD = STORE = DEL = AUGLOAD = AUGSTORE = PARAM = ignore - - # same for operators - AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \ - BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \ - EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore - - # additional node types - COMPREHENSION = KEYWORD = handleChildren - - def GLOBAL(self, node): - """ - Keep track of globals declarations. - """ - if isinstance(self.scope, FunctionScope): - self.scope.globals.update(dict.fromkeys(node.names)) - - NONLOCAL = GLOBAL - - def LISTCOMP(self, node): - # handle generators before element - for gen in node.generators: - self.handleNode(gen, node) - self.handleNode(node.elt, node) - - GENERATOREXP = SETCOMP = LISTCOMP - - def DICTCOMP(self, node): - for gen in node.generators: - self.handleNode(gen, node) - self.handleNode(node.key, node) - self.handleNode(node.value, node) - - def FOR(self, node): - """ - Process bindings for loop variables. - """ - vars = [] - - def collectLoopVars(n): - if isinstance(n, ast.Name): - vars.append(n.id) - elif isinstance(n, ast.expr_context): - return - else: - for c in iter_child_nodes(n): - collectLoopVars(c) - - collectLoopVars(node.target) - for varn in vars: - if (isinstance(self.scope.get(varn), Importation) - # unused ones will get an unused import warning - and self.scope[varn].used): - self.report(messages.ImportShadowedByLoopVar, - node.lineno, varn, self.scope[varn].source.lineno) - - self.handleChildren(node) - - def NAME(self, node): - """ - Handle occurrence of Name (which can be a load/store/delete access.) - """ - if node.id == 'locals' and isinstance(node.parent, ast.Call): - # we are doing locals() call in current scope - self.scope.usesLocals = True - # Locate the name in locals / function / globals scopes. - if isinstance(node.ctx, (ast.Load, ast.AugLoad)): - self.handleNodeLoad(node) - elif isinstance(node.ctx, (ast.Store, ast.AugStore)): - self.handleNodeStore(node) - elif isinstance(node.ctx, ast.Del): - self.handleNodeDelete(node) - else: - # must be a Param context -- this only happens for names in function - # arguments, but these aren't dispatched through here - raise RuntimeError("Got impossible expression context: %r" % (node.ctx,)) - - def FUNCTIONDEF(self, node): - if not hasattr(node, 'decorator_list'): # Python 2.5 - node.decorator_list = node.decorators - for deco in node.decorator_list: - self.handleNode(deco, node) - self.addBinding(node, FunctionDefinition(node.name, node)) - self.LAMBDA(node) - - def LAMBDA(self, node): - args = [] - - if PY2: - def addArgs(arglist): - for arg in arglist: - if isinstance(arg, ast.Tuple): - addArgs(arg.elts) - else: - if arg.id in args: - self.report(messages.DuplicateArgument, - node.lineno, arg.id) - args.append(arg.id) - addArgs(node.args.args) - defaults = node.args.defaults - else: - for arg in node.args.args + node.args.kwonlyargs: - if arg.arg in args: - self.report(messages.DuplicateArgument, - node.lineno, arg.arg) - args.append(arg.arg) - self.handleNode(arg.annotation, node) - if hasattr(node, 'returns'): # Only for FunctionDefs - for annotation in (node.args.varargannotation, - node.args.kwargannotation, node.returns): - self.handleNode(annotation, node) - defaults = node.args.defaults + node.args.kw_defaults - - # vararg/kwarg identifiers are not Name nodes - for wildcard in (node.args.vararg, node.args.kwarg): - if not wildcard: - continue - if wildcard in args: - self.report(messages.DuplicateArgument, node.lineno, wildcard) - args.append(wildcard) - for default in defaults: - self.handleNode(default, node) - - def runFunction(): - - self.pushFunctionScope() - for name in args: - self.addBinding(node, Argument(name, node), reportRedef=False) - if isinstance(node.body, list): - # case for FunctionDefs - for stmt in node.body: - self.handleNode(stmt, node) - else: - # case for Lambdas - self.handleNode(node.body, node) - - def checkUnusedAssignments(): - """ - Check to see if any assignments have not been used. - """ - for name, binding in self.scope.items(): - if (not binding.used and name not in self.scope.globals - and not self.scope.usesLocals - and isinstance(binding, Assignment)): - self.report(messages.UnusedVariable, - binding.source.lineno, name) - self.deferAssignment(checkUnusedAssignments) - self.popScope() - - self.deferFunction(runFunction) - - def CLASSDEF(self, node): - """ - 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. - """ - # no class decorator in Python 2.5 - for deco in getattr(node, 'decorator_list', ''): - self.handleNode(deco, node) - for baseNode in node.bases: - self.handleNode(baseNode, node) - if not PY2: - for keywordNode in node.keywords: - self.handleNode(keywordNode, node) - self.pushClassScope() - for stmt in node.body: - self.handleNode(stmt, node) - self.popScope() - self.addBinding(node, ClassDefinition(node.name, node)) - - def ASSIGN(self, node): - self.handleNode(node.value, node) - for target in node.targets: - self.handleNode(target, node) - - def AUGASSIGN(self, node): - self.handleNodeLoad(node.target) - self.handleNode(node.value, node) - self.handleNode(node.target, node) - - def IMPORT(self, node): - for alias in node.names: - name = alias.asname or alias.name - importation = Importation(name, node) - self.addBinding(node, importation) - - def IMPORTFROM(self, node): - if node.module == '__future__': - if not self.futuresAllowed: - self.report(messages.LateFutureImport, - node.lineno, [n.name for n in node.names]) - else: - self.futuresAllowed = False - - for alias in node.names: - if alias.name == '*': - self.scope.importStarred = True - self.report(messages.ImportStarUsed, node.lineno, node.module) - continue - name = alias.asname or alias.name - importation = Importation(name, node) - if node.module == '__future__': - importation.used = (self.scope, node.lineno) - self.addBinding(node, importation) - - def EXCEPTHANDLER(self, node): - # 3.x: in addition to handling children, we must handle the name of - # the exception, which is not a Name node, but a simple string. - if isinstance(node.name, str): - self.handleNodeStore(node) - self.handleChildren(node)
--- a/Utilities/py2flakes/messages.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# -# Original (c) 2005 Divmod, Inc. See LICENSE file for details -# -# This module is based on pyflakes for Python2 but was heavily hacked to -# work within Eric5 and Qt (translatable messages) - -""" -Module implementing the messages for py2flakes. -""" - - -def QT_TRANSLATE_NOOP(mod, txt): - """ - Function to tell 'lupdate' which strings to keep for translation. - - @param mod module name - @param txt translatable string - @return the untranslated! string - """ - return txt - - -class Message(object): - """ - Class defining the base for all specific message classes. - """ - message = '' - message_args = () - - def __init__(self, filename, lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - """ - self.filename = filename - self.lineno = lineno - - def __str__(self): - """ - Special method return a string representation of the instance object. - - @return string representation of the object (string) - """ - return '%s:%s: %s' % ( - self.filename, self.lineno, self.message % self.message_args) - - def getMessageData(self): - """ - Public method to get the individual message data elements. - - @return tuple containing file name, line number and message - (string, integer, string) - """ - return (self.filename, self.lineno, self.message, self.message_args) - - -class UnusedImport(Message): - """ - Class defining the "Unused Import" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - '{0!r} imported but unused.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the unused import (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class RedefinedWhileUnused(Message): - """ - Class defining the "Redefined While Unused" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Redefinition of unused {0!r} from line {1!r}.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the redefined object (string) - @param orig_lineno line number of the original definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class RedefinedInListComp(Message): - """ - Class defining the list comprehension redefinition. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'List comprehension redefines {0!r} from line {1!r}.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the redefined object (string) - @param orig_lineno line number of the original definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class ImportShadowedByLoopVar(Message): - """ - Class defining the "Import Shadowed By Loop Var" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Import {0!r} from line {1!r} shadowed by loop variable.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the shadowed import (string) - @param orig_lineno line number of the import (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class ImportStarUsed(Message): - """ - Class defining the "Import Star Used" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - "'from {0} import *' used; unable to detect undefined names.") - - def __init__(self, filename, lineno, modname): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param modname name of the module imported using star import (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (modname,) - - -class UndefinedName(Message): - """ - Class defining the "Undefined Name" message. - """ - message = QT_TRANSLATE_NOOP('py3Flakes', 'Undefined name {0!r}.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name undefined name (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class UndefinedExport(Message): - """ - Class defining the "Undefined Export" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Undefined name {0!r} in __all__.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name undefined exported name (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class UndefinedLocal(Message): - """ - Class defining the "Undefined Local Variable" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - "Local variable {0!r} (defined in enclosing scope on line {1!r})" - " referenced before assignment.") - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the prematurely referenced variable (string) - @param orig_lineno line number of the variable definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class DuplicateArgument(Message): - """ - Class defining the "Duplicate Argument" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Duplicate argument {0!r} in function definition.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the duplicate argument (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class Redefined(Message): - """ - Class defining the "Redefined" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Redefinition of {0!r} from line {1!r}.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the redefined function (string) - @param orig_lineno line number of the original definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class LateFutureImport(Message): - """ - Class defining the "Late Future Import" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Future import(s) {0!r} after other statements.') - - def __init__(self, filename, lineno, names): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param names names of the imported futures (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (names,) - - -class UnusedVariable(Message): - """ - Class defining the "Unused Variable" message. - - Indicates that a variable has been explicitly assigned to but not actually - used. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Local variable {0!r} is assigned to but never used.') - - def __init__(self, filename, lineno, names): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param names names of the unused variable (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (names,) - -# -# eflag: FileType = Python2
--- a/Utilities/py3flakes/__init__.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Package containg the pyflakes Python3 port adapted for Qt. -""" - -__version__ = '0.5.0'
--- a/Utilities/py3flakes/checker.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,680 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# -# Original (c) 2005-2010 Divmod, Inc. -# -# This module is based on pyflakes for Python2 but was heavily hacked to -# work with Python3 and eric5 - -import builtins -import os.path -import ast - -from . import messages - - -class Binding(object): - """ - Represents the binding of a value to a name. - - The checker uses this to keep track of which names have been bound and - which names have not. See Assignment for a special type of binding that - is checked with stricter rules. - """ - def __init__(self, name, source): - self.name = name - self.source = source - self.used = False - - def __str__(self): - return self.name - - def __repr__(self): - return '<{0} object {1!r} from line {2!r} at 0x{3:x}>'.format( - self.__class__.__name__, - self.name, - self.source.lineno, - id(self)) - - -class UnBinding(Binding): - ''' - Created by the 'del' operator. - ''' - pass - - -class Importation(Binding): - """ - A binding created by an import statement. - """ - def __init__(self, name, source): - self.fullName = name - name = name.split('.')[0] - super(Importation, self).__init__(name, source) - - -class Argument(Binding): - """ - Represents binding a name as an argument. - """ - pass - - -class Assignment(Binding): - """ - Represents binding a name with an explicit assignment. - - 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. - """ - pass - - -class FunctionDefinition(Binding): - """ - Represents a function definition. - """ - is_property = False - - -class ExportBinding(Binding): - """ - 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. - - The only __all__ assignment that can be recognized is one which takes - the value of a literal list containing literal strings. For example:: - - __all__ = ["foo", "bar"] - - 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. - """ - def names(self): - """ - Return a list of the names referenced by this binding. - """ - names = [] - if isinstance(self.source, ast.List): - for node in self.source.elts: - if isinstance(node, (ast.Str, ast.Bytes)): - names.append(node.s) - elif isinstance(node, ast.Num): - names.append(node.n) - return names - - -class Scope(dict): - """ - Class defining the scope base class. - """ - importStarred = False # set to True when import * is found - - def __repr__(self): - return '<{0} at 0x{1:x} {2}>'.format( - self.__class__.__name__, id(self), dict.__repr__(self)) - - def __init__(self): - super(Scope, self).__init__() - - -class ClassScope(Scope): - """ - Class representing a name scope for a class. - """ - pass - - -class FunctionScope(Scope): - """ - Class representing a name scope for a function. - """ - def __init__(self): - super(FunctionScope, self).__init__() - self.globals = {} - - -class ModuleScope(Scope): - """ - Class representing a name scope for a module. - """ - pass - -# Globally defined names which are not attributes of the builtins module. -_MAGIC_GLOBALS = ['__file__', '__builtins__'] - - -class Checker(object): - """ - Class to check the cleanliness and sanity of Python code. - """ - nodeDepth = 0 - traceTree = False - - def __init__(self, module, filename='(none)'): - """ - Constructor - - @param module parsed module tree or module source code - @param filename name of the module file (string) - """ - self._deferredFunctions = [] - self._deferredAssignments = [] - self.dead_scopes = [] - self.messages = [] - self.filename = filename - self.scopeStack = [ModuleScope()] - self.futuresAllowed = True - - if isinstance(module, str): - module = ast.parse(module, filename, "exec") - self.handleBody(module) - self._runDeferred(self._deferredFunctions) - # Set _deferredFunctions to None so that deferFunction will fail - # noisily if called after we've run through the deferred functions. - self._deferredFunctions = None - self._runDeferred(self._deferredAssignments) - # Set _deferredAssignments to None so that deferAssignment will fail - # noisly if called after we've run through the deferred assignments. - self._deferredAssignments = None - del self.scopeStack[1:] - self.popScope() - self.check_dead_scopes() - - def deferFunction(self, callable): - ''' - Schedule a function handler to be called just before completion. - - 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. - ''' - self._deferredFunctions.append((callable, self.scopeStack[:])) - - def deferAssignment(self, callable): - """ - Schedule an assignment handler to be called just after deferred - function handlers. - """ - self._deferredAssignments.append((callable, self.scopeStack[:])) - - def _runDeferred(self, deferred): - """ - Run the callables in deferred using their associated scope stack. - """ - for handler, scope in deferred: - self.scopeStack = scope - handler() - - def scope(self): - return self.scopeStack[-1] - scope = property(scope) - - def popScope(self): - self.dead_scopes.append(self.scopeStack.pop()) - - def check_dead_scopes(self): - """ - Look at scopes which have been fully examined and report names in them - which were imported but unused. - """ - for scope in self.dead_scopes: - export = isinstance(scope.get('__all__'), ExportBinding) - if export: - all = scope['__all__'].names() - if os.path.split(self.filename)[1] != '__init__.py': - # Look for possible mistakes in the export list - undefined = set(all) - set(scope) - for name in undefined: - self.report( - messages.UndefinedExport, - scope['__all__'].source.lineno, - name) - else: - all = [] - - # Look for imported names that aren't used. - for importation in scope.values(): - if isinstance(importation, Importation): - if not importation.used and importation.name not in all: - self.report( - messages.UnusedImport, - importation.source.lineno, - importation.name) - - def pushFunctionScope(self): - self.scopeStack.append(FunctionScope()) - - def pushClassScope(self): - self.scopeStack.append(ClassScope()) - - def report(self, messageClass, *args, **kwargs): - self.messages.append(messageClass(self.filename, *args, **kwargs)) - - def handleBody(self, tree): - for node in tree.body: - self.handleNode(node, tree) - - def handleChildren(self, tree): - for node in ast.iter_child_nodes(tree): - self.handleNode(node, tree) - - def isDocstring(self, node): - """ - Determine if the given node is a docstring, as long as it is at the - correct place in the node tree. - """ - return isinstance(node, ast.Str) or \ - (isinstance(node, ast.Expr) and - isinstance(node.value, ast.Str)) - - def handleNode(self, node, parent): - if node: - node.parent = parent - if self.traceTree: - print(' ' * self.nodeDepth + node.__class__.__name__) - self.nodeDepth += 1 - if self.futuresAllowed and \ - not (isinstance(node, ast.ImportFrom) or - self.isDocstring(node)): - self.futuresAllowed = False - nodeType = node.__class__.__name__.upper() - try: - handler = getattr(self, nodeType) - handler(node) - except AttributeError: - print(nodeType, "not supported yet. Please report this.") - finally: - self.nodeDepth -= 1 - if self.traceTree: - print(' ' * self.nodeDepth + 'end ' + node.__class__.__name__) - - def ignore(self, node): - pass - - # ast nodes to be ignored - PASS = CONTINUE = BREAK = ELLIPSIS = NUM = STR = BYTES = \ - LOAD = STORE = DEL = AUGLOAD = AUGSTORE = PARAM = \ - ATTRIBUTES = AND = OR = ADD = SUB = MULT = DIV = \ - MOD = POW = LSHIFT = RSHIFT = BITOR = BITXOR = BITAND = FLOORDIV = \ - INVERT = NOT = UADD = USUB = EQ = NOTEQ = LT = LTE = GT = GTE = IS = \ - ISNOT = IN = NOTIN = ignore - - # "stmt" type nodes - RETURN = DELETE = PRINT = WHILE = IF = WITH = WITHITEM = RAISE = \ - TRY = TRYEXCEPT = TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren - - # "expr" type nodes - BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = COMPARE = \ - CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = handleChildren - - # "slice" type nodes - SLICE = EXTSLICE = INDEX = handleChildren - - # additional node types - COMPREHENSION = KEYWORD = handleChildren - - def addBinding(self, lineno, value, reportRedef=True): - ''' - Called when a binding is altered. - - @param lineno line of the statement responsible for the change - (integer) - @param value the optional new value, a Binding instance, associated - with the binding; if None, the binding is deleted if it exists - @param reportRedef flag indicating if rebinding while unused will be - reported (boolean) - ''' - if (isinstance(self.scope.get(value.name), FunctionDefinition) - and isinstance(value, FunctionDefinition) - and not self.scope.get(value.name).is_property - and not value.is_property): - self.report(messages.RedefinedFunction, - lineno, value.name, - self.scope[value.name].source.lineno) - - if not isinstance(self.scope, ClassScope): - for scope in self.scopeStack[::-1]: - existing = scope.get(value.name) - if isinstance(existing, Importation) and \ - not existing.used and \ - not isinstance(value, UnBinding) and \ - (not isinstance(value, Importation) or \ - value.fullName == existing.fullName) and \ - reportRedef: - self.report(messages.RedefinedWhileUnused, - lineno, value.name, - scope[value.name].source.lineno) - - if isinstance(value, UnBinding): - try: - del self.scope[value.name] - except KeyError: - self.report(messages.UndefinedName, lineno, value.name) - else: - self.scope[value.name] = value - - ############################################################ - ## individual handler methods below - ############################################################ - - def GLOBAL(self, node): - """ - Keep track of globals declarations. - """ - if isinstance(self.scope, FunctionScope): - self.scope.globals.update(dict.fromkeys(node.names)) - - NONLOCAL = GLOBAL - - def LISTCOMP(self, node): - for generator in node.generators: - self.handleNode(generator, node) - self.handleNode(node.elt, node) - - SETCOMP = GENERATOREXP = LISTCOMP - - def DICTCOMP(self, node): - for generator in node.generators: - self.handleNode(generator, node) - self.handleNode(node.key, node) - self.handleNode(node.value, node) - - def FOR(self, node): - """ - Process bindings for loop variables. - """ - vars = [] - - def collectLoopVars(n): - if isinstance(n, ast.Name): - vars.append(n.id) - elif isinstance(n, ast.expr_context): - return - else: - for c in ast.iter_child_nodes(n): - collectLoopVars(c) - - collectLoopVars(node.target) - for varn in vars: - if (isinstance(self.scope.get(varn), Importation) - # unused ones will get an unused import warning - and self.scope[varn].used): - self.report(messages.ImportShadowedByLoopVar, - node.lineno, varn, self.scope[varn].source.lineno) - - self.handleChildren(node) - - def NAME(self, node): - """ - Handle occurrence of Name (which can be a load/store/delete access.) - """ - # Locate the name in locals / function / globals scopes. - if isinstance(node.ctx, (ast.Load, ast.AugLoad)): - # try local scope - importStarred = self.scope.importStarred - try: - self.scope[node.id].used = (self.scope, node.lineno) - except KeyError: - pass - else: - return - - # try enclosing function scopes - for scope in self.scopeStack[-2:0:-1]: - importStarred = importStarred or scope.importStarred - if not isinstance(scope, FunctionScope): - continue - try: - scope[node.id].used = (self.scope, node.lineno) - except KeyError: - pass - else: - return - - # try global scope - importStarred = importStarred or self.scopeStack[0].importStarred - try: - self.scopeStack[0][node.id].used = (self.scope, node.lineno) - except KeyError: - if ((not hasattr(builtins, node.id)) - and node.id not in _MAGIC_GLOBALS - and not importStarred): - if (os.path.basename(self.filename) == '__init__.py' and - node.id == '__path__'): - # the special name __path__ is valid only in packages - pass - else: - self.report(messages.UndefinedName, - node.lineno, node.id) - elif isinstance(node.ctx, (ast.Store, ast.AugStore)): - # if the name hasn't already been defined in the current scope - if isinstance(self.scope, FunctionScope) and \ - node.id not in self.scope: - # for each function or module scope above us - for scope in self.scopeStack[:-1]: - if not isinstance(scope, (FunctionScope, ModuleScope)): - continue - # if the name was defined in that scope, and the name has - # been accessed already in the current scope, and hasn't - # been declared global - if (node.id in scope - and scope[node.id].used - and scope[node.id].used[0] is self.scope - and node.id not in self.scope.globals): - # then it's probably a mistake - self.report(messages.UndefinedLocal, - scope[node.id].used[1], - node.id, - scope[node.id].source.lineno) - break - - if isinstance(node.parent, - (ast.For, ast.comprehension, ast.Tuple, ast.List)): - binding = Binding(node.id, node) - elif (node.id == '__all__' and - isinstance(self.scope, ModuleScope)): - binding = ExportBinding(node.id, node.parent.value) - else: - binding = Assignment(node.id, node) - if node.id in self.scope: - binding.used = self.scope[node.id].used - self.addBinding(node.lineno, binding) - elif isinstance(node.ctx, ast.Del): - if isinstance(self.scope, FunctionScope) and \ - node.id in self.scope.globals: - del self.scope.globals[node.id] - else: - self.addBinding(node.lineno, UnBinding(node.id, node)) - else: - # must be a Param context -- this only happens for names in - # function arguments, but these aren't dispatched through here - raise RuntimeError( - "Got impossible expression context: {0:r}".format(node.ctx,)) - - def FUNCTIONDEF(self, node): - is_property = False - if hasattr(node, "decorator_list"): - for decorator in node.decorator_list: - self.handleNode(decorator, node) - if getattr(decorator, 'id', None) == 'property': - is_property = True - if getattr(decorator, 'attr', None) in ('setter', 'deleter'): - is_property = True - funcdef = FunctionDefinition(node.name, node) - funcdef.is_property = is_property - self.addBinding(node.lineno, funcdef) - self.LAMBDA(node) - - def LAMBDA(self, node): - for default in node.args.defaults + node.args.kw_defaults: - self.handleNode(default, node) - - def runFunction(): - args = [] - - def addArgs(arglist): - for arg in arglist: - if isinstance(arg.arg, tuple): - addArgs(arg.arg) - else: - if arg.arg in args: - self.report(messages.DuplicateArgument, - node.lineno, arg.arg) - args.append(arg.arg) - - def checkUnusedAssignments(): - """ - Check to see if any assignments have not been used. - """ - for name, binding in self.scope.items(): - if (not binding.used and not name in self.scope.globals - and isinstance(binding, Assignment)): - self.report(messages.UnusedVariable, - binding.source.lineno, name) - - self.pushFunctionScope() - addArgs(node.args.args) - addArgs(node.args.kwonlyargs) - # vararg/kwarg identifiers are not Name nodes - if node.args.vararg: - args.append(node.args.vararg) - if node.args.kwarg: - args.append(node.args.kwarg) - for name in args: - self.addBinding(node.lineno, Argument(name, node), - reportRedef=False) - if isinstance(node.body, list): - self.handleBody(node) - else: - self.handleNode(node.body, node) - self.deferAssignment(checkUnusedAssignments) - self.popScope() - - self.deferFunction(runFunction) - - def CLASSDEF(self, node): - """ - 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. - """ - for decorator in getattr(node, "decorator_list", []): - self.handleNode(decorator, node) - for baseNode in node.bases: - self.handleNode(baseNode, node) - self.addBinding(node.lineno, Binding(node.name, node)) - self.pushClassScope() - self.handleBody(node) - self.popScope() - - def handleAssignName(self, node): - # special handling for ast.Subscript and ast.Starred - if isinstance(node, (ast.Subscript, ast.Starred)): - node.value.parent = node - self.handleAssignName(node.value) - if isinstance(node, ast.Subscript): - if isinstance(node.slice, ast.Slice): - self.handleNode(node.slice.lower, node) - self.handleNode(node.slice.upper, node) - else: - self.handleNode(node.slice.value, node) - return - - # if the name hasn't already been defined in the current scope - if isinstance(node, (ast.Tuple, ast.List)): - for elt in node.elts: - elt.parent = node - self.handleAssignName(elt) - return - - if isinstance(node, ast.Attribute): - self.handleNode(node.value, node) - return - - if isinstance(self.scope, FunctionScope) and node.id not in self.scope: - # for each function or module scope above us - for scope in self.scopeStack[:-1]: - if not isinstance(scope, (FunctionScope, ModuleScope)): - continue - # if the name was defined in that scope, and the name has - # been accessed already in the current scope, and hasn't - # been declared global - if (node.id in scope - and scope[node.id].used - and scope[node.id].used[0] is self.scope - and node.id not in self.scope.globals): - # then it's probably a mistake - self.report(messages.UndefinedLocal, - scope[node.id].used[1], - node.id, - scope[node.id].source.lineno) - break - - if isinstance(node.parent, - (ast.For, ast.ListComp, ast.GeneratorExp, - ast.Tuple, ast.List)): - binding = Binding(node.id, node) - elif (node.id == '__all__' and - isinstance(self.scope, ModuleScope) and - isinstance(node.parent, ast.Assign)): - binding = ExportBinding(node.id, node.parent.value) - else: - binding = Assignment(node.id, node) - if node.id in self.scope: - binding.used = self.scope[node.id].used - self.addBinding(node.lineno, binding) - - def ASSIGN(self, node): - self.handleNode(node.value, node) - for target in node.targets: - self.handleNode(target, node) - - def AUGASSIGN(self, node): - # AugAssign is awkward: must set the context explicitly and - # visit twice, once with AugLoad context, once with AugStore context - node.target.ctx = ast.AugLoad() - self.handleNode(node.target, node) - self.handleNode(node.value, node) - node.target.ctx = ast.AugStore() - self.handleNode(node.target, node) - - def IMPORT(self, node): - for alias in node.names: - name = alias.asname or alias.name - importation = Importation(name, node) - self.addBinding(node.lineno, importation) - - def IMPORTFROM(self, node): - if node.module == '__future__': - if not self.futuresAllowed: - self.report(messages.LateFutureImport, node.lineno, - [n.name for n in node.names]) - else: - self.futuresAllowed = False - - for alias in node.names: - if alias.name == '*': - self.scope.importStarred = True - self.report(messages.ImportStarUsed, node.lineno, node.module) - continue - name = alias.asname or alias.name - importation = Importation(name, node) - if node.module == '__future__': - importation.used = (self.scope, node.lineno) - self.addBinding(node.lineno, importation) - - def EXCEPTHANDLER(self, node): - node.type and self.handleNode(node.type, node) - if node.name: - node.id = node.name - self.handleAssignName(node) - self.handleBody(node) - - def STARRED(self, node): - self.handleNode(node.value, node)
--- a/Utilities/py3flakes/messages.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,287 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2010 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# -# Original (c) 2005 Divmod, Inc. See LICENSE file for details -# -# This module is based on pyflakes for Python2 but was heavily hacked to -# work with Python3 and Qt (translatable messages) - -""" -Module implementing the messages for py3flakes. -""" - - -def QT_TRANSLATE_NOOP(mod, txt): - """ - Function to tell 'lupdate' which strings to keep for translation. - - @param mod module name - @param txt translatable string - @return the untranslated! string - """ - return txt - - -class Message(object): - """ - Class defining the base for all specific message classes. - """ - message = '' - message_args = () - - def __init__(self, filename, lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - """ - self.filename = filename - self.lineno = lineno - - def __str__(self): - """ - Special method return a string representation of the instance object. - - @return string representation of the object (string) - """ - return '{0}:{1} {2}'.format( - self.filename, self.lineno, - self.message.format(*self.message_args)) - - def getMessageData(self): - """ - Public method to get the individual message data elements. - - @return tuple containing file name, line number and message - (string, integer, string) - """ - return (self.filename, self.lineno, - self.message, self.message_args) - - -class UnusedImport(Message): - """ - Class defining the "Unused Import" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - '{0!r} imported but unused.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the unused import (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class RedefinedWhileUnused(Message): - """ - Class defining the "Redefined While Unused" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Redefinition of unused {0!r} from line {1!r}.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the redefined object (string) - @param orig_lineno line number of the original definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class ImportShadowedByLoopVar(Message): - """ - Class defining the "Import Shadowed By Loop Var" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Import {0!r} from line {1!r} shadowed by loop variable.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the shadowed import (string) - @param orig_lineno line number of the import (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class ImportStarUsed(Message): - """ - Class defining the "Import Star Used" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - "'from {0} import *' used; unable to detect undefined names.") - - def __init__(self, filename, lineno, modname): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param modname name of the module imported using star import (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (modname,) - - -class UndefinedName(Message): - """ - Class defining the "Undefined Name" message. - """ - message = QT_TRANSLATE_NOOP('py3Flakes', 'Undefined name {0!r}.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name undefined name (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class UndefinedExport(Message): - """ - Class defining the "Undefined Export" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Undefined name {0!r} in __all__.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name undefined exported name (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class UndefinedLocal(Message): - """ - Class defining the "Undefined Local Variable" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - "Local variable {0!r} (defined in enclosing scope on line {1!r})" - " referenced before assignment.") - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the prematurely referenced variable (string) - @param orig_lineno line number of the variable definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class DuplicateArgument(Message): - """ - Class defining the "Duplicate Argument" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Duplicate argument {0!r} in function definition.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the duplicate argument (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,) - - -class RedefinedFunction(Message): - """ - Class defining the "Redefined Function" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Redefinition of function {0!r} from line {1!r}.') - - def __init__(self, filename, lineno, name, orig_lineno): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the redefined function (string) - @param orig_lineno line number of the original definition (integer) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name, orig_lineno) - - -class LateFutureImport(Message): - """ - Class defining the "Late Future Import" message. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Future import(s) {0!r} after other statements.') - - def __init__(self, filename, lineno, names): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param names names of the imported futures (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (names,) - - -class UnusedVariable(Message): - """ - Class defining the "Unused Variable" message. - - Indicates that a variable has been explicitly assigned to but not actually - used. - """ - message = QT_TRANSLATE_NOOP( - 'py3Flakes', - 'Local variable {0!r} is assigned to but never used.') - - def __init__(self, filename, lineno, name): - """ - Constructor - - @param filename name of the file (string) - @param lineno line number (integer) - @param name name of the unused variable (string) - """ - Message.__init__(self, filename, lineno) - self.message_args = (name,)
--- a/UtilitiesPython2/CodeStyleChecker.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Class implementing the PEP 8 checker for Python2. -""" - -import sys -import getopt - -from Tools import readEncodedFile, normalizeCode - -import pep8 -from NamingStyleCheckerPy2 import NamingStyleChecker - -# register the name checker -pep8.register_check(NamingStyleChecker, NamingStyleChecker.Codes) - -from DocStyleCheckerPy2 import DocStyleChecker - - -class CodeStyleReport(pep8.BaseReport): - """ - Class implementing a special report to be used with our dialog. - """ - def __init__(self, options): - """ - Constructor - - @param options options for the report (optparse.Values) - """ - super(CodeStyleReport, self).__init__(options) - - self.__repeat = options.repeat - self.errors = [] - - def 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) - @return error code (string) - """ - code = super(CodeStyleReport, self).error_args( - line_number, offset, code, check, *args) - if code and (self.counters[code] == 1 or self.__repeat): - self.errors.append( - (self.filename, line_number, offset, code, args) - ) - return code - - -if __name__ == "__main__": - repeat = False - select = "" - ignore = "" - filename = "" - max_line_length = 79 - hang_closing = False - docType = "pep257" - - if "-f" not in sys.argv: - print "ERROR" - print "" - print "No file name given." - else: - try: - optlist, args = getopt.getopt(sys.argv[1:], "d:f:hi:m:rs:") - 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 - elif opt == "-m": - try: - max_line_length = int(arg) - except ValueError: - # ignore silently - pass - elif opt == "-h": - hang_closing = True - elif opt == "-d": - if arg in ("pep257", "eric"): - docType = arg - - try: - source = readEncodedFile(filename)[0] - source = normalizeCode(source) - source = source.splitlines(True) - except IOError, msg: - print "ERROR" - print filename - print "I/O Error: %s" % unicode(msg) - sys.exit(1) - - if select: - select = [s.strip() for s in select.split(',') - if s.strip()] - else: - select = [] - if ignore: - ignore = [i.strip() for i in ignore.split(',') - if i.strip()] - else: - ignore = [] - - try: - # check coding style - styleGuide = pep8.StyleGuide( - reporter=CodeStyleReport, - repeat=repeat, - select=select, - ignore=ignore, - max_line_length=max_line_length, - hang_closing=hang_closing, - ) - report = styleGuide.check_files([filename]) - - # check documentation style - docStyleChecker = DocStyleChecker( - source, filename, select, ignore, [], repeat, - maxLineLength=max_line_length, docType=docType) - docStyleChecker.run() - - errors = report.errors + docStyleChecker.errors - - if len(errors) > 0: - errors.sort(key=lambda a: a[1]) - for error in errors: - fname, lineno, position, code, args = error - 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 report.counters: - if key.startswith(("E", "N", "W")): - print key, report.counters[key] - for key in docStyleChecker.counters: - if key.startswith("D"): - print key, docStyleChecker.counters[key] - else: - print "NO_PEP8" - print filename - except StandardError, msg: - import traceback - print "EXCEPTION" - print "" - print "Error in eric5 code:" - print traceback.format_exc() - sys.exit(1) - -# -# eflag: FileType = Python2
--- a/UtilitiesPython2/DocStyleCheckerPy2.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1194 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a checker for documentation string conventions. -""" - -# -# The routines of the checker class are modeled after the ones found in -# pep257.py (version 0.2.4). -# - -try: - # Python 2 - from StringIO import StringIO # __IGNORE_EXCEPTION__ -except ImportError: - # Python 3 - from io import StringIO # __IGNORE_WARNING__ -import tokenize -import ast -import sys - - -class DocStyleContext(object): - """ - Class implementing the source context. - """ - def __init__(self, source, startLine, contextType): - """ - Constructor - - @param source source code of the context (list of string or string) - @param startLine line number the context starts in the source (integer) - @param contextType type of the context object (string) - """ - if isinstance(source, str): - self.__source = source.splitlines(True) - else: - self.__source = source[:] - self.__start = startLine - self.__indent = "" - self.__type = contextType - - # ensure first line is left justified - if self.__source: - self.__indent = self.__source[0].replace( - self.__source[0].lstrip(), "") - self.__source[0] = self.__source[0].lstrip() - - def source(self): - """ - Public method to get the source. - - @return source (list of string) - """ - return self.__source - - def ssource(self): - """ - Public method to get the joined source lines. - - @return source (string) - """ - return "".join(self.__source) - - def start(self): - """ - Public method to get the start line number. - - @return start line number (integer) - """ - return self.__start - - def end(self): - """ - Public method to get the end line number. - - @return end line number (integer) - """ - return self.__start + len(self.__source) - 1 - - def indent(self): - """ - Public method to get the indentation of the first line. - - @return indentation string (string) - """ - return self.__indent - - def contextType(self): - """ - Public method to get the context type. - - @return context type (string) - """ - return self.__type - - -class DocStyleChecker(object): - """ - Class implementing a checker for documentation string conventions. - """ - Codes = [ - "D101", "D102", "D103", "D104", "D105", - "D111", "D112", "D113", - "D121", "D122", - "D130", "D131", "D132", "D133", "D134", - "D141", "D142", "D143", "D144", "D145", - - "D203", "D205", - "D221", - "D231", "D234", "D235", "D236", "D237", "D238", "D239", - "D242", "D243", "D244", "D245", "D246", "D247", - "D250", "D251", - ] - - def __init__(self, source, filename, select, ignore, expected, repeat, - maxLineLength=79, docType="pep257"): - """ - Constructor - - @param source source code to be checked (list of string) - @param filename name of the source file (string) - @param select list of selected codes (list of string) - @param ignore list of codes to be ignored (list of string) - @param expected list of expected codes (list of string) - @param repeat flag indicating to report each occurrence of a code - (boolean) - @keyparam maxLineLength allowed line length (integer) - @keyparam docType type of the documentation strings - (string, one of 'eric' or 'pep257') - """ - assert docType in ("eric", "pep257") - - self.__select = tuple(select) - self.__ignore = tuple(ignore) - self.__expected = expected[:] - self.__repeat = repeat - self.__maxLineLength = maxLineLength - self.__docType = docType - self.__filename = filename - self.__source = source[:] - - # statistics counters - self.counters = {} - - # collection of detected errors - self.errors = [] - - self.__lineNumber = 0 - - # caches - self.__functionsCache = None - self.__classesCache = None - self.__methodsCache = None - - self.__keywords = [ - 'moduleDocstring', 'functionDocstring', - 'classDocstring', 'methodDocstring', - 'defDocstring', 'docstring' - ] - if self.__docType == "pep257": - checkersWithCodes = { - "moduleDocstring": [ - (self.__checkModulesDocstrings, ("D101",)), - ], - "functionDocstring": [ - ], - "classDocstring": [ - (self.__checkClassDocstring, ("D104", "D105")), - (self.__checkBlankBeforeAndAfterClass, ("D142", "D143")), - ], - "methodDocstring": [ - ], - "defDocstring": [ - (self.__checkFunctionDocstring, ("D102", "D103")), - (self.__checkImperativeMood, ("D132",)), - (self.__checkNoSignature, ("D133",)), - (self.__checkReturnType, ("D134",)), - (self.__checkNoBlankLineBefore, ("D141",)), - ], - "docstring": [ - (self.__checkTripleDoubleQuotes, ("D111",)), - (self.__checkBackslashes, ("D112",)), - (self.__checkUnicode, ("D113",)), - (self.__checkOneLiner, ("D121",)), - (self.__checkIndent, ("D122",)), - (self.__checkSummary, ("D130")), - (self.__checkEndsWithPeriod, ("D131",)), - (self.__checkBlankAfterSummary, ("D144",)), - (self.__checkBlankAfterLastParagraph, ("D145",)), - ], - } - elif self.__docType == "eric": - checkersWithCodes = { - "moduleDocstring": [ - (self.__checkModulesDocstrings, ("D101",)), - ], - "functionDocstring": [ - ], - "classDocstring": [ - (self.__checkClassDocstring, ("D104", "D205")), - (self.__checkEricNoBlankBeforeAndAfterClassOrFunction, - ("D242", "D243")), - ], - "methodDocstring": [ - ], - "defDocstring": [ - (self.__checkFunctionDocstring, ("D102", "D203")), - (self.__checkImperativeMood, ("D132",)), - (self.__checkNoSignature, ("D133",)), - (self.__checkEricReturn, ("D234", "D235")), - (self.__checkEricFunctionArguments, - ("D236", "D237", "D238", "D239")), - (self.__checkEricNoBlankBeforeAndAfterClassOrFunction, - ("D244", "D245")), - (self.__checkEricException, ("D250", "D251")), - ], - "docstring": [ - (self.__checkTripleDoubleQuotes, ("D111",)), - (self.__checkBackslashes, ("D112",)), - (self.__checkUnicode, ("D113",)), - (self.__checkIndent, ("D122",)), - (self.__checkSummary, ("D130")), - (self.__checkEricEndsWithPeriod, ("D231",)), - (self.__checkEricBlankAfterSummary, ("D246",)), - (self.__checkEricNBlankAfterLastParagraph, ("D247",)), - (self.__checkEricQuotesOnSeparateLines, ("D222", "D223")) - ], - } - - self.__checkers = {} - for key, checkers in checkersWithCodes.items(): - for checker, codes in checkers: - if any(not (code and self.__ignoreCode(code)) - for code in codes): - if key not in self.__checkers: - self.__checkers[key] = [] - self.__checkers[key].append(checker) - - def __ignoreCode(self, code): - """ - Private method to check if the error code should be ignored. - - @param code message code to check for (string) - @return flag indicating to ignore the given code (boolean) - """ - return (code.startswith(self.__ignore) and - not code.startswith(self.__select)) - - def __error(self, lineNumber, offset, code, *args): - """ - Private method to record an issue. - - @param lineNumber line number of the issue (integer) - @param offset position within line of the issue (integer) - @param code message code (string) - @param args arguments for the message (list) - """ - if self.__ignoreCode(code): - return - - if code in self.counters: - self.counters[code] += 1 - else: - self.counters[code] = 1 - - # Don't care about expected codes - if code in self.__expected: - return - - if code and (self.counters[code] == 1 or self.__repeat): - # record the issue with one based line number - self.errors.append( - (self.__filename, lineNumber + 1, offset, code, args)) - - def __resetReadline(self): - """ - Private method to reset the internal readline function. - """ - self.__lineNumber = 0 - - def __readline(self): - """ - Private method to get the next line from the source. - - @return next line of source (string) - """ - self.__lineNumber += 1 - if self.__lineNumber > len(self.__source): - return '' - return self.__source[self.__lineNumber - 1] - - def run(self): - """ - Public method to check the given source for violations of doc string - conventions. - """ - if not self.__source or not self.__filename: - # don't do anything, if essential data is missing - return - - if not self.__checkers: - # don't do anything, if no codes were selected - return - - for keyword in self.__keywords: - if keyword in self.__checkers: - for check in self.__checkers[keyword]: - for context in self.__parseContexts(keyword): - docstring = self.__parseDocstring(context, keyword) - check(docstring, context) - - def __getSummaryLine(self, docstringContext): - """ - Private method to extract the summary line. - - @param docstringContext docstring context (DocStyleContext) - @return summary line (string) and the line it was found on (integer) - """ - lines = docstringContext.source() - - line = (lines[0] - .replace('r"""', "", 1) - .replace('u"""', "", 1) - .replace('"""', "") - .replace("r'''", "", 1) - .replace("u'''", "", 1) - .replace("'''", "") - .strip()) - - if len(lines) == 1 or len(line) > 0: - return line, 0 - return lines[1].strip().replace('"""', "").replace("'''", ""), 1 - - def __getSummaryLines(self, docstringContext): - """ - Private method to extract the summary lines. - - @param docstringContext docstring context (DocStyleContext) - @return summary lines (list of string) and the line it was found on - (integer) - """ - summaries = [] - lines = docstringContext.source() - - line0 = (lines[0] - .replace('r"""', "", 1) - .replace('u"""', "", 1) - .replace('"""', "") - .replace("r'''", "", 1) - .replace("u'''", "", 1) - .replace("'''", "") - .strip()) - if len(lines) > 1: - line1 = lines[1].strip().replace('"""', "").replace("'''", "") - else: - line1 = "" - if len(lines) > 2: - line2 = lines[2].strip().replace('"""', "").replace("'''", "") - else: - line2 = "" - if line0: - lineno = 0 - summaries.append(line0) - if not line0.endswith(".") and line1: - # two line summary - summaries.append(line1) - elif line1: - lineno = 1 - summaries.append(line1) - if not line1.endswith(".") and line2: - # two line summary - summaries.append(line2) - else: - lineno = 2 - summaries.append(line2) - return summaries, lineno - - if sys.version_info[0] < 3: - def __getArgNames(self, node): - """ - Private method to get the argument names of a function node. - - @param node AST node to extract arguments names from - @return tuple of two list of argument names, one for arguments - and one for keyword arguments (tuple of list of string) - """ - def unpackArgs(args): - """ - Local helper function to unpack function argument names. - - @param args list of AST node arguments - @return list of argument names (list of string) - """ - ret = [] - for arg in args: - if isinstance(arg, ast.Tuple): - ret.extend(unpackArgs(arg.elts)) - else: - ret.append(arg.id) - return ret - - arguments = unpackArgs(node.args.args) - if node.args.vararg is not None: - arguments.append(node.args.vararg) - kwarguments = [] - if node.args.kwarg is not None: - kwarguments.append(node.args.kwarg) - return arguments, kwarguments - else: - def __getArgNames(self, node): # __IGNORE_WARNING__ - """ - Private method to get the argument names of a function node. - - @param node AST node to extract arguments names from - @return tuple of two list of argument names, one for arguments - and one for keyword arguments (tuple of list of string) - """ - arguments = [] - arguments.extend([arg.arg for arg in node.args.args]) - if node.args.vararg is not None: - arguments.append(node.args.vararg) - - kwarguments = [] - kwarguments.extend([arg.arg for arg in node.args.kwonlyargs]) - if node.args.kwarg is not None: - kwarguments.append(node.args.kwarg) - return arguments, kwarguments - - ################################################################## - ## Parsing functionality below - ################################################################## - - def __parseModuleDocstring(self, source): - """ - Private method to extract a docstring given a module source. - - @param source source to parse (list of string) - @return context of extracted docstring (DocStyleContext) - """ - for kind, value, (line, char), _, _ in tokenize.generate_tokens( - StringIO("".join(source)).readline): - if kind in [tokenize.COMMENT, tokenize.NEWLINE, tokenize.NL]: - continue - elif kind == tokenize.STRING: # first STRING should be docstring - return DocStyleContext(value, line - 1, "docstring") - else: - return None - - def __parseDocstring(self, context, what=''): - """ - Private method to extract a docstring given `def` or `class` source. - - @param context context data to get the docstring from (DocStyleContext) - @param what string denoting what is being parsed (string) - @return context of extracted docstring (DocStyleContext) - """ - moduleDocstring = self.__parseModuleDocstring(context.source()) - if what.startswith('module') or context.contextType() == "module": - return moduleDocstring - if moduleDocstring: - return moduleDocstring - - tokenGenerator = tokenize.generate_tokens( - StringIO(context.ssource()).readline) - try: - kind = None - while kind != tokenize.INDENT: - kind, _, _, _, _ = next(tokenGenerator) - kind, value, (line, char), _, _ = next(tokenGenerator) - if kind == tokenize.STRING: # STRING after INDENT is a docstring - return DocStyleContext( - value, context.start() + line - 1, "docstring") - except StopIteration: - pass - - return None - - def __parseTopLevel(self, keyword): - """ - Private method to extract top-level functions or classes. - - @param keyword keyword signaling what to extract (string) - @return extracted function or class contexts (list of DocStyleContext) - """ - self.__resetReadline() - tokenGenerator = tokenize.generate_tokens(self.__readline) - kind, value, char = None, None, None - contexts = [] - try: - while True: - start, end = None, None - while not (kind == tokenize.NAME and - value == keyword and - char == 0): - kind, value, (line, char), _, _ = next(tokenGenerator) - start = line - 1, char - while not (kind == tokenize.DEDENT and - value == '' and - char == 0): - kind, value, (line, char), _, _ = next(tokenGenerator) - end = line - 1, char - contexts.append(DocStyleContext( - self.__source[start[0]:end[0]], start[0], keyword)) - except StopIteration: - return contexts - - def __parseFunctions(self): - """ - Private method to extract top-level functions. - - @return extracted function contexts (list of DocStyleContext) - """ - if not self.__functionsCache: - self.__functionsCache = self.__parseTopLevel('def') - return self.__functionsCache - - def __parseClasses(self): - """ - Private method to extract top-level classes. - - @return extracted class contexts (list of DocStyleContext) - """ - if not self.__classesCache: - self.__classesCache = self.__parseTopLevel('class') - return self.__classesCache - - def __skipIndentedBlock(self, tokenGenerator): - """ - Private method to skip over an indented block of source code. - - @param tokenGenerator token generator - @return last token of the indented block - """ - kind, value, start, end, raw = next(tokenGenerator) - while kind != tokenize.INDENT: - kind, value, start, end, raw = next(tokenGenerator) - indent = 1 - for kind, value, start, end, raw in tokenGenerator: - if kind == tokenize.INDENT: - indent += 1 - elif kind == tokenize.DEDENT: - indent -= 1 - if indent == 0: - return kind, value, start, end, raw - - def __parseMethods(self): - """ - Private method to extract methods of all classes. - - @return extracted method contexts (list of DocStyleContext) - """ - if not self.__methodsCache: - contexts = [] - for classContext in self.__parseClasses(): - tokenGenerator = tokenize.generate_tokens( - StringIO(classContext.ssource()).readline) - kind, value, char = None, None, None - try: - while True: - start, end = None, None - while not (kind == tokenize.NAME and value == 'def'): - kind, value, (line, char), _, _ = \ - next(tokenGenerator) - start = line - 1, char - kind, value, (line, char), _, _ = \ - self.__skipIndentedBlock(tokenGenerator) - end = line - 1, char - startLine = classContext.start() + start[0] - endLine = classContext.start() + end[0] - contexts.append( - DocStyleContext(self.__source[startLine:endLine], - startLine, "def")) - except StopIteration: - pass - self.__methodsCache = contexts - - return self.__methodsCache - - def __parseContexts(self, kind): - """ - Private method to extract a context from the source. - - @param kind kind of context to extract (string) - @return requested contexts (list of DocStyleContext) - """ - if kind == 'moduleDocstring': - return [DocStyleContext(self.__source, 0, "module")] - if kind == 'functionDocstring': - return self.__parseFunctions() - if kind == 'classDocstring': - return self.__parseClasses() - if kind == 'methodDocstring': - return self.__parseMethods() - if kind == 'defDocstring': - return self.__parseFunctions() + self.__parseMethods() - if kind == 'docstring': - return ([DocStyleContext(self.__source, 0, "module")] + - self.__parseFunctions() + - self.__parseClasses() + - self.__parseMethods()) - return [] # fall back - - ################################################################## - ## Checking functionality below (PEP-257) - ################################################################## - - def __checkModulesDocstrings(self, docstringContext, context): - """ - Private method to check, if the module has a docstring. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - self.__error(context.start(), 0, "D101") - return - - docstring = docstringContext.ssource() - if (not docstring or not docstring.strip() or - not docstring.strip('\'"')): - self.__error(context.start(), 0, "D101") - - def __checkFunctionDocstring(self, docstringContext, context): - """ - Private method to check, that all public functions and methods - have a docstring. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - functionName = context.source()[0].lstrip().split()[1].split("(")[0] - if functionName.startswith('_') and not functionName.endswith('__'): - if self.__docType == "eric": - code = "D203" - else: - code = "D103" - else: - code = "D102" - - if docstringContext is None: - self.__error(context.start(), 0, code) - return - - docstring = docstringContext.ssource() - if (not docstring or not docstring.strip() or - not docstring.strip('\'"')): - self.__error(context.start(), 0, code) - - def __checkClassDocstring(self, docstringContext, context): - """ - Private method to check, that all public functions and methods - have a docstring. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - className = context.source()[0].lstrip().split()[1].split("(")[0] - if className.startswith('_'): - if self.__docType == "eric": - code = "D205" - else: - code = "D105" - else: - code = "D104" - - if docstringContext is None: - self.__error(context.start(), 0, code) - return - - docstring = docstringContext.ssource() - if (not docstring or not docstring.strip() or - not docstring.strip('\'"')): - self.__error(context.start(), 0, code) - - def __checkTripleDoubleQuotes(self, docstringContext, context): - """ - Private method to check, that all docstrings are surrounded - by triple double quotes. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstring = docstringContext.ssource().strip() - if not docstring.startswith(('"""', 'r"""', 'u"""')): - self.__error(docstringContext.start(), 0, "D111") - - def __checkBackslashes(self, docstringContext, context): - """ - Private method to check, that all docstrings containing - backslashes are surrounded by raw triple double quotes. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstring = docstringContext.ssource().strip() - if "\\" in docstring and not docstring.startswith('r"""'): - self.__error(docstringContext.start(), 0, "D112") - - def __checkUnicode(self, docstringContext, context): - """ - Private method to check, that all docstrings containing unicode - characters are surrounded by unicode triple double quotes. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstring = docstringContext.ssource().strip() - if not docstring.startswith('u"""') and \ - any(ord(char) > 127 for char in docstring): - self.__error(docstringContext.start(), 0, "D113") - - def __checkOneLiner(self, docstringContext, context): - """ - Private method to check, that one-liner docstrings fit on - one line with quotes. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - lines = docstringContext.source() - if len(lines) > 1: - nonEmptyLines = [l for l in lines if l.strip().strip('\'"')] - if len(nonEmptyLines) == 1: - modLen = len(context.indent() + '"""' + - nonEmptyLines[0].strip() + '"""') - if context.contextType() != "module": - modLen += 4 - if not nonEmptyLines[0].strip().endswith("."): - # account for a trailing dot - modLen += 1 - if modLen <= self.__maxLineLength: - self.__error(docstringContext.start(), 0, "D121") - - def __checkIndent(self, docstringContext, context): - """ - Private method to check, that docstrings are properly indented. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - lines = docstringContext.source() - if len(lines) == 1: - return - - nonEmptyLines = [l.rstrip() for l in lines[1:] if l.strip()] - if not nonEmptyLines: - return - - indent = min([len(l) - len(l.strip()) for l in nonEmptyLines]) - if context.contextType() == "module": - expectedIndent = 0 - else: - expectedIndent = len(context.indent()) + 4 - if indent != expectedIndent: - self.__error(docstringContext.start(), 0, "D122") - - def __checkSummary(self, docstringContext, context): - """ - Private method to check, that docstring summaries contain some text. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - summary, lineNumber = self.__getSummaryLine(docstringContext) - if summary == "": - self.__error(docstringContext.start() + lineNumber, 0, "D130") - - def __checkEndsWithPeriod(self, docstringContext, context): - """ - Private method to check, that docstring summaries end with a period. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - summary, lineNumber = self.__getSummaryLine(docstringContext) - if not summary.endswith("."): - self.__error(docstringContext.start() + lineNumber, 0, "D131") - - def __checkImperativeMood(self, docstringContext, context): - """ - Private method to check, that docstring summaries are in - imperative mood. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - summary, lineNumber = self.__getSummaryLine(docstringContext) - if summary: - firstWord = summary.strip().split()[0] - if firstWord.endswith("s") and not firstWord.endswith("ss"): - self.__error(docstringContext.start() + lineNumber, 0, "D132") - - def __checkNoSignature(self, docstringContext, context): - """ - Private method to check, that docstring summaries don't repeat - the function's signature. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - functionName = context.source()[0].lstrip().split()[1].split("(")[0] - summary, lineNumber = self.__getSummaryLine(docstringContext) - if functionName + "(" in summary.replace(" ", "") and \ - not functionName + "()" in summary.replace(" ", ""): - # report only, if it is not an abbreviated form (i.e. function() ) - self.__error(docstringContext.start() + lineNumber, 0, "D133") - - def __checkReturnType(self, docstringContext, context): - """ - Private method to check, that docstrings mention the return value type. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - if "return" not in docstringContext.ssource().lower(): - tokens = list( - tokenize.generate_tokens(StringIO(context.ssource()).readline)) - return_ = [tokens[i + 1][0] for i, token in enumerate(tokens) - if token[1] == "return"] - if (set(return_) - - set([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE]) != - set([])): - self.__error(docstringContext.end(), 0, "D134") - - def __checkNoBlankLineBefore(self, docstringContext, context): - """ - Private method to check, that function/method docstrings are not - preceded by a blank line. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - contextLines = context.source() - cti = 0 - while cti < len(contextLines) and \ - not contextLines[cti].strip().startswith( - ('"""', 'r"""', 'u"""', "'''", "r'''", "u'''")): - cti += 1 - if cti == len(contextLines): - return - - if not contextLines[cti - 1].strip(): - self.__error(docstringContext.start(), 0, "D141") - - def __checkBlankBeforeAndAfterClass(self, docstringContext, context): - """ - Private method to check, that class docstrings have one - blank line around them. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - contextLines = context.source() - cti = 0 - while cti < len(contextLines) and \ - not contextLines[cti].strip().startswith( - ('"""', 'r"""', 'u"""', "'''", "r'''", "u'''")): - cti += 1 - if cti == len(contextLines): - return - - start = cti - if contextLines[cti].strip() in ( - '"""', 'r"""', 'u"""', "'''", "r'''", "u'''"): - # it is a multi line docstring - cti += 1 - - while cti < len(contextLines) and \ - not contextLines[cti].strip().endswith(('"""', "'''")): - cti += 1 - end = cti - if cti >= len(contextLines) - 1: - return - - if contextLines[start - 1].strip(): - self.__error(docstringContext.start(), 0, "D142") - if contextLines[end + 1].strip(): - self.__error(docstringContext.end(), 0, "D143") - - def __checkBlankAfterSummary(self, docstringContext, context): - """ - Private method to check, that docstring summaries are followed - by a blank line. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstrings = docstringContext.source() - if len(docstrings) <= 3: - # correct/invalid one-liner - return - - summary, lineNumber = self.__getSummaryLine(docstringContext) - if len(docstrings) > 2: - if docstrings[lineNumber + 1].strip(): - self.__error(docstringContext.start() + lineNumber, 0, "D144") - - def __checkBlankAfterLastParagraph(self, docstringContext, context): - """ - Private method to check, that the last paragraph of docstrings is - followed by a blank line. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstrings = docstringContext.source() - if len(docstrings) <= 3: - # correct/invalid one-liner - return - - if docstrings[-2].strip(): - self.__error(docstringContext.end(), 0, "D145") - - ################################################################## - ## Checking functionality below (eric specific ones) - ################################################################## - - def __checkEricQuotesOnSeparateLines(self, docstringContext, context): - """ - Private method to check, that leading and trailing quotes are on - a line by themselves. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - lines = docstringContext.source() - if lines[0].strip().strip('ru"\''): - self.__error(docstringContext.start(), 0, "D221") - if lines[-1].strip().strip('"\''): - self.__error(docstringContext.end(), 0, "D222") - - def __checkEricEndsWithPeriod(self, docstringContext, context): - """ - Private method to check, that docstring summaries end with a period. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - summaryLines, lineNumber = self.__getSummaryLines(docstringContext) - if summaryLines: - if summaryLines[-1].lstrip().startswith("@"): - summaryLines.pop(-1) - summary = " ".join([s.strip() for s in summaryLines if s]) - if summary and not summary.endswith(".") and \ - not summary.split(None, 1)[0].lower() == "constructor": - self.__error( - docstringContext.start() + lineNumber + - len(summaryLines) - 1, - 0, "D231") - - def __checkEricReturn(self, docstringContext, context): - """ - Private method to check, that docstrings contain an @return line - if they return anything and don't otherwise. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - tokens = list( - tokenize.generate_tokens(StringIO(context.ssource()).readline)) - return_ = [tokens[i + 1][0] for i, token in enumerate(tokens) - if token[1] in ("return", "yield")] - if "@return" not in docstringContext.ssource(): - if (set(return_) - - set([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE]) != - set([])): - self.__error(docstringContext.end(), 0, "D234") - else: - if (set(return_) - - set([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE]) == - set([])): - self.__error(docstringContext.end(), 0, "D235") - - def __checkEricFunctionArguments(self, docstringContext, context): - """ - Private method to check, that docstrings contain an @param and/or - @keyparam line for each argument. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - try: - tree = ast.parse(context.ssource()) - except (SyntaxError, TypeError): - return - if (isinstance(tree, ast.Module) and len(tree.body) == 1 and - isinstance(tree.body[0], ast.FunctionDef)): - functionDef = tree.body[0] - argNames, kwNames = self.__getArgNames(functionDef) - if "self" in argNames: - argNames.remove("self") - if "cls" in argNames: - argNames.remove("cls") - - docstring = docstringContext.ssource() - if (docstring.count("@param") + docstring.count("@keyparam") < - len(argNames + kwNames)): - self.__error(docstringContext.end(), 0, "D236") - elif (docstring.count("@param") + docstring.count("@keyparam") > - len(argNames + kwNames)): - self.__error(docstringContext.end(), 0, "D237") - else: - # extract @param and @keyparam from docstring - args = [] - kwargs = [] - for line in docstringContext.source(): - if line.strip().startswith(("@param", "@keyparam")): - at, name = line.strip().split(None, 2)[:2] - if at == "@keyparam": - kwargs.append(name.lstrip("*")) - args.append(name.lstrip("*")) - - # do the checks - for name in kwNames: - if name not in kwargs: - self.__error(docstringContext.end(), 0, "D238") - return - if argNames + kwNames != args: - self.__error(docstringContext.end(), 0, "D239") - - def __checkEricException(self, docstringContext, context): - """ - Private method to check, that docstrings contain an @exception line - if they raise an exception and don't otherwise. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - tokens = list( - tokenize.generate_tokens(StringIO(context.ssource()).readline)) - exception = [tokens[i + 1][0] for i, token in enumerate(tokens) - if token[1] == "raise"] - if "@exception" not in docstringContext.ssource() and \ - "@throws" not in docstringContext.ssource() and \ - "@raise" not in docstringContext.ssource(): - if (set(exception) - - set([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE]) != - set([])): - self.__error(docstringContext.end(), 0, "D250") - else: - if (set(exception) - - set([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE]) == - set([])): - self.__error(docstringContext.end(), 0, "D251") - - def __checkEricBlankAfterSummary(self, docstringContext, context): - """ - Private method to check, that docstring summaries are followed - by a blank line. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstrings = docstringContext.source() - if len(docstrings) <= 3: - # correct/invalid one-liner - return - - summaryLines, lineNumber = self.__getSummaryLines(docstringContext) - if len(docstrings) - 2 > lineNumber + len(summaryLines) - 1: - if docstrings[lineNumber + len(summaryLines)].strip(): - self.__error(docstringContext.start() + lineNumber, 0, "D246") - - def __checkEricNoBlankBeforeAndAfterClassOrFunction( - self, docstringContext, context): - """ - Private method to check, that class and function/method docstrings - have no blank line around them. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - contextLines = context.source() - isClassContext = contextLines[0].lstrip().startswith("class ") - cti = 0 - while cti < len(contextLines) and \ - not contextLines[cti].strip().startswith( - ('"""', 'r"""', 'u"""', "'''", "r'''", "u'''")): - cti += 1 - if cti == len(contextLines): - return - - start = cti - if contextLines[cti].strip() in ( - '"""', 'r"""', 'u"""', "'''", "r'''", "u'''"): - # it is a multi line docstring - cti += 1 - - while cti < len(contextLines) and \ - not contextLines[cti].strip().endswith(('"""', "'''")): - cti += 1 - end = cti - if cti >= len(contextLines) - 1: - return - - if isClassContext: - if not contextLines[start - 1].strip(): - self.__error(docstringContext.start(), 0, "D242") - if not contextLines[end + 1].strip(): - self.__error(docstringContext.end(), 0, "D243") - else: - if not contextLines[start - 1].strip(): - self.__error(docstringContext.start(), 0, "D244") - if not contextLines[end + 1].strip(): - self.__error(docstringContext.end(), 0, "D245") - - def __checkEricNBlankAfterLastParagraph(self, docstringContext, context): - """ - Private method to check, that the last paragraph of docstrings is - not followed by a blank line. - - @param docstringContext docstring context (DocStyleContext) - @param context context of the docstring (DocStyleContext) - """ - if docstringContext is None: - return - - docstrings = docstringContext.source() - if len(docstrings) <= 3: - # correct/invalid one-liner - return - - if not docstrings[-2].strip(): - self.__error(docstringContext.end(), 0, "D247") - -# -# eflag: FileType = Python2
--- a/UtilitiesPython2/NamingStyleCheckerPy2.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,426 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2013 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing a checker for naming conventions for Python2. -""" - -import collections -import ast -import re -import os - - -class NamingStyleChecker(object): - """ - Class implementing a checker for naming conventions for Python2. - """ - LowercaseRegex = re.compile(r"[_a-z][_a-z0-9]*$") - UppercaseRegexp = re.compile(r"[_A-Z][_A-Z0-9]*$") - CamelcaseRegexp = re.compile(r"_?[A-Z][a-zA-Z0-9]*$") - MixedcaseRegexp = re.compile(r"_?[a-z][a-zA-Z0-9]*$") - - Codes = [ - "N801", "N802", "N803", "N804", "N805", "N806", "N807", "N808", - "N811", "N812", "N813", "N814", "N821", "N831" - ] - - def __init__(self, tree, filename, options): - """ - Constructor (according to 'extended' pep8.py API) - - @param tree AST tree of the source file - @param filename name of the source file (string) - @param options options as parsed by pep8.StyleGuide - """ - self.__parents = collections.deque() - self.__tree = tree - self.__filename = filename - - self.__checkersWithCodes = { - "classdef": [ - (self.__checkClassName, ("N801",)), - (self.__checkNameToBeAvoided, ("N831",)), - ], - "functiondef": [ - (self.__checkFuntionName, ("N802",)), - (self.__checkFunctionArgumentNames, - ("N803", "N804", "N805", "N806")), - (self.__checkNameToBeAvoided, ("N831",)), - ], - "assign": [ - (self.__checkVariablesInFunction, ("N821",)), - (self.__checkNameToBeAvoided, ("N831",)), - ], - "importfrom": [ - (self.__checkImportAs, ("N811", "N812", "N813", "N814")), - ], - "module": [ - (self.__checkModule, ("N807", "N808")), - ], - } - - self.__checkers = {} - for key, checkers in self.__checkersWithCodes.items(): - for checker, codes in checkers: - if any(not (code and options.ignore_code(code)) - for code in codes): - if key not in self.__checkers: - self.__checkers[key] = [] - self.__checkers[key].append(checker) - - def run(self): - """ - Public method run by the pep8.py checker. - - @return tuple giving line number, offset within line, code and - checker function - """ - if self.__tree: - return self.__visitTree(self.__tree) - else: - return () - - def __visitTree(self, node): - """ - Private method to scan the given AST tree. - - @param node AST tree node to scan - @return tuple giving line number, offset within line, code and - checker function - """ - for error in self.__visitNode(node): - yield error - self.__parents.append(node) - for child in ast.iter_child_nodes(node): - for error in self.__visitTree(child): - yield error - self.__parents.pop() - - def __visitNode(self, node): - """ - Private method to inspect the given AST node. - - @param node AST tree node to inspect - @return tuple giving line number, offset within line, code and - checker function - """ - if isinstance(node, ast.ClassDef): - self.__tagClassFunctions(node) - elif isinstance(node, ast.FunctionDef): - self.__findGlobalDefs(node) - - checkerName = node.__class__.__name__.lower() - if checkerName in self.__checkers: - for checker in self.__checkers[checkerName]: - for error in checker(node, self.__parents): - yield error + (self.__checkers[checkerName],) - - def __tagClassFunctions(self, classNode): - """ - Private method to tag functions if they are methods, class methods or - static methods. - - @param classNode AST tree node to tag - """ - # try to find all 'old style decorators' like - # m = staticmethod(m) - lateDecoration = {} - for node in ast.iter_child_nodes(classNode): - if not (isinstance(node, ast.Assign) and - isinstance(node.value, ast.Call) and - isinstance(node.value.func, ast.Name)): - continue - funcName = node.value.func.id - if funcName in ("classmethod", "staticmethod"): - meth = (len(node.value.args) == 1 and node.value.args[0]) - if isinstance(meth, ast.Name): - lateDecoration[meth.id] = funcName - - # iterate over all functions and tag them - for node in ast.iter_child_nodes(classNode): - if not isinstance(node, ast.FunctionDef): - continue - - node.function_type = 'method' - if node.name == "__new__": - node.function_type = "classmethod" - - if node.name in lateDecoration: - node.function_type = lateDecoration[node.name] - elif node.decorator_list: - names = [d.id for d in node.decorator_list - if isinstance(d, ast.Name) and - d.id in ("classmethod", "staticmethod")] - if names: - node.function_type = names[0] - - def __findGlobalDefs(self, functionNode): - """ - Private method amend a node with global definitions information. - - @param functionNode AST tree node to amend - """ - globalNames = set() - nodesToCheck = collections.deque(ast.iter_child_nodes(functionNode)) - while nodesToCheck: - node = nodesToCheck.pop() - if isinstance(node, ast.Global): - globalNames.update(node.names) - - if not isinstance(node, (ast.FunctionDef, ast.ClassDef)): - nodesToCheck.extend(ast.iter_child_nodes(node)) - functionNode.global_names = globalNames - - def __getArgNames(self, node): - """ - Private method to get the argument names of a function node. - - @param node AST node to extract arguments names from - @return list of argument names (list of string) - """ - def unpackArgs(args): - """ - Local helper function to unpack function argument names. - - @param args list of AST node arguments - @return list of argument names (list of string) - """ - ret = [] - for arg in args: - if isinstance(arg, ast.Tuple): - ret.extend(unpackArgs(arg.elts)) - else: - ret.append(arg.id) - return ret - - return unpackArgs(node.args.args) - - def __error(self, node, code): - """ - Private method to build the error information. - - @param node AST node to report an error for - @param code error code to report (string) - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - if isinstance(node, ast.Module): - lineno = 0 - offset = 0 - else: - lineno = node.lineno - offset = node.col_offset - if isinstance(node, ast.ClassDef): - lineno += len(node.decorator_list) - offset += 6 - elif isinstance(node, ast.FunctionDef): - lineno += len(node.decorator_list) - offset += 4 - return (lineno, offset, code) - - def __isNameToBeAvoided(self, name): - """ - Private method to check, if the given name should be avoided. - - @param name name to be checked (string) - @return flag indicating to avoid it (boolen) - """ - return name in ("l", "O", "I") - - def __checkNameToBeAvoided(self, node, parents): - """ - Private class to check the given node for a name to be avoided (N831). - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - if isinstance(node, (ast.ClassDef, ast.FunctionDef)): - name = node.name - if self.__isNameToBeAvoided(name): - yield self.__error(node, "N831") - return - - if isinstance(node, ast.FunctionDef): - argNames = self.__getArgNames(node) - for arg in argNames: - if self.__isNameToBeAvoided(arg): - yield self.__error(node, "N831") - return - - if isinstance(node, ast.Assign): - for target in node.targets: - name = isinstance(target, ast.Name) and target.id - if not name: - return - - if self.__isNameToBeAvoided(name): - yield self.__error(node, "N831") - return - - def __checkClassName(self, node, parents): - """ - Private class to check the given node for class name - conventions (N801). - - Almost without exception, class names use the CapWords convention. - Classes for internal use have a leading underscore in addition. - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - if not self.CamelcaseRegexp.match(node.name): - yield self.__error(node, "N801") - - def __checkFuntionName(self, node, parents): - """ - Private class to check the given node for function name - conventions (N802). - - Function names should be lowercase, with words separated by underscores - as necessary to improve readability. Functions <b>not</b> being - methods '__' in front and back are not allowed. Mixed case is allowed - only in contexts where that's already the prevailing style - (e.g. threading.py), to retain backwards compatibility. - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - functionType = getattr(node, "function_type", "function") - name = node.name - if (functionType == "function" and "__" in (name[:2], name[-2:])) or \ - not self.LowercaseRegex.match(name): - yield self.__error(node, "N802") - - def __checkFunctionArgumentNames(self, node, parents): - """ - Private class to check the argument names of functions - (N803, N804, N805, N806). - - The argument names of a function should be lowercase, with words - separated by underscores. A class method should have 'cls' as the - first argument. A method should have 'self' as the first argument. - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - if node.args.kwarg is not None: - if not self.LowercaseRegex.match(node.args.kwarg): - yield self.__error(node, "N803") - return - - if node.args.vararg is not None: - if not self.LowercaseRegex.match(node.args.vararg): - yield self.__error(node, "N803") - return - - argNames = self.__getArgNames(node) - functionType = getattr(node, "function_type", "function") - - if not argNames: - if functionType == "method": - yield self.__error(node, "N805") - elif functionType == "classmethod": - yield self.__error(node, "N804") - return - - if functionType == "method": - if argNames[0] != "self": - yield self.__error(node, "N805") - elif functionType == "classmethod": - if argNames[0] != "cls": - yield self.__error(node, "N804") - elif functionType == "staticmethod": - if argNames[0] in ("cls", "self"): - yield self.__error(node, "N806") - for arg in argNames: - if not self.LowercaseRegex.match(arg): - yield self.__error(node, "N803") - return - - def __checkVariablesInFunction(self, node, parents): - """ - Private method to check local variables in functions (N821). - - Local variables in functions should be lowercase. - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - for parentFunc in reversed(parents): - if isinstance(parentFunc, ast.ClassDef): - return - if isinstance(parentFunc, ast.FunctionDef): - break - else: - return - for target in node.targets: - name = isinstance(target, ast.Name) and target.id - if not name or name in parentFunc.global_names: - return - - if not self.LowercaseRegex.match(name) and name[:1] != '_': - yield self.__error(target, "N821") - - def __checkModule(self, node, parents): - """ - Private method to check module naming conventions (N807, N808). - - Module and package names should be lowercase. - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - if self.__filename: - moduleName = os.path.splitext(os.path.basename(self.__filename))[0] - if moduleName.lower() != moduleName: - yield self.__error(node, "N807") - - if moduleName == "__init__": - # we got a package - packageName = \ - os.path.split(os.path.dirname(self.__filename))[1] - if packageName.lower != packageName: - yield self.__error(node, "N808") - - def __checkImportAs(self, node, parents): - """ - Private method to check that imports don't change the - naming convention (N811, N812, N813, N814). - - @param node AST note to check - @param parents list of parent nodes - @return tuple giving line number, offset within line and error code - (integer, integer, string) - """ - for name in node.names: - if not name.asname: - continue - - if self.UppercaseRegexp.match(name.name): - if not self.UppercaseRegexp.match(name.asname): - yield self.__error(node, "N811") - elif self.LowercaseRegex.match(name.name): - if not self.LowercaseRegex.match(name.asname): - yield self.__error(node, "N812") - elif self.LowercaseRegex.match(name.asname): - yield self.__error(node, "N813") - elif self.UppercaseRegexp.match(name.asname): - yield self.__error(node, "N814") - -# -# eflag: FileType = Python2
--- a/UtilitiesPython2/Tools.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -Module implementing tool functions. -""" - -import re -from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF32 - -coding_regexps = [ - (2, re.compile(r'''coding[:=]\s*([-\w_.]+)''')), - (1, re.compile(r'''<\?xml.*\bencoding\s*=\s*['"]([-\w_.]+)['"]\?>''')), -] - - -def get_coding(text): - """ - Function to get the coding of a text. - - @param text text to inspect (string) - @return coding string - """ - lines = text.splitlines() - for coding in coding_regexps: - coding_re = coding[1] - head = lines[:coding[0]] - for l in head: - m = coding_re.search(l) - if m: - return m.group(1).lower() - return None - - -def decode(text): - """ - Function to decode a text. - - @param text text to decode (string) - @return decoded text and encoding - """ - try: - if text.startswith(BOM_UTF8): - # UTF-8 with BOM - return unicode(text[len(BOM_UTF8):], 'utf-8'), 'utf-8-bom' - elif text.startswith(BOM_UTF16): - # UTF-16 with BOM - return unicode(text[len(BOM_UTF16):], 'utf-16'), 'utf-16' - elif text.startswith(BOM_UTF32): - # UTF-32 with BOM - return unicode(text[len(BOM_UTF32):], 'utf-32'), 'utf-32' - coding = get_coding(text) - if coding: - return unicode(text, coding), coding - except (UnicodeError, LookupError): - pass - - # Assume UTF-8 - try: - return unicode(text, 'utf-8'), 'utf-8-guessed' - except (UnicodeError, LookupError): - pass - - # Assume Latin-1 (behaviour before 3.7.1) - return unicode(text, "latin-1"), 'latin-1-guessed' - - -def readEncodedFile(filename): - """ - Function to read a file and decode its contents into proper text. - - @param filename name of the file to read (string) - @return tuple of decoded text and encoding (string, string) - """ - f = open(filename) - text = f.read() - f.close() - return decode(text) - - -def normalizeCode(codestring): - """ - Function to normalize the given code. - - @param codestring code to be normalized (string) - @return normalized code (string) - """ - if type(codestring) == type(u""): - codestring = codestring.encode('utf-8') - codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") - - if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' - - return codestring - - -def extractLineFlags(line, startComment="#", endComment=""): - """ - Function to extract flags starting and ending with '__' from a line - comment. - - @param line line to extract flags from (string) - @keyparam startComment string identifying the start of the comment (string) - @keyparam endComment string identifying the end of a comment (string) - @return list containing the extracted flags (list of strings) - """ - flags = [] - - pos = line.rfind(startComment) - if pos >= 0: - comment = line[pos + len(startComment):].strip() - if endComment: - comment = comment.replace("endComment", "") - flags = [f.strip() for f in comment.split() - if (f.startswith("__") and f.endswith("__"))] - return flags - -# -# eflag: FileType = Python2
--- a/UtilitiesPython2/__init__.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -""" -This package implements some utilities and tools for Python2. -"""
--- a/UtilitiesPython2/pep8.py Sun Jan 05 23:22:17 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1921 +0,0 @@ -# -*- coding: utf-8 -*- - -# -# pep8.py - Check Python source code formatting, according to PEP 8 -# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> -# Copyright (C) 2009-2013 Florent Xicluna <florent.xicluna@gmail.com> -# -# 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 -900 syntax error -""" - -# -# This is a modified version to make the original pep8.py better suitable -# for being called from within the eric5 IDE. The modifications are as -# follows: -# -# - made messages translatable via Qt -# - added code for eric5 integration -# -# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> -# - -__version__ = '1.4.6' - -import os -import sys -import re -import time -import inspect -import keyword -import tokenize -from optparse import OptionParser -from fnmatch import fnmatch -try: - from configparser import RawConfigParser - from io import TextIOWrapper -except ImportError: - from ConfigParser import RawConfigParser # __IGNORE_WARNING__ - -DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__' -DEFAULT_IGNORE = 'E123,E226,E24' -if sys.platform == 'win32': - DEFAULT_CONFIG = os.path.expanduser(r'~\.pep8') -else: - DEFAULT_CONFIG = os.path.join(os.getenv('XDG_CONFIG_HOME') or - os.path.expanduser('~/.config'), 'pep8') -PROJECT_CONFIG = ('setup.cfg', 'tox.ini', '.pep8') -TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite') -MAX_LINE_LENGTH = 79 -REPORT_FORMAT = { - 'default': '%(path)s:%(row)d:%(col)d: %(code)s %(text)s', - 'pylint': '%(path)s:%(row)d: [%(code)s] %(text)s', -} - -PyCF_ONLY_AST = 1024 -SINGLETONS = frozenset(['False', 'None', 'True']) -KEYWORDS = frozenset(keyword.kwlist + ['print']) - SINGLETONS -UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) -ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) -WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) -WS_NEEDED_OPERATORS = frozenset([ - '**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>', - '%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=']) -WHITESPACE = frozenset(' \t') -SKIP_TOKENS = frozenset([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE, - tokenize.INDENT, tokenize.DEDENT]) -BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] - -INDENT_REGEX = re.compile(r'([ \t]*)') -RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') -RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+') -ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') -DOCSTRING_REGEX = re.compile(r'u?r?["\']') -EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') -WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') -COMPARE_SINGLETON_REGEX = re.compile(r'([=!]=)\s*(None|False|True)') -COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type' - r'|\s*\(\s*([^)]*[^ )])\s*\))') -KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) -OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') -LAMBDA_REGEX = re.compile(r'\blambda\b') -HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') - -# Work around Python < 2.6 behaviour, which does not generate NL after -# a comment which is on a line by itself. -COMMENT_WITH_NL = tokenize.generate_tokens(['#\n'].pop).send(None)[1] == '#\n' - - -############################################################################## -# 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 '\t' in indent: - 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)\n# - W291: spam(1) \n# - 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(' \t\v') - 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 not physical_line.rstrip() and line_number == len(lines): - return 0, "W391" - - -def missing_newline(physical_line): - """ - JCR: The last line should have a newline. - - Reports warning W292. - """ - if physical_line.rstrip() == physical_line: - return len(physical_line), "W292" - - -def maximum_line_length(physical_line, max_line_length): - """ - 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. - - Reports error E501. - """ - line = physical_line.rstrip() - length = len(line) - if length > max_line_length and not noqa(line): - if hasattr(line, 'decode'): # Python 2 - # The line could contain multi-byte characters - try: - length = len(line.decode('utf-8')) - except UnicodeError: - pass - if length > max_line_length: - return max_line_length, "E501", length, max_line_length - - -############################################################################## -# Plugins (check functions) for logical lines -############################################################################## - - -def blank_lines(logical_line, blank_lines, indent_level, line_number, - previous_logical, previous_indent_level): - 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 < 3 and not previous_logical: - return # Don't expect blank lines before the first line - if previous_logical.startswith('@'): - if blank_lines: - yield 0, "E304" - elif blank_lines > 2 or (indent_level and blank_lines == 2): - yield 0, "E303", blank_lines - elif logical_line.startswith(('def ', 'class ', '@')): - if indent_level: - if not (blank_lines or previous_indent_level < indent_level or - DOCSTRING_REGEX.match(previous_logical)): - yield 0, "E301" - elif blank_lines != 2: - yield 0, "E302", 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 + ' ': - # assert char in '([{' - yield found + 1, "E201", char - elif line[found - 1] != ',': - code = ('E202' if char in '}])' else 'E203') # if char in ',;:' - yield found, code, char - - -def whitespace_around_keywords(logical_line): - r""" - Avoid extraneous whitespace around keywords. - - Okay: True and False - E271: True and False - E272: True and False - E273: True and\tFalse - E274: True\tand False - """ - for match in KEYWORD_REGEX.finditer(logical_line): - before, after = match.groups() - - if '\t' in before: - yield match.start(1), "E274" - elif len(before) > 1: - yield match.start(1), "E272" - - if '\t' in after: - yield match.start(2), "E273" - elif len(after) > 1: - yield match.start(2), "E271" - - -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) - E231: [{'a':'b'}] - """ - 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(']') and \ - before.rfind('{') < before.rfind('['): - continue # Slice syntax, no space required - if char == ',' and line[index + 1] == ')': - continue # Allow tuple with only one element: (3,) - yield 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: - yield 0, "E111" - indent_expect = previous_logical.endswith(':') - if indent_expect and indent_level <= previous_indent_level: - yield 0, "E112" - if indent_level > previous_indent_level and not indent_expect: - yield 0, "E113" - - -def continued_indentation(logical_line, tokens, indent_level, hang_closing, - noqa, verbose): - r""" - Continuation lines should align wrapped elements either vertically using - Python's implicit line joining inside parentheses, brackets and braces, or - using a hanging indent. - - When using a hanging indent the following considerations should be applied: - - - there should be no arguments on the first line, and - - - further indentation should be used to clearly distinguish itself as a - continuation line. - - Okay: a = (\n) - E123: a = (\n ) - - Okay: a = (\n 42) - E121: a = (\n 42) - E122: a = (\n42) - E123: a = (\n 42\n ) - E124: a = (24,\n 42\n) - E125: if (a or\n b):\n pass - E126: a = (\n 42) - E127: a = (24,\n 42) - E128: a = (24,\n 42) - """ - first_row = tokens[0][2][0] - nrows = 1 + tokens[-1][2][0] - first_row - if noqa or nrows == 1: - return - - # indent_next tells us whether the next block is indented; assuming - # that it is indented by 4 spaces, then we should not allow 4-space - # indents on the final continuation line; in turn, some other - # indents are allowed to have an extra 4 spaces. - indent_next = logical_line.endswith(':') - - row = depth = 0 - # remember how many brackets were opened on each line - parens = [0] * nrows - # relative indents of physical lines - rel_indent = [0] * nrows - # visual indents - indent_chances = {} - last_indent = tokens[0][2] - indent = [last_indent[1]] - if verbose >= 3: - print(">>> " + tokens[0][4].rstrip()) - - for token_type, text, start, end, line in tokens: - - last_token_multiline = (start[0] != end[0]) - newline = row < start[0] - first_row - if newline: - row = start[0] - first_row - newline = (not last_token_multiline and - token_type not in (tokenize.NL, tokenize.NEWLINE)) - - if newline: - # this is the beginning of a continuation line. - last_indent = start - if verbose >= 3: - print("... " + line.rstrip()) - - # record the initial indent. - rel_indent[row] = expand_indent(line) - indent_level - - if depth: - # a bracket expression in a continuation line. - # find the line that it was opened on - for open_row in range(row - 1, -1, -1): - if parens[open_row]: - break - else: - # an unbracketed continuation line (ie, backslash) - open_row = 0 - hang = rel_indent[row] - rel_indent[open_row] - close_bracket = (token_type == tokenize.OP and text in ']})') - visual_indent = (not close_bracket and hang > 0 and - indent_chances.get(start[1])) - - if close_bracket and indent[depth]: - # closing bracket for visual indent - if start[1] != indent[depth]: - yield start, "E124" - elif close_bracket and not hang: - # closing bracket matches indentation of opening bracket's line - if hang_closing: - yield start, "E133" - elif visual_indent is True: - # visual indent is verified - if not indent[depth]: - indent[depth] = start[1] - elif visual_indent in (text, str): - # ignore token lined up with matching one from a previous line - pass - elif indent[depth] and start[1] < indent[depth]: - # visual indent is broken - yield start, "E128" - elif hang == 4 or (indent_next and rel_indent[row] == 8): - # hanging indent is verified - if close_bracket and not hang_closing: - yield (start, "E123") - else: - # indent is broken - if hang <= 0: - error = "E122" - elif indent[depth]: - error = "E127" - elif hang % 4: - error = "E121" - else: - error = "E126" - yield start, error - - # look for visual indenting - if (parens[row] and token_type not in (tokenize.NL, tokenize.COMMENT) - and not indent[depth]): - indent[depth] = start[1] - indent_chances[start[1]] = True - if verbose >= 4: - print("bracket depth %s indent to %s" % (depth, start[1])) - # deal with implicit string concatenation - elif (token_type in (tokenize.STRING, tokenize.COMMENT) or - text in ('u', 'ur', 'b', 'br')): - indent_chances[start[1]] = str - # special case for the "if" statement because len("if (") == 4 - elif not indent_chances and not row and not depth and text == 'if': - indent_chances[end[1] + 1] = True - - # keep track of bracket depth - if token_type == tokenize.OP: - if text in '([{': - depth += 1 - indent.append(0) - parens[row] += 1 - if verbose >= 4: - print("bracket depth %s seen, col %s, visual min = %s" % - (depth, start[1], indent[depth])) - elif text in ')]}' and depth > 0: - # parent indents should not be more than this one - prev_indent = indent.pop() or last_indent[1] - for d in range(depth): - if indent[d] > prev_indent: - indent[d] = 0 - for ind in list(indent_chances): - if ind >= prev_indent: - del indent_chances[ind] - depth -= 1 - if depth: - indent_chances[indent[depth]] = True - for idx in range(row, -1, -1): - if parens[idx]: - parens[idx] -= 1 - rel_indent[row] = rel_indent[idx] - break - assert len(indent) == depth + 1 - if start[1] not in indent_chances: - # allow to line up tokens - indent_chances[start[1]] = text - - if indent_next and expand_indent(line) == indent_level + 4: - yield last_indent, "E125" - - -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, prev_text, __, prev_end, __ = tokens[0] - for index in range(1, len(tokens)): - token_type, text, start, end, __ = 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)): - yield 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 OPERATOR_REGEX.finditer(logical_line): - before, after = match.groups() - - if '\t' in before: - yield match.start(1), "E223" - elif len(before) > 1: - yield match.start(1), "E221" - - if '\t' in after: - yield match.start(2), "E224" - elif len(after) > 1: - yield match.start(2), "E222" - -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: alpha[:-i] - - E225: i=i+1 - E225: submitted +=1 - E225: x = x /2 - 1 - E225: z = x **y - E226: c = (a+b) * (a-b) - E226: hypot2 = x*x + y*y - E227: c = a|b - E228: msg = fmt%(errno, errmsg) - """ - 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 3 - continue - if text in ('(', 'lambda'): - parens += 1 - elif text == ')': - parens -= 1 - if need_space: - if start != prev_end: - # Found a (probably) needed space - if need_space is not True and not need_space[1]: - yield need_space[0], "E225" - need_space = False - elif text == '>' and prev_text in ('<', '-'): - # Tolerate the "<>" operator, even if running Python 3 - # Deal with Python 3's annotated return value "->" - pass - else: - if need_space is True or need_space[1]: - # A needed trailing space was not found - yield prev_end, "E225" - else: - code = 'E226' - if prev_text == '%': - code = 'E228' - elif prev_text not in ARITHMETIC_OP: - code = 'E227' - yield need_space[0], code - need_space = False - 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 WS_NEEDED_OPERATORS: - need_space = True - elif text in UNARY_OPERATORS: - # Check if the operator is being used as a binary operator - # Allow unary operators: -123, -x, +1. - # Allow argument unpacking: foo(*args, **kwargs). - if prev_type == tokenize.OP: - binary_usage = (prev_text in '}])') - elif prev_type == tokenize.NAME: - binary_usage = (prev_text not in KEYWORDS) - else: - binary_usage = (prev_type not in SKIP_TOKENS) - - if binary_usage: - need_space = None - elif text in WS_OPTIONAL_OPERATORS: - need_space = None - - if need_space is None: - # Surrounding space is optional, but ensure that - # trailing space matches opening space - need_space = (prev_end, start != prev_end) - elif need_space and start == prev_end: - # A needed opening space was not found - yield prev_end, "E225" - need_space = False - 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 m in WHITESPACE_AFTER_COMMA_REGEX.finditer(line): - found = m.start() + 1 - if '\t' in m.group(): - yield found, "E242", m.group()[0] - else: - yield found, "E241", m.group()[0] - - -def whitespace_around_named_parameter_equals(logical_line, tokens): - """ - 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 - no_space = False - prev_end = None - message = "E251" - for token_type, text, start, end, line in tokens: - if no_space: - no_space = False - if start != prev_end: - yield prev_end, message - elif token_type == tokenize.OP: - if text == '(': - parens += 1 - elif text == ')': - parens -= 1 - elif parens and text == '=': - no_space = True - if start != prev_end: - yield prev_end, message - prev_end = end - - -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.COMMENT: - if not line[:start[1]].strip(): - continue - if prev_end[0] == start[0] and start[1] < prev_end[1] + 2: - yield prev_end, "E261" - symbol, sp, comment = text.partition(' ') - if symbol not in ('#', '#:') or comment[:1].isspace(): - yield start, "E262" - elif token_type != tokenize.NL: - 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 -1 < found and ';' not in line[:found]: - yield 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() - E703: do_four(); # useless semicolon - """ - line = logical_line - last_char = len(line) - 1 - found = line.find(':') - while -1 < found < last_char: - before = line[:found] - if (before.count('{') <= before.count('}') and # {'a': 1} (dict) - before.count('[') <= before.count(']') and # [1:2] (slice) - before.count('(') <= before.count(')') and # (Python 3 annotation) - not LAMBDA_REGEX.search(before)): # lambda x: x - yield found, "E701" - found = line.find(':', found + 1) - found = line.find(';') - while -1 < found: - if found < last_char: - yield found, "E702" - else: - yield found, "E703" - found = line.find(';', found + 1) - - -def explicit_line_join(logical_line, tokens): - r""" - Avoid explicit line join between brackets. - - The preferred way of wrapping long lines is by using Python's implied line - continuation inside parentheses, brackets and braces. Long lines can be - broken over multiple lines by wrapping expressions in parentheses. These - should be used in preference to using a backslash for line continuation. - - E502: aaa = [123, \\n 123] - E502: aaa = ("bbb " \\n "ccc") - - Okay: aaa = [123,\n 123] - Okay: aaa = ("bbb "\n "ccc") - Okay: aaa = "bbb " \\n "ccc" - """ - prev_start = prev_end = parens = 0 - backslash = None - for token_type, text, start, end, line in tokens: - if start[0] != prev_start and parens and backslash: - yield backslash, "E502" - if end[0] != prev_end: - if line.rstrip('\r\n').endswith('\\'): - backslash = (end[0], len(line.splitlines()[-1]) - 1) - else: - backslash = None - prev_start = prev_end = end[0] - else: - prev_start = start[0] - if token_type == tokenize.OP: - if text in '([{': - parens += 1 - elif text in ')]}': - parens -= 1 - - -def comparison_to_singleton(logical_line, noqa): - """ - Comparisons to singletons like None should always be done - with "is" or "is not", never the equality operators. - - Okay: if arg is not None: - E711: if arg != None: - E712: if arg == True: - - Also, beware of writing if x when you really mean if x is not None -- - e.g. when testing whether a variable or argument that defaults to None was - set to some other value. The other value might have a type (such as a - container) that could be false in a boolean context! - """ - match = not noqa and COMPARE_SINGLETON_REGEX.search(logical_line) - if match: - same = (match.group(1) == '==') - singleton = match.group(2) - msg = "'if cond is %s:'" % (('' if same else 'not ') + singleton) - if singleton in ('None',): - code = 'E711' - else: - code = 'E712' - nonzero = ((singleton == 'True' and same) or - (singleton == 'False' and not same)) - msg += " or 'if %scond:'" % ('' if nonzero else 'not ') - yield match.start(1), code, singleton, msg - - -def comparison_type(logical_line): - """ - Object type comparisons should always use isinstance() instead of - comparing types directly. - - Okay: if isinstance(obj, int): - E721: if type(obj) is type(1): - - When checking if an object is a string, keep in mind that it might be a - unicode string too! In Python 2.3, str and unicode have a common base - class, basestring, so you can do: - - Okay: if isinstance(obj, basestring): - Okay: if type(a1) is type(b1): - """ - match = COMPARE_TYPE_REGEX.search(logical_line) - if match: - inst = match.group(1) - if inst and isidentifier(inst) and inst not in SINGLETONS: - return # Allow comparison for types which are not obvious - yield match.start(), "E721" - - -def python_3000_has_key(logical_line): - r""" - The {}.has_key() method is removed in the Python 3. - Use the 'in' operation instead. - - Okay: if "alph" in d:\n print d["alph"] - W601: assert d.has_key('alph') - """ - pos = logical_line.find('.has_key(') - if pos > -1: - yield 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 is removed in Python 3. - - Okay: raise DummyError("Message") - W602: raise DummyError, "Message" - """ - match = RAISE_COMMA_REGEX.match(logical_line) - if match and not RERAISE_COMMA_REGEX.match(logical_line): - yield match.end() - 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 3. - - Okay: if a != 'no': - W603: if a <> 'no': - """ - pos = logical_line.find('<>') - if pos > -1: - yield pos, "W603" - - -def python_3000_backticks(logical_line): - """ - Backticks are removed in Python 3. - Use repr() instead. - - Okay: val = repr(1 + 2) - W604: val = `1 + 2` - """ - pos = logical_line.find('`') - if pos > -1: - yield pos, "W604" - - -############################################################################## -# Helper functions -############################################################################## - - -if '' == ''.encode(): - # Python 2: implicit encoding. - def readlines(filename): - f = open(filename) - try: - return f.readlines() - finally: - f.close() - isidentifier = re.compile(r'[a-zA-Z_]\w*').match - stdin_get_value = sys.stdin.read -else: - # Python 3 - def readlines(filename): # __IGNORE_WARNING__ - f = open(filename, 'rb') - try: - coding, lines = tokenize.detect_encoding(f.readline) - f = TextIOWrapper(f, coding, line_buffering=True) - return [l.decode(coding) for l in lines] + f.readlines() - except (LookupError, SyntaxError, UnicodeError): - f.close() - # Fall back if files are improperly declared - f = open(filename, encoding='latin-1') - return f.readlines() - finally: - f.close() - isidentifier = str.isidentifier - - def stdin_get_value(): - return TextIOWrapper(sys.stdin.buffer, errors='ignore').read() -readlines.__doc__ = " Read the source code." -noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search - - -def expand_indent(line): - r""" - 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 - """ - if '\t' not in line: - return len(line) - len(line.lstrip()) - 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'" - """ - # String modifiers (e.g. u or r) - start = text.index(text[-1]) + 1 - end = len(text) - 1 - # Triple quotes - if text[-3:] in ('"""', "'''"): - start += 2 - end -= 2 - return text[:start] + 'x' * (end - start) + text[end:] - - -def parse_udiff(diff, patterns=None, parent='.'): - """Return a dictionary of matching lines.""" - # For each file of the diff, the entry key is the filename, - # and the value is a set of row numbers to consider. - rv = {} - path = nrows = None - for line in diff.splitlines(): - if nrows: - if line[:1] != '-': - nrows -= 1 - continue - if line[:3] == '@@ ': - hunk_match = HUNK_REGEX.match(line) - row, nrows = [int(g or '1') for g in hunk_match.groups()] - rv[path].update(range(row, row + nrows)) - elif line[:3] == '+++': - path = line[4:].split('\t', 1)[0] - if path[:2] == 'b/': - path = path[2:] - rv[path] = set() - return dict([(os.path.join(parent, path), rows) - for (path, rows) in rv.items() - if rows and filename_match(path, patterns)]) - - -def filename_match(filename, patterns, default=True): - """ - Check if patterns contains a pattern that matches filename. - If patterns is unspecified, this always returns True. - """ - if not patterns: - return default - return any(fnmatch(filename, pattern) for pattern in patterns) - - -############################################################################## -# Framework to run all checks -############################################################################## - - -_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} - - -def register_check(check, codes=None): - """ - Register a new check object. - """ - def _add_check(check, kind, codes, args): - if check in _checks[kind]: - _checks[kind][check][0].extend(codes or []) - else: - _checks[kind][check] = (codes or [''], args) - if inspect.isfunction(check): - args = inspect.getargspec(check)[0] - if args and args[0] in ('physical_line', 'logical_line'): - if codes is None: - codes = ERRORCODE_REGEX.findall(check.__doc__ or '') - _add_check(check, args[0], codes, args) - elif inspect.isclass(check): - if inspect.getargspec(check.__init__)[0][:2] == ['self', 'tree']: - _add_check(check, 'tree', codes, None) - - -def init_checks_registry(): - """ - Register all globally visible functions where the first argument name - is 'physical_line' or 'logical_line'. - """ - mod = inspect.getmodule(register_check) - for (name, function) in inspect.getmembers(mod, inspect.isfunction): - register_check(function) -init_checks_registry() - - -class Checker(object): - """ - Load a Python source file, tokenize it, check coding style. - """ - - def __init__(self, filename=None, lines=None, - options=None, report=None, **kwargs): - if options is None: - options = StyleGuide(kwargs).options - else: - assert not kwargs - self._io_error = None - self._physical_checks = options.physical_checks - self._logical_checks = options.logical_checks - self._ast_checks = options.ast_checks - self.max_line_length = options.max_line_length - self.hang_closing = options.hang_closing - self.verbose = options.verbose - self.filename = filename - if filename is None: - self.filename = 'stdin' - self.lines = lines or [] - elif filename == '-': - self.filename = 'stdin' - self.lines = stdin_get_value().splitlines(True) - elif lines is None: - try: - self.lines = readlines(filename) - except IOError: - exc_type, exc = sys.exc_info()[:2] - self._io_error = '%s: %s' % (exc_type.__name__, exc) - self.lines = [] - else: - self.lines = lines - if self.lines: - ord0 = ord(self.lines[0][0]) - if ord0 in (0xef, 0xfeff): # Strip the UTF-8 BOM - if ord0 == 0xfeff: - self.lines[0] = self.lines[0][1:] - elif self.lines[0][:3] == '\xef\xbb\xbf': - self.lines[0] = self.lines[0][3:] - self.report = report or options.report - self.report_error = self.report.error - self.report_error_args = self.report.error_args - - # added for eric5 integration - self.options = options - - def report_invalid_syntax(self): - exc_type, exc = sys.exc_info()[:2] - if len(exc.args) > 1: - offset = exc.args[1] - if len(offset) > 2: - offset = offset[1:3] - else: - offset = (1, 0) - self.report_error_args(offset[0], offset[1] or 0, - 'E901', self.report_invalid_syntax, - exc_type.__name__, exc.args[0]) - report_invalid_syntax.__doc__ = " Check if the syntax is valid." - - 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 line[:1] in WHITESPACE: - self.indent_char = line[0] - for name, check, argument_names in self._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 = [] - comments = [] - length = 0 - previous = None - for token in self.tokens: - token_type, text = token[0:2] - if token_type == tokenize.COMMENT: - comments.append(text) - continue - if token_type in SKIP_TOKENS: - continue - if token_type == tokenize.STRING: - text = mute_string(text) - if previous: - end_row, end = previous[3] - start_row, start = token[2] - if end_row != start_row: # different row - prev_text = self.lines[end_row - 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_row - 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) - self.noqa = comments and noqa(''.join(comments)) - # With Python 2, if the line ends with '\r\r\n' the assertion fails - # assert self.logical_line.strip() == self.logical_line - - def check_logical(self): - """ - Build a line from tokens and run all logical checks on it. - """ - self.build_tokens_line() - self.report.increment_logical_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 self.verbose >= 2: - print(self.logical_line[:80].rstrip()) - for name, check, argument_names in self._logical_checks: - if self.verbose >= 4: - print(' ' + name) - for result in self.run_check(check, argument_names): - offset, code = result[:2] - args = result[2:] - if isinstance(offset, tuple): - orig_number, orig_offset = offset - else: - for token_offset, token in self.mapping: - if offset >= token_offset: - orig_number = token[2][0] - orig_offset = (token[2][1] + offset - token_offset) - self.report_error_args(orig_number, orig_offset, code, check, - *args) - self.previous_logical = self.logical_line - - def check_ast(self): - try: - tree = compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST) - except (SyntaxError, TypeError): - return self.report_invalid_syntax() - for name, cls, _ in self._ast_checks: - # extended API for eric5 integration - checker = cls(tree, self.filename, self.options) - for result in checker.run(): - lineno, offset, code, check = result[:4] - args = result[4:] - if not noqa(self.lines[lineno - 1]): - self.report_error_args(lineno, offset, code, check, *args) - - def generate_tokens(self): - if self._io_error: - self.report_error(1, 0, 'E902 %s' % self._io_error, readlines) - tokengen = tokenize.generate_tokens(self.readline_check_physical) - try: - for token in tokengen: - yield token - except (SyntaxError, tokenize.TokenError): - self.report_invalid_syntax() - - def check_all(self, expected=None, line_offset=0): - """ - Run all checks on the input file. - """ - self.report.init_file(self.filename, self.lines, expected, line_offset) - if self._ast_checks: - self.check_ast() - self.line_number = 0 - self.indent_char = None - self.indent_level = 0 - self.previous_logical = '' - self.tokens = [] - self.blank_lines = blank_lines_before_comment = 0 - parens = 0 - for token in self.generate_tokens(): - self.tokens.append(token) - token_type, text = token[0:2] - if self.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]], text)) - if token_type == tokenize.OP: - if text in '([{': - parens += 1 - elif text in '}])': - parens -= 1 - elif not parens: - if token_type == tokenize.NEWLINE: - if self.blank_lines < blank_lines_before_comment: - self.blank_lines = blank_lines_before_comment - self.check_logical() - self.tokens = [] - self.blank_lines = blank_lines_before_comment = 0 - elif token_type == tokenize.NL: - if len(self.tokens) == 1: - # The physical line contains only this token. - self.blank_lines += 1 - self.tokens = [] - elif token_type == tokenize.COMMENT and len(self.tokens) == 1: - if blank_lines_before_comment < self.blank_lines: - blank_lines_before_comment = self.blank_lines - self.blank_lines = 0 - if COMMENT_WITH_NL: - # The comment also ends a physical line - self.tokens = [] - return self.report.get_file_results() - - -class BaseReport(object): - """Collect the results of the checks.""" - print_filename = False - - def __init__(self, options): - self._benchmark_keys = options.benchmark_keys - self._ignore_code = options.ignore_code - # Results - self.elapsed = 0 - self.total_errors = 0 - self.counters = dict.fromkeys(self._benchmark_keys, 0) - self.messages = {} - - def start(self): - """Start the timer.""" - self._start_time = time.time() - - def stop(self): - """Stop the timer.""" - self.elapsed = time.time() - self._start_time - - def init_file(self, filename, lines, expected, line_offset): - """Signal a new file.""" - self.filename = filename - self.lines = lines - self.expected = expected or () - self.line_offset = line_offset - self.file_errors = 0 - self.counters['files'] += 1 - self.counters['physical lines'] += len(lines) - - def increment_logical_line(self): - """Signal a new logical line.""" - self.counters['logical lines'] += 1 - - def error(self, line_number, offset, text, check): - """Report an error, according to options.""" - code = text[:4] - if self._ignore_code(code): - return - if code in self.counters: - self.counters[code] += 1 - else: - self.counters[code] = 1 - self.messages[code] = text[5:] - # Don't care about expected errors or warnings - if code in self.expected: - return - if self.print_filename and not self.file_errors: - print(self.filename) - self.file_errors += 1 - self.total_errors += 1 - return code - - def error_args(self, line_number, offset, code, check, *args): - """Report an error, according to options.""" - if self._ignore_code(code): - return - if code in self.counters: - self.counters[code] += 1 - else: - self.counters[code] = 1 - # Don't care about expected errors or warnings - if code in self.expected: - return - if self.print_filename and not self.file_errors: - print(self.filename) - self.file_errors += 1 - self.total_errors += 1 - return code - - def get_file_results(self): - """Return the count of errors and warnings for this file.""" - return self.file_errors - - def get_count(self, prefix=''): - """Return the total count of errors and warnings.""" - return sum([self.counters[key] - for key in self.messages if key.startswith(prefix)]) - - def get_statistics(self, 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 - """ - return ['%-7s %s %s' % (self.counters[key], key, self.messages[key]) - for key in sorted(self.messages) if key.startswith(prefix)] - - def print_statistics(self, prefix=''): - """Print overall statistics (number of errors and warnings).""" - for line in self.get_statistics(prefix): - print(line) - - def print_benchmark(self): - """Print benchmark numbers.""" - print('%-7.2f %s' % (self.elapsed, 'seconds elapsed')) - if self.elapsed: - for key in self._benchmark_keys: - print('%-7d %s per second (%d total)' % - (self.counters[key] / self.elapsed, key, - self.counters[key])) - - -class FileReport(BaseReport): - """Collect the results of the checks and print only the filenames.""" - print_filename = True - - -class StandardReport(BaseReport): - """Collect and print the results of the checks.""" - - def __init__(self, options): - super(StandardReport, self).__init__(options) - self._fmt = REPORT_FORMAT.get(options.format.lower(), - options.format) - self._repeat = options.repeat - self._show_source = options.show_source - self._show_pep8 = options.show_pep8 - - def init_file(self, filename, lines, expected, line_offset): - """Signal a new file.""" - self._deferred_print = [] - return super(StandardReport, self).init_file( - filename, lines, expected, line_offset) - - def error(self, line_number, offset, text, check): - """Report an error, according to options.""" - code = super(StandardReport, self).error(line_number, offset, - text, check) - if code and (self.counters[code] == 1 or self._repeat): - self._deferred_print.append( - (line_number, offset, code, text[5:], check.__doc__)) - return code - - def error_args(self, line_number, offset, code, check, *args): - """Report an error, according to options.""" - code = super(StandardReport, self).error_args(line_number, offset, - code, check, *args) - if code and (self.counters[code] == 1 or self._repeat): - self._deferred_print.append( - (line_number, offset, code, "", check.__doc__)) - return code - - def get_file_results(self): - """Print the result and return the overall count for this file.""" - self._deferred_print.sort() - for line_number, offset, code, text, doc in self._deferred_print: - print(self._fmt % { - 'path': self.filename, - 'row': self.line_offset + line_number, 'col': offset + 1, - 'code': code, 'text': text, - }) - if self._show_source: - if line_number > len(self.lines): - line = '' - else: - line = self.lines[line_number - 1] - print(line.rstrip()) - print(' ' * offset + '^') - if self._show_pep8 and doc: - print(doc.lstrip('\n').rstrip()) - return self.file_errors - - -class DiffReport(StandardReport): - """Collect and print the results for the changed lines only.""" - - def __init__(self, options): - super(DiffReport, self).__init__(options) - self._selected = options.selected_lines - - def error(self, line_number, offset, text, check): - if line_number not in self._selected[self.filename]: - return - return super(DiffReport, self).error(line_number, offset, text, check) - - -class StyleGuide(object): - """Initialize a PEP-8 instance with few options.""" - - def __init__(self, *args, **kwargs): - # build options from the command line - self.checker_class = kwargs.pop('checker_class', Checker) - parse_argv = kwargs.pop('parse_argv', False) - config_file = kwargs.pop('config_file', None) - parser = kwargs.pop('parser', None) - options, self.paths = process_options( - parse_argv=parse_argv, config_file=config_file, parser=parser) - if args or kwargs: - # build options from dict - options_dict = dict(*args, **kwargs) - options.__dict__.update(options_dict) - if 'paths' in options_dict: - self.paths = options_dict['paths'] - - self.runner = self.input_file - self.options = options - - if not options.reporter: - options.reporter = BaseReport if options.quiet else StandardReport - - for index, value in enumerate(options.exclude): - options.exclude[index] = value.rstrip('/') - options.select = tuple(options.select or ()) - if not (options.select or options.ignore or - options.testsuite or options.doctest) and DEFAULT_IGNORE: - # The default choice: ignore controversial checks - options.ignore = tuple(DEFAULT_IGNORE.split(',')) - else: - # Ignore all checks which are not explicitly selected - options.ignore = ('',) if options.select else tuple(options.ignore) - options.benchmark_keys = BENCHMARK_KEYS[:] - options.ignore_code = self.ignore_code - options.physical_checks = self.get_checks('physical_line') - options.logical_checks = self.get_checks('logical_line') - options.ast_checks = self.get_checks('tree') - self.init_report() - - def init_report(self, reporter=None): - """Initialize the report instance.""" - self.options.report = (reporter or self.options.reporter)(self.options) - return self.options.report - - def check_files(self, paths=None): - """Run all checks on the paths.""" - if paths is None: - paths = self.paths - report = self.options.report - runner = self.runner - report.start() - try: - for path in paths: - if os.path.isdir(path): - self.input_dir(path) - elif not self.excluded(path): - runner(path) - except KeyboardInterrupt: - print('... stopped') - report.stop() - return report - - def input_file(self, filename, lines=None, expected=None, line_offset=0): - """Run all checks on a Python source file.""" - if self.options.verbose: - print('checking %s' % filename) - fchecker = self.checker_class( - filename, lines=lines, options=self.options) - return fchecker.check_all(expected=expected, line_offset=line_offset) - - def input_dir(self, dirname): - """Check all files in this directory and all subdirectories.""" - dirname = dirname.rstrip('/') - if self.excluded(dirname): - return 0 - counters = self.options.report.counters - verbose = self.options.verbose - filepatterns = self.options.filename - runner = self.runner - for root, dirs, files in os.walk(dirname): - if verbose: - print('directory ' + root) - counters['directories'] += 1 - for subdir in sorted(dirs): - if self.excluded(subdir, root): - dirs.remove(subdir) - for filename in sorted(files): - # contain a pattern that matches? - if ((filename_match(filename, filepatterns) and - not self.excluded(filename, root))): - runner(os.path.join(root, filename)) - - def excluded(self, filename, parent=None): - """ - Check if options.exclude contains a pattern that matches filename. - """ - if not self.options.exclude: - return False - basename = os.path.basename(filename) - if filename_match(basename, self.options.exclude): - return True - if parent: - filename = os.path.join(parent, filename) - return filename_match(filename, self.options.exclude) - - def ignore_code(self, code): - """ - Check if the error code should be ignored. - - If 'options.select' contains a prefix of the error code, - return False. Else, if 'options.ignore' contains a prefix of - the error code, return True. - """ - return (code.startswith(self.options.ignore) and - not code.startswith(self.options.select)) - - def get_checks(self, argument_name): - """ - Find all globally visible functions where the first argument name - starts with argument_name and which contain selected tests. - """ - checks = [] - for check, attrs in _checks[argument_name].items(): - (codes, args) = attrs - if any(not (code and self.ignore_code(code)) for code in codes): - checks.append((check.__name__, check, args)) - return sorted(checks) - - -def get_parser(prog='pep8', version=__version__): - parser = OptionParser(prog=prog, version=version, - usage="%prog [options] input ...") - parser.config_options = [ - 'exclude', 'filename', 'select', 'ignore', 'max-line-length', - 'hang-closing', 'count', 'format', 'quiet', 'show-pep8', - 'show-source', 'statistics', 'verbose'] - 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', default=True, action='store_true', - help="(obsolete) show all occurrences of the same error") - parser.add_option('--first', action='store_false', dest='repeat', - help="show first occurrence of each error") - parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE, - help="exclude files or directories which match these " - "comma separated patterns (default: %default)") - parser.add_option('--filename', metavar='patterns', default='*.py', - help="when parsing directories, only check filenames " - "matching these comma separated patterns " - "(default: %default)") - 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 " - "(implies --first)") - 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('--max-line-length', type='int', metavar='n', - default=MAX_LINE_LENGTH, - help="set maximum allowed line length " - "(default: %default)") - parser.add_option('--hang-closing', action='store_true', - help="hang closing bracket instead of matching " - "indentation of opening bracket's line") - parser.add_option('--format', metavar='format', default='default', - help="set the error format [default|pylint|<custom>]") - parser.add_option('--diff', action='store_true', - help="report only lines changed according to the " - "unified diff received on STDIN") - group = parser.add_option_group("Testing Options") - if os.path.exists(TESTSUITE_PATH): - group.add_option('--testsuite', metavar='dir', - help="run regression tests from dir") - group.add_option('--doctest', action='store_true', - help="run doctest on myself") - group.add_option('--benchmark', action='store_true', - help="measure processing speed") - return parser - - -def read_config(options, args, arglist, parser): - """Read both user configuration and local configuration.""" - config = RawConfigParser() - - user_conf = options.config - if user_conf and os.path.isfile(user_conf): - if options.verbose: - print('user configuration: %s' % user_conf) - config.read(user_conf) - - parent = tail = args and os.path.abspath(os.path.commonprefix(args)) - while tail: - if config.read([os.path.join(parent, fn) for fn in PROJECT_CONFIG]): - if options.verbose: - print('local configuration: in %s' % parent) - break - parent, tail = os.path.split(parent) - - pep8_section = parser.prog - if config.has_section(pep8_section): - option_list = dict([(o.dest, o.type or o.action) - for o in parser.option_list]) - - # First, read the default values - new_options, _ = parser.parse_args([]) - - # Second, parse the configuration - for opt in config.options(pep8_section): - if options.verbose > 1: - print(" %s = %s" % (opt, config.get(pep8_section, opt))) - if opt.replace('_', '-') not in parser.config_options: - print("Unknown option: '%s'\n not in [%s]" % - (opt, ' '.join(parser.config_options))) - sys.exit(1) - normalized_opt = opt.replace('-', '_') - opt_type = option_list[normalized_opt] - if opt_type in ('int', 'count'): - value = config.getint(pep8_section, opt) - elif opt_type == 'string': - value = config.get(pep8_section, opt) - else: - assert opt_type in ('store_true', 'store_false') - value = config.getboolean(pep8_section, opt) - setattr(new_options, normalized_opt, value) - - # Third, overwrite with the command-line options - options, _ = parser.parse_args(arglist, values=new_options) - options.doctest = options.testsuite = False - return options - - -def process_options(arglist=None, parse_argv=False, config_file=None, - parser=None): - """Process options passed either via arglist or via command line args.""" - if not arglist and not parse_argv: - # Don't read the command line if the module is used as a library. - arglist = [] - if not parser: - parser = get_parser() - if not parser.has_option('--config'): - if config_file is True: - config_file = DEFAULT_CONFIG - group = parser.add_option_group("Configuration", description=( - "The project options are read from the [%s] section of the " - "tox.ini file or the setup.cfg file located in any parent folder " - "of the path(s) being processed. Allowed options are: %s." % - (parser.prog, ', '.join(parser.config_options)))) - group.add_option('--config', metavar='path', default=config_file, - help="user config file location (default: %default)") - options, args = parser.parse_args(arglist) - options.reporter = None - - if options.ensure_value('testsuite', False): - args.append(options.testsuite) - elif not options.ensure_value('doctest', False): - if parse_argv and not args: - if options.diff or any(os.path.exists(name) - for name in PROJECT_CONFIG): - args = ['.'] - else: - parser.error('input not specified') - options = read_config(options, args, arglist, parser) - options.reporter = parse_argv and options.quiet == 1 and FileReport - - options.filename = options.filename and options.filename.split(',') - options.exclude = options.exclude.split(',') - options.select = options.select and options.select.split(',') - options.ignore = options.ignore and options.ignore.split(',') - - if options.diff: - options.reporter = DiffReport - stdin = stdin_get_value() - options.selected_lines = parse_udiff(stdin, options.filename, args[0]) - args = sorted(options.selected_lines) - - return options, args - - -def _main(): - """Parse options and run checks on Python source.""" - pep8style = StyleGuide(parse_argv=True, config_file=True) - options = pep8style.options - if options.doctest or options.testsuite: - from testsuite.support import run_tests - report = run_tests(pep8style) - else: - report = pep8style.check_files() - if options.statistics: - report.print_statistics() - if options.benchmark: - report.print_benchmark() - if options.testsuite and not options.quiet: - report.print_results() - if report.total_errors: - if options.count: - sys.stderr.write(str(report.total_errors) + '\n') - sys.exit(1) - -if __name__ == '__main__': - _main() - -# -# eflag: FileType = Python2
--- a/ViewManager/ViewManager.py Sun Jan 05 23:22:17 2014 +0100 +++ b/ViewManager/ViewManager.py Sun Mar 30 22:00:14 2014 +0200 @@ -6263,7 +6263,7 @@ else: self.autoCompleteFromAPIsAct.setEnabled(False) - if editor.isPy3File() or editor.isPy2File() or editor.isRubyFile(): + if editor.getPyVersion() or editor.isRubyFile(): self.gotoPreviousDefAct.setEnabled(True) self.gotoNextDefAct.setEnabled(True) else:
--- a/eric5.e4p Sun Jan 05 23:22:17 2014 +0100 +++ b/eric5.e4p Sun Mar 30 22:00:14 2014 +0200 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Project SYSTEM "Project-5.1.dtd"> <!-- eric5 project file for project eric5 --> +<!-- Saved: 2014-03-20, 21:27:03 --> +<!-- Copyright (C) 2014 Detlev Offenbach, detlev@die-offenbachs.de --> <Project version="5.1"> <Language>en_US</Language> <ProjectWordList>Dictionaries/words.dic</ProjectWordList> @@ -704,9 +706,6 @@ <Source>E5Gui/E5ToolBox.py</Source> <Source>E5Gui/E5TreeSortFilterProxyModel.py</Source> <Source>E5Gui/E5TreeView.py</Source> - <Source>Utilities/py3flakes/__init__.py</Source> - <Source>Utilities/py3flakes/checker.py</Source> - <Source>Utilities/py3flakes/messages.py</Source> <Source>Preferences/ConfigurationPages/EditorKeywordsPage.py</Source> <Source>Cooperation/__init__.py</Source> <Source>Cooperation/Connection.py</Source> @@ -1051,10 +1050,6 @@ <Source>QScintilla/SortOptionsDialog.py</Source> <Source>Debugger/CallStackViewer.py</Source> <Source>Utilities/compatibility_fixes.py</Source> - <Source>Utilities/SyntaxCheck.py</Source> - <Source>Utilities/py2flakes/checker.py</Source> - <Source>Utilities/py2flakes/messages.py</Source> - <Source>Utilities/py2flakes/__init__.py</Source> <Source>Examples/hallo.py</Source> <Source>Examples/modpython.py</Source> <Source>Examples/modpython_dbg.py</Source> @@ -1100,17 +1095,19 @@ <Source>Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py</Source> <Source>Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py</Source> <Source>Plugins/PluginCodeStyleChecker.py</Source> - <Source>UtilitiesPython2/CodeStyleChecker.py</Source> - <Source>UtilitiesPython2/DocStyleCheckerPy2.py</Source> - <Source>UtilitiesPython2/NamingStyleCheckerPy2.py</Source> <Source>Helpviewer/Bookmarks/DefaultBookmarks_rc.py</Source> <Source>Helpviewer/OpenSearch/DefaultSearchEngines/__init__.py</Source> <Source>Helpviewer/OpenSearch/DefaultSearchEngines/DefaultSearchEngines_rc.py</Source> <Source>Helpviewer/UserAgent/UserAgentDefaults_rc.py</Source> <Source>E5Gui/E5ProgressDialog.py</Source> - <Source>UtilitiesPython2/pep8.py</Source> - <Source>UtilitiesPython2/__init__.py</Source> - <Source>UtilitiesPython2/Tools.py</Source> + <Source>Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py</Source> + <Source>Utilities/BackgroundClient.py</Source> + <Source>Utilities/BackgroundService.py</Source> + <Source>Plugins/CheckerPlugins/SyntaxChecker/pyflakes/checker.py</Source> + <Source>Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py</Source> + <Source>Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py</Source> + <Source>Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckService.py</Source> + <Source>Plugins/CheckerPlugins/CodeStyleChecker/translations.py</Source> </Sources> <Forms> <Form>PyUnit/UnittestDialog.ui</Form> @@ -1923,7 +1920,7 @@ <string>ExcludeFiles</string> </key> <value> - <string>*/ThirdParty/*, */coverage/*, */Ui_*.py, */Examples/*, */*_rc.py,*/pep8.py,*/py[23]flakes/checker.py</string> + <string>*/ThirdParty/*, */coverage/*, */Ui_*.py, */Examples/*, */*_rc.py,*/pep8.py,*/pyflakes/checker.py</string> </value> <key> <string>ExcludeMessages</string>
--- a/eric5.py Sun Jan 05 23:22:17 2014 +0100 +++ b/eric5.py Sun Mar 30 22:00:14 2014 +0200 @@ -14,14 +14,15 @@ from __future__ import unicode_literals try: # Only for Py2 + import StringIO as io # __IGNORE_EXCEPTION__ import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) sip.setapi('QTextStream', 2) - import StringIO as io import Utilities.compatibility_fixes # __IGNORE_WARNING__ -except (ImportError): +except ImportError: import io # __IGNORE_WARNING__ + basestring = str import sys import os @@ -100,6 +101,7 @@ @param excValue exception value @param tracebackobj traceback object """ + import xml.sax.saxutils from UI.Info import BugAddress import Utilities import Globals @@ -122,10 +124,13 @@ if distroInfo: versionInfo += "{0}\n{1}".format(separator, distroInfo) - tbinfofile = io.StringIO() - traceback.print_tb(tracebackobj, None, tbinfofile) - tbinfofile.seek(0) - tbinfo = tbinfofile.read() + if isinstance(excType, basestring): + tbinfo = tracebackobj + else: + tbinfofile = io.StringIO() + traceback.print_tb(tracebackobj, None, tbinfofile) + tbinfofile.seek(0) + tbinfo = tbinfofile.read() errmsg = '{0}: \n{1}'.format(str(excType), str(excValue)) sections = [separator, timeString, separator, errmsg, separator, tbinfo] msg = '\n'.join(sections) @@ -136,7 +141,11 @@ f.close() except IOError: pass - qWarning(str(notice) + str(msg) + str(versionInfo)) + + warning = str(notice) + str(msg) + str(versionInfo) + # Escape &<> otherwise it's not visible in the error dialog + warning = xml.sax.saxutils.escape(warning) + qWarning(warning) def uiStartUp():