Fri, 30 May 2014 15:16:40 +0200
Fixed a few source code style issues found by the updated pe8 checker.
--- a/DebugClients/Python/DebugClientBase.py Fri May 30 13:17:20 2014 +0200 +++ b/DebugClients/Python/DebugClientBase.py Fri May 30 15:16:40 2014 +0200 @@ -2075,7 +2075,7 @@ except: remoteAddress = None sys.argv = [''] - if not '' in sys.path: + if '' not in sys.path: sys.path.insert(0, '') if port >= 0: if not self.noencoding:
--- a/DebugClients/Python/FlexCompleter.py Fri May 30 13:17:20 2014 +0200 +++ b/DebugClients/Python/FlexCompleter.py Fri May 30 15:16:40 2014 +0200 @@ -179,7 +179,7 @@ for word in list: if word[:n] == text and \ word != "__builtins__" and \ - not word in matches: + word not in matches: matches.append(word) return matches @@ -223,7 +223,7 @@ try: if word[:n] == attr and word != "__builtins__": match = "%s.%s" % (expr, word) - if not match in matches: + if match not in matches: matches.append(match) except: # some badly behaved objects pollute dir() with non-strings,
--- a/DebugClients/Python/eric5dbgstub.py Fri May 30 13:17:20 2014 +0200 +++ b/DebugClients/Python/eric5dbgstub.py Fri May 30 15:16:40 2014 +0200 @@ -19,7 +19,7 @@ modDir = distutils.sysconfig.get_python_lib(True) ericpath = os.getenv('ERICDIR', getConfig('ericDir')) -if not ericpath in sys.path: +if ericpath not in sys.path: sys.path.insert(-1, ericpath)
--- a/DebugClients/Python3/DebugClientBase.py Fri May 30 13:17:20 2014 +0200 +++ b/DebugClients/Python3/DebugClientBase.py Fri May 30 15:16:40 2014 +0200 @@ -1450,7 +1450,7 @@ exec('mcdict = dict{0!s}.__class__.__dict__' .format(access), globals(), loc) ndict.update(loc["mcdict"]) - if mdict and not "sipThis" in mdict.keys(): + if mdict and "sipThis" not in mdict.keys(): del rvar[0:2] access = "" except: @@ -2134,7 +2134,7 @@ except: remoteAddress = None sys.argv = [''] - if not '' in sys.path: + if '' not in sys.path: sys.path.insert(0, '') if port >= 0: if not self.noencoding:
--- a/DebugClients/Python3/eric5dbgstub.py Fri May 30 13:17:20 2014 +0200 +++ b/DebugClients/Python3/eric5dbgstub.py Fri May 30 15:16:40 2014 +0200 @@ -19,7 +19,7 @@ modDir = distutils.sysconfig.get_python_lib(True) ericpath = os.getenv('ERICDIR', getConfig('ericDir')) -if not ericpath in sys.path: +if ericpath not in sys.path: sys.path.insert(-1, ericpath)
--- a/Debugger/VariablesViewer.py Fri May 30 13:17:20 2014 +0200 +++ b/Debugger/VariablesViewer.py Fri May 30 15:16:40 2014 +0200 @@ -291,8 +291,9 @@ self.indicators = {'list': '[]', 'tuple': '()', 'dict': '{}', # Python types - 'Array': '[]', 'Hash': '{}'} + 'Array': '[]', 'Hash': '{}' # Ruby types + } self.rx_class = QRegExp('<.*(instance|object) at 0x.*>') self.rx_class2 = QRegExp('class .*')
--- a/Documentation/Help/source.qhp Fri May 30 13:17:20 2014 +0200 +++ b/Documentation/Help/source.qhp Fri May 30 15:16:40 2014 +0200 @@ -986,13 +986,13 @@ <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.MimeTypes" ref="eric5.Utilities.MimeTypes.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.__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.mimetypes" ref="eric5.Utilities.mimetypes.html" /> <section title="eric5.Utilities.uic" ref="eric5.Utilities.uic.html" /> </section> <section title="eric5.VCS" ref="index-eric5.VCS.html"> @@ -1972,8 +1972,8 @@ <keyword name="Checker.check_logical" id="Checker.check_logical" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.generate_tokens" id="Checker.generate_tokens" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.generate_tokens" /> + <keyword name="Checker.maybe_check_physical" id="Checker.maybe_check_physical" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.maybe_check_physical" /> <keyword name="Checker.readline" id="Checker.readline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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.report_invalid_syntax" id="Checker.report_invalid_syntax" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.report_invalid_syntax" /> <keyword name="Checker.run_check" id="Checker.run_check" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#Checker.run_check" /> <keyword name="CheckerPlugins (Package)" id="CheckerPlugins (Package)" ref="index-eric5.Plugins.CheckerPlugins.html" /> @@ -7677,6 +7677,7 @@ <keyword name="MessageBoxWizardDialog.on_buttonBox_clicked" id="MessageBoxWizardDialog.on_buttonBox_clicked" ref="eric5.Plugins.WizardPlugins.MessageBoxWizard.MessageBoxWizardDialog.html#MessageBoxWizardDialog.on_buttonBox_clicked" /> <keyword name="MessageBoxWizardDialog.on_rAboutQt_toggled" id="MessageBoxWizardDialog.on_rAboutQt_toggled" ref="eric5.Plugins.WizardPlugins.MessageBoxWizard.MessageBoxWizardDialog.html#MessageBoxWizardDialog.on_rAboutQt_toggled" /> <keyword name="MessageBoxWizardDialog.on_rAbout_toggled" id="MessageBoxWizardDialog.on_rAbout_toggled" ref="eric5.Plugins.WizardPlugins.MessageBoxWizard.MessageBoxWizardDialog.html#MessageBoxWizardDialog.on_rAbout_toggled" /> + <keyword name="MimeTypes (Module)" id="MimeTypes (Module)" ref="eric5.Utilities.MimeTypes.html" /> <keyword name="MiniEditor" id="MiniEditor" ref="eric5.QScintilla.MiniEditor.html#MiniEditor" /> <keyword name="MiniEditor (Constructor)" id="MiniEditor (Constructor)" ref="eric5.QScintilla.MiniEditor.html#MiniEditor.__init__" /> <keyword name="MiniEditor (Module)" id="MiniEditor (Module)" ref="eric5.QScintilla.MiniEditor.html" /> @@ -12855,6 +12856,8 @@ <keyword name="_encode_base64" id="_encode_base64" ref="eric5.UI.EmailDialog.html#_encode_base64" /> <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="_is_eol_token" id="_is_eol_token" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#_is_eol_token" /> + <keyword name="_is_eol_token_1" id="_is_eol_token_1" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#_is_eol_token_1" /> <keyword name="_main" id="_main" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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" /> @@ -12876,6 +12879,7 @@ <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_negative" id="comparison_negative" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#comparison_negative" /> <keyword name="comparison_to_singleton" id="comparison_to_singleton" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#comparison_to_singleton" /> <keyword name="comparison_type" id="comparison_type" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#comparison_type" /> <keyword name="compatibility_fixes (Module)" id="compatibility_fixes (Module)" ref="eric5.Utilities.compatibility_fixes.html" /> @@ -13233,7 +13237,7 @@ <keyword name="isExecutable" id="isExecutable" ref="eric5.Utilities.__init__.html#isExecutable" /> <keyword name="isLinuxPlatform" id="isLinuxPlatform" ref="eric5.Globals.__init__.html#isLinuxPlatform" /> <keyword name="isMacPlatform" id="isMacPlatform" ref="eric5.Globals.__init__.html#isMacPlatform" /> - <keyword name="isTextFile" id="isTextFile" ref="eric5.Utilities.mimetypes.html#isTextFile" /> + <keyword name="isTextFile" id="isTextFile" ref="eric5.Utilities.MimeTypes.html#isTextFile" /> <keyword name="isWindowsPlatform" id="isWindowsPlatform" ref="eric5.Globals.__init__.html#isWindowsPlatform" /> <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" /> @@ -13280,8 +13284,6 @@ <keyword name="maximum_line_length" id="maximum_line_length" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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="mimetypes (Module)" id="mimetypes (Module)" ref="eric5.Utilities.mimetypes.html" /> - <keyword name="missing_newline" id="missing_newline" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#missing_newline" /> <keyword name="missing_whitespace" id="missing_whitespace" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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="mute_string" id="mute_string" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#mute_string" /> @@ -13289,6 +13291,7 @@ <keyword name="normabspath" id="normabspath" ref="eric5.Utilities.__init__.html#normabspath" /> <keyword name="normalizeCode" id="normalizeCode" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#normalizeCode" /> <keyword name="normalizeCode" id="normalizeCode" ref="eric5.Plugins.CheckerPlugins.SyntaxChecker.jsCheckSyntax.html#normalizeCode" /> + <keyword name="normalize_paths" id="normalize_paths" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#normalize_paths" /> <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" /> @@ -13486,7 +13489,7 @@ <keyword name="whitespace_around_keywords" id="whitespace_around_keywords" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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_operator" id="whitespace_around_operator" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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_comment" id="whitespace_before_comment" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#whitespace_before_comment" /> <keyword name="whitespace_before_parameters" id="whitespace_before_parameters" ref="eric5.Plugins.CheckerPlugins.CodeStyleChecker.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" /> @@ -14273,6 +14276,7 @@ <file>eric5.Utilities.ClassBrowsers.pyclbr.html</file> <file>eric5.Utilities.ClassBrowsers.rbclbr.html</file> <file>eric5.Utilities.FtpUtilities.html</file> + <file>eric5.Utilities.MimeTypes.html</file> <file>eric5.Utilities.ModuleParser.html</file> <file>eric5.Utilities.PasswordChecker.html</file> <file>eric5.Utilities.PySideImporter.html</file>
--- a/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html Fri May 30 13:17:20 2014 +0200 +++ b/Documentation/Source/eric5.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html Fri May 30 15:16:40 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>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>ARITHMETIC_OP</td></tr><tr><td>BENCHMARK_KEYS</td></tr><tr><td>COMMENT_WITH_NL</td></tr><tr><td>COMPARE_NEGATIVE_REGEX</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>NEWLINE</td></tr><tr><td>OPERATOR_REGEX</td></tr><tr><td>PROJECT_CONFIG</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_COMMENTS</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> @@ -53,23 +53,32 @@ <td><a href="#_add_check">_add_check</a></td> <td></td> </tr><tr> +<td><a href="#_is_eol_token">_is_eol_token</a></td> +<td></td> +</tr><tr> +<td><a href="#_is_eol_token_1">_is_eol_token</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_negative">comparison_negative</a></td> +<td>Negative comparison should be done using "not in" and "is not".</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> +<td>Comparison to singletons should use "is" or "is not".</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> +<td>Object type comparisons should always use isinstance().</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> +<td>Compound 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> +<td>Continuation lines indentation.</td> </tr><tr> <td><a href="#expand_indent">expand_indent</a></td> <td>Return the amount of indentation.</td> @@ -78,7 +87,7 @@ <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> +<td>Avoid extraneous whitespace.</td> </tr><tr> <td><a href="#filename_match">filename_match</a></td> <td>Check if patterns contains a pattern that matches filename.</td> @@ -93,23 +102,23 @@ <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> +<td>Register all globally visible functions.</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> +<td>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> +<td>Surround operators with a single space on either side.</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="#normalize_paths">normalize_paths</a></td> +<td>Parse a comma-separated list of paths.</td> +</tr><tr> <td><a href="#parse_udiff">parse_udiff</a></td> <td>Return a dictionary of matching lines.</td> </tr><tr> @@ -117,25 +126,25 @@ <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> +<td>Backticks are removed in Python 3: use repr() instead.</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> +<td>The {}.has_key() method is removed in Python 3: use the 'in' operator.</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> +<td>New code should always use != instead of <>.</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> +<td>When raising an exception, use "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> +<td>Read the source code.</td> </tr><tr> <td><a href="#readlines_1">readlines</a></td> -<td></td> +<td>Read the source code.</td> </tr><tr> <td><a href="#register_check">register_check</a></td> <td>Register a new check object.</td> @@ -150,28 +159,28 @@ <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> +<td>Trailing blank lines are superfluous.</td> </tr><tr> <td><a href="#trailing_whitespace">trailing_whitespace</a></td> -<td>JCR: Trailing whitespace is superfluous.</td> +<td>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> +<td>Avoid extraneous whitespace after a comma or a colon.</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> +<td>Don't use spaces around the '=' sign in function arguments.</td> </tr><tr> <td><a href="#whitespace_around_operator">whitespace_around_operator</a></td> -<td>Avoid extraneous whitespace in the following situations:</td> +<td>Avoid extraneous whitespace around an operator.</td> </tr><tr> -<td><a href="#whitespace_before_inline_comment">whitespace_before_inline_comment</a></td> +<td><a href="#whitespace_before_comment">whitespace_before_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> +<td>Avoid extraneous whitespace.</td> </tr> </table> <hr /><hr /> @@ -244,7 +253,7 @@ 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>) +<b>error_args</b>(<i>line_number, offset, text, check, *args</i>) <p> Report an error, according to options. </p><a NAME="BaseReport.get_count" ID="BaseReport.get_count"></a> @@ -261,7 +270,7 @@ <h4>BaseReport.get_statistics</h4> <b>get_statistics</b>(<i>prefix=''</i>) <p> - Get statistics for message codes that start with the prefix. +Get statistics for message codes that start with the prefix. </p><p> prefix='' matches all errors and warnings prefix='E' matches all errors @@ -303,7 +312,7 @@ <a NAME="Checker" ID="Checker"></a> <h2>Checker</h2> <p> - Load a Python source file, tokenize it, check coding style. +Load a Python source file, tokenize it, check coding style. </p> <h3>Derived from</h3> object @@ -328,7 +337,7 @@ <td>Run all checks on the input file.</td> </tr><tr> <td><a href="#Checker.check_ast">check_ast</a></td> -<td></td> +<td>Build the file's AST and run all AST checks.</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> @@ -337,16 +346,16 @@ <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> +<td>Tokenize the file, run physical line checks and yield tokens.</td> +</tr><tr> +<td><a href="#Checker.maybe_check_physical">maybe_check_physical</a></td> +<td>If appropriate (based on token), check current physical line(s).</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> +<td>Check if the syntax is valid.</td> </tr><tr> <td><a href="#Checker.run_check">run_check</a></td> <td>Run a check plugin.</td> @@ -363,47 +372,52 @@ <h4>Checker.build_tokens_line</h4> <b>build_tokens_line</b>(<i></i>) <p> - Build a logical line from tokens. +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. +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> +<p> +Build the file's AST and run all AST checks. +</p><a NAME="Checker.check_logical" ID="Checker.check_logical"></a> <h4>Checker.check_logical</h4> <b>check_logical</b>(<i></i>) <p> - Build a line from tokens and run all logical checks on it. +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. +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> +<p> +Tokenize the file, run physical line checks and yield tokens. +</p><a NAME="Checker.maybe_check_physical" ID="Checker.maybe_check_physical"></a> +<h4>Checker.maybe_check_physical</h4> +<b>maybe_check_physical</b>(<i>token</i>) +<p> +If appropriate (based on token), check current physical line(s). +</p><a NAME="Checker.readline" ID="Checker.readline"></a> <h4>Checker.readline</h4> <b>readline</b>(<i></i>) <p> - Get the next line from the input buffer. -</p><a NAME="Checker.readline_check_physical" ID="Checker.readline_check_physical"></a> -<h4>Checker.readline_check_physical</h4> -<b>readline_check_physical</b>(<i></i>) -<p> - Check and return the next physical line. This method can be - used to feed tokenize.generate_tokens. +Get the next line from the input buffer. </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> +<p> +Check if the syntax is valid. +</p><a NAME="Checker.run_check" ID="Checker.run_check"></a> <h4>Checker.run_check</h4> <b>run_check</b>(<i>check, argument_names</i>) <p> - Run a check plugin. +Run a check plugin. </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> @@ -560,10 +574,10 @@ <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> +<td>Check if the file should be excluded.</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> +<td>Get all the checks for this category.</td> </tr><tr> <td><a href="#StyleGuide.ignore_code">ignore_code</a></td> <td>Check if the error code should be ignored.</td> @@ -594,18 +608,22 @@ <h4>StyleGuide.excluded</h4> <b>excluded</b>(<i>filename, parent=None</i>) <p> - Check if options.exclude contains a pattern that matches filename. +Check if the file should be excluded. +</p><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> +Get all the checks for this category. +</p><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. +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 @@ -634,6 +652,18 @@ <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="_is_eol_token" ID="_is_eol_token"></a> +<h2>_is_eol_token</h2> +<b>_is_eol_token</b>(<i>token</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="_is_eol_token_1" ID="_is_eol_token_1"></a> +<h2>_is_eol_token</h2> +<b>_is_eol_token</b>(<i>token</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>) @@ -644,9 +674,9 @@ <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>) +<b>blank_lines</b>(<i>logical_line, blank_lines, indent_level, line_number, blank_before, previous_logical, previous_indent_level</i>) <p> - Separate top-level function and class definitions with two blank lines. +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> @@ -667,10 +697,29 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="comparison_negative" ID="comparison_negative"></a> +<h2>comparison_negative</h2> +<b>comparison_negative</b>(<i>logical_line</i>) +<p> +Negative comparison should be done using "not in" and "is not". +</p><p> + Okay: if x not in y:\n pass + Okay: assert (X in Y or X is Z) + Okay: if not (X in Y):\n pass + Okay: zz = x is not y + E713: Z = not X in Y + E713: if not X.B in Y:\n pass + E714: if not X is Y:\n pass + E714: Z = not X.B is Y +</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> +Comparison to singletons should use "is" or "is not". +</p><p> Comparisons to singletons like None should always be done with "is" or "is not", never the equality operators. </p><p> @@ -689,8 +738,9 @@ <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. +Object type comparisons should always use isinstance(). +</p><p> + Do not compare types directly. </p><p> Okay: if isinstance(obj, int): E721: if type(obj) is type(1): @@ -708,12 +758,11 @@ <h2>compound_statements</h2> <b>compound_statements</b>(<i>logical_line</i>) <p> - Compound statements (multiple statements on the same line) are - generally discouraged. +Compound 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! + 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() @@ -736,16 +785,16 @@ <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>) +<b>continued_indentation</b>(<i>logical_line, tokens, indent_level, hang_closing, indent_char, 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. +Continuation lines indentation. </p><p> - When using a hanging indent the following considerations should be applied: + 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 these considerations should be applied: - 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> @@ -757,10 +806,12 @@ E122: a = (\n42) E123: a = (\n 42\n ) E124: a = (24,\n 42\n) - E125: if (a or\n b):\n pass + E125: if (\n b):\n pass E126: a = (\n 42) E127: a = (24,\n 42) E128: a = (24,\n 42) + E129: if (a or\n b):\n pass + E131: a = (\n 42\n 24) </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> @@ -768,15 +819,14 @@ <h2>expand_indent</h2> <b>expand_indent</b>(<i>line</i>) <p> - Return the amount of indentation. +Return the amount of indentation. +</p><p> 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') @@ -788,7 +838,7 @@ <h2>explicit_line_join</h2> <b>explicit_line_join</b>(<i>logical_line, tokens</i>) <p> - Avoid explicit line join between brackets. +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 @@ -808,10 +858,10 @@ <h2>extraneous_whitespace</h2> <b>extraneous_whitespace</b>(<i>logical_line</i>) <p> - Avoid extraneous whitespace in the following situations: +Avoid extraneous whitespace. </p><p> + Avoid extraneous whitespace in these situations: - Immediately inside parentheses, brackets or braces. -</p><p> - Immediately before a comma, semicolon, or colon. </p><p> Okay: spam(ham[1], {eggs: 2}) @@ -832,7 +882,8 @@ <h2>filename_match</h2> <b>filename_match</b>(<i>filename, patterns, default=True</i>) <p> - Check if patterns contains a pattern that matches filename. +Check if patterns contains a pattern that matches filename. +</p><p> If patterns is unspecified, this always returns True. </p> <div align="right"><a href="#top">Up</a></div> @@ -847,7 +898,7 @@ <h2>imports_on_separate_lines</h2> <b>imports_on_separate_lines</b>(<i>logical_line</i>) <p> - Imports should usually be on separate lines. +Imports should usually be on separate lines. </p><p> Okay: import os\nimport sys E401: import sys, os @@ -864,7 +915,7 @@ <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. +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. @@ -885,16 +936,17 @@ <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'. +Register all globally visible functions. +</p><p> + The first argument name is either '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>) +<b>maximum_line_length</b>(<i>physical_line, max_line_length, multiline</i>) <p> - Limit all lines to a maximum of 79 characters. +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 @@ -907,21 +959,11 @@ </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. +Each comma, semicolon or colon should be followed by whitespace. </p><p> Okay: [a, b] Okay: (3,) @@ -939,12 +981,15 @@ <h2>missing_whitespace_around_operator</h2> <b>missing_whitespace_around_operator</b>(<i>logical_line, tokens</i>) <p> +Surround operators with a single space on either side. +</p><p> - Always surround these binary operators with a single space on either side: assignment (=), augmented assignment (+=, -= etc.), - comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not), + comparisons (==, <, >, !=, <=, >=, in, not in, is, is not), Booleans (and, or, not). </p><p> - - Use spaces around arithmetic operators. + - If operators with different priorities are used, consider adding + whitespace around the operators with the lowest priorities. </p><p> Okay: i = i + 1 Okay: submitted += 1 @@ -969,7 +1014,7 @@ <h2>mute_string</h2> <b>mute_string</b>(<i>text</i>) <p> - Replace contents with 'xxx' to prevent syntax matching. +Replace contents with 'xxx' to prevent syntax matching. </p><p> >>> mute_string('"abc"') '"xxx"' @@ -980,6 +1025,16 @@ </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> +<a NAME="normalize_paths" ID="normalize_paths"></a> +<h2>normalize_paths</h2> +<b>normalize_paths</b>(<i>value, parent=os.curdir</i>) +<p> +Parse a comma-separated list of paths. +</p><p> + Return a list of absolute paths. +</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>) @@ -1000,8 +1055,7 @@ <h2>python_3000_backticks</h2> <b>python_3000_backticks</b>(<i>logical_line</i>) <p> - Backticks are removed in Python 3. - Use repr() instead. +Backticks are removed in Python 3: use repr() instead. </p><p> Okay: val = repr(1 + 2) W604: val = `1 + 2` @@ -1010,10 +1064,9 @@ <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>) +<b>python_3000_has_key</b>(<i>logical_line, noqa</i>) <p> - The {}.has_key() method is removed in the Python 3. - Use the 'in' operation instead. +The {}.has_key() method is removed in Python 3: use the 'in' operator. </p><p> Okay: if "alph" in d:\n print d["alph"] W601: assert d.has_key('alph') @@ -1024,8 +1077,8 @@ <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 !=. +New code should always use != instead of <>. +</p><p> The older syntax is removed in Python 3. </p><p> Okay: if a != 'no': @@ -1037,13 +1090,9 @@ <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'". +When raising an exception, use "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. + The older form is removed in Python 3. </p><p> Okay: raise DummyError("Message") W602: raise DummyError, "Message" @@ -1061,20 +1110,24 @@ <a NAME="readlines" ID="readlines"></a> <h2>readlines</h2> <b>readlines</b>(<i>filename</i>) - +<p> +Read the source code. +</p> <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>) - +<p> +Read the source code. +</p> <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. +Register a new check object. </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> @@ -1088,8 +1141,7 @@ <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. +For new projects, spaces-only are strongly recommended over tabs. </p><p> Okay: if True:\n return W191: if True:\n\treturn @@ -1100,7 +1152,7 @@ <h2>tabs_or_spaces</h2> <b>tabs_or_spaces</b>(<i>physical_line, indent_char</i>) <p> - Never mix tabs and spaces. +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 @@ -1116,12 +1168,14 @@ <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>) +<b>trailing_blank_lines</b>(<i>physical_line, lines, line_number, total_lines</i>) <p> - JCR: Trailing blank lines are superfluous. +Trailing blank lines are superfluous. </p><p> Okay: spam(1) W391: spam(1)\n +</p><p> + However the last line should end with a new line (warning W292). </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> @@ -1129,15 +1183,7 @@ <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 +Trailing whitespace is superfluous. </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. @@ -1152,12 +1198,8 @@ <h2>whitespace_around_comma</h2> <b>whitespace_around_comma</b>(<i>logical_line</i>) <p> - Avoid extraneous whitespace in the following situations: +Avoid extraneous whitespace after a comma or a colon. </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) @@ -1170,7 +1212,7 @@ <h2>whitespace_around_keywords</h2> <b>whitespace_around_keywords</b>(<i>logical_line</i>) <p> - Avoid extraneous whitespace around keywords. +Avoid extraneous whitespace around keywords. </p><p> Okay: True and False E271: True and False @@ -1184,6 +1226,8 @@ <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 in function arguments. +</p><p> Don't use spaces around the '=' sign when used to indicate a keyword argument or a default parameter value. </p><p> @@ -1203,10 +1247,7 @@ <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. +Avoid extraneous whitespace around an operator. </p><p> Okay: a = 12 + 3 E221: a = 4 + 5 @@ -1216,21 +1257,26 @@ </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>) +<a NAME="whitespace_before_comment" ID="whitespace_before_comment"></a> +<h2>whitespace_before_comment</h2> +<b>whitespace_before_comment</b>(<i>logical_line, tokens</i>) <p> - Separate inline comments by at least two spaces. +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> + Each line of a block comment starts with a # and a single space + (unless it is indented text inside the comment). +</p><p> Okay: x = x + 1 # Increment x Okay: x = x + 1 # Increment x + Okay: # Block comment E261: x = x + 1 # Increment x E262: x = x + 1 #Increment x E262: x = x + 1 # Increment x + E265: #Block comment </p> <div align="right"><a href="#top">Up</a></div> <hr /><hr /> @@ -1238,13 +1284,12 @@ <h2>whitespace_before_parameters</h2> <b>whitespace_before_parameters</b>(<i>logical_line, tokens</i>) <p> - Avoid extraneous whitespace in the following situations: +Avoid extraneous whitespace. </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. + Avoid extraneous whitespace in the following situations: + - before the open parenthesis that starts the argument list of a + function call. + - before the open parenthesis that starts an indexing or slicing. </p><p> Okay: spam(1) E211: spam (1)
--- a/Documentation/Source/eric5.QScintilla.SpellChecker.html Fri May 30 13:17:20 2014 +0200 +++ b/Documentation/Source/eric5.QScintilla.SpellChecker.html Fri May 30 15:16:40 2014 +0200 @@ -491,11 +491,6 @@ <dd> self </dd> -</dl><dl> -<dt>Raises <b>StopIteration</b>:</dt> -<dd> -raised to indicate the end of the iteration -</dd> </dl><a NAME="SpellChecker.remove" ID="SpellChecker.remove"></a> <h4>SpellChecker.remove</h4> <b>remove</b>(<i>word</i>)
--- a/Documentation/Source/eric5.install.html Fri May 30 13:17:20 2014 +0200 +++ b/Documentation/Source/eric5.install.html Fri May 30 15:16:40 2014 +0200 @@ -270,10 +270,10 @@ <dt><i>pydir</i></dt> <dd> the name of the directory where the Python script will - eventually be installed + eventually be installed (string) </dd><dt><i>wfile</i></dt> <dd> -the basename of the wrapper +the basename of the wrapper (string) </dd><dt><i>isGuiScript</i></dt> <dd> flag indicating a wrapper script for a GUI @@ -282,7 +282,7 @@ </dl><dl> <dt>Returns:</dt> <dd> -the platform specific name of the wrapper +the platform specific name of the wrapper (string) </dd> </dl> <div align="right"><a href="#top">Up</a></div>
--- a/Documentation/Source/index-eric5.Utilities.html Fri May 30 13:17:20 2014 +0200 +++ b/Documentation/Source/index-eric5.Utilities.html Fri May 30 15:16:40 2014 +0200 @@ -50,6 +50,9 @@ <td><a href="eric5.Utilities.FtpUtilities.html">FtpUtilities</a></td> <td>Module implementing some FTP related utilities.</td> </tr><tr> +<td><a href="eric5.Utilities.MimeTypes.html">MimeTypes</a></td> +<td>Module implementing mimetype dependent functions.</td> +</tr><tr> <td><a href="eric5.Utilities.ModuleParser.html">ModuleParser</a></td> <td>Parse a Python module file.</td> </tr><tr> @@ -68,9 +71,6 @@ <td><a href="eric5.Utilities.compatibility_fixes.html">compatibility_fixes</a></td> <td>Module implementing the open behavior of Python3 for use with Eric5.</td> </tr><tr> -<td><a href="eric5.Utilities.mimetypes.html">mimetypes</a></td> -<td>Module implementing mimetype dependent functions.</td> -</tr><tr> <td><a href="eric5.Utilities.uic.html">uic</a></td> <td>Module implementing a function to compile all user interface files of a directory or directory tree.</td> </tr>
--- a/E5Gui/E5ToolBarDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/E5Gui/E5ToolBarDialog.py Fri May 30 15:16:40 2014 +0200 @@ -60,15 +60,15 @@ self.__manager = toolBarManager self.__toolbarItems = {} - # maps toolbar item IDs to toolbar items + # maps toolbar item IDs to toolbar items self.__currentToolBarItem = None self.__removedToolBarIDs = [] - # remember custom toolbars to be deleted + # remember custom toolbars to be deleted self.__widgetActionToToolBarItemID = {} - # maps widget action IDs to toolbar item IDs + # maps widget action IDs to toolbar item IDs self.__toolBarItemToWidgetActionID = {} - # maps toolbar item IDs to widget action IDs + # maps toolbar item IDs to widget action IDs self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png")) self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
--- a/E5Gui/E5ToolBarManager.py Fri May 30 13:17:20 2014 +0200 +++ b/E5Gui/E5ToolBarManager.py Fri May 30 15:16:40 2014 +0200 @@ -36,29 +36,29 @@ self.__ui = ui self.__toolBars = {} - # maps toolbar IDs to actions + # maps toolbar IDs to actions self.__toolBarsWithSeparators = {} - # maps toolbar IDs to actions incl. separators + # maps toolbar IDs to actions incl. separators self.__defaultToolBars = {} - # maps default toolbar IDs to actions + # maps default toolbar IDs to actions self.__customToolBars = [] - # list of custom toolbars + # list of custom toolbars self.__allToolBars = {} - # maps toolbar IDs to toolbars + # maps toolbar IDs to toolbars self.__categoryToActions = {} - # maps categories to actions + # maps categories to actions self.__actionToCategory = {} - # maps action IDs to categories + # maps action IDs to categories self.__allActions = {} - # maps action IDs to actions + # maps action IDs to actions self.__actionToToolBars = {} - # maps action IDs to toolbars + # maps action IDs to toolbars self.__widgetActions = {} - # maps widget action IDs to toolbars + # maps widget action IDs to toolbars self.__allWidgetActions = {} - # maps widget action IDs to widget actions + # maps widget action IDs to widget actions ###################################################### ## Private methods
--- a/E5Network/E5Ftp.py Fri May 30 13:17:20 2014 +0200 +++ b/E5Network/E5Ftp.py Fri May 30 15:16:40 2014 +0200 @@ -51,10 +51,9 @@ Site = 3 # proxy login first, than use SITE command Open = 4 # proxy login first, than use OPEN command UserAtProxyuserAtServer = 5 # one login for both - ProxyuserAtServer = 6 # proxy login with remote host given, than - # normal remote login - AuthResp = 7 # authenticate to proxy with AUTH and - # RESP commands + ProxyuserAtServer = 6 + # proxy login with remote host given, than normal remote login + AuthResp = 7 # authenticate to proxy with AUTH and RESP commands Bluecoat = 8 # bluecoat proxy
--- a/E5XML/MultiProjectWriter.py Fri May 30 13:17:20 2014 +0200 +++ b/E5XML/MultiProjectWriter.py Fri May 30 15:16:40 2014 +0200 @@ -42,11 +42,11 @@ XMLStreamWriterBase.writeXML(self) self.writeDTD('<!DOCTYPE MultiProject SYSTEM "MultiProject-{0}.dtd">' - .format(multiProjectFileFormatVersion)) + .format(multiProjectFileFormatVersion)) # add some generation comments self.writeComment(" eric5 multi project file for multi project {0} " - .format(self.name)) + .format(self.name)) if Preferences.getMultiProject("XMLTimestamp"): self.writeComment( " Saved: {0} ".format(time.strftime('%Y-%m-%d, %H:%M:%S')))
--- a/Graphics/ApplicationDiagramBuilder.py Fri May 30 13:17:20 2014 +0200 +++ b/Graphics/ApplicationDiagramBuilder.py Fri May 30 15:16:40 2014 +0200 @@ -181,7 +181,7 @@ impLst.append(n) for imp in impLst: impPackage = '.'.join(imp.split('.')[:-1]) - if not impPackage in packages[package][1] and \ + if impPackage not in packages[package][1] and \ not impPackage == package: packages[package][1].append(impPackage)
--- a/Graphics/AssociationItem.py Fri May 30 13:17:20 2014 +0200 +++ b/Graphics/AssociationItem.py Fri May 30 15:16:40 2014 +0200 @@ -78,7 +78,7 @@ self.calculateEndingPoints = \ self.__calculateEndingPoints_topToBottom else: -## self.calculateEndingPoints = self.__calculateEndingPoints_center + ## self.calculateEndingPoints = self.__calculateEndingPoints_center self.calculateEndingPoints = self.__calculateEndingPoints_rectangle self.itemA = itemA
--- a/Graphics/GraphicsUtilities.py Fri May 30 13:17:20 2014 +0200 +++ b/Graphics/GraphicsUtilities.py Fri May 30 15:16:40 2014 +0200 @@ -70,7 +70,7 @@ for parent in currentParents: if parent in stage and parent != current: # might wind up removing current - if not current in parents.get(parent, []): + if current not in parents.get(parent, []): # is not mutually dependant removes.append(current) @@ -105,9 +105,9 @@ for sourceID, destinationID in routes: currentChildren = childrenTable.get(sourceID, []) currentParents = parentTable.get(destinationID, []) - if not destinationID in currentChildren: + if destinationID not in currentChildren: currentChildren.append(destinationID) - if not sourceID in currentParents: + if sourceID not in currentParents: currentParents.append(sourceID) childrenTable[sourceID] = currentChildren parentTable[destinationID] = currentParents
--- a/Graphics/ImportsDiagramBuilder.py Fri May 30 13:17:20 2014 +0200 +++ b/Graphics/ImportsDiagramBuilder.py Fri May 30 15:16:40 2014 +0200 @@ -152,7 +152,7 @@ impLst.append(n) elif self.showExternalImports: impLst.append(n) - if not n in externalMods: + if n not in externalMods: externalMods.append(n) for i in list(modules[module].from_imports.keys()): if i.startswith('.'): @@ -175,7 +175,7 @@ impLst.append(n) elif self.showExternalImports: impLst.append(n) - if not n in externalMods: + if n not in externalMods: externalMods.append(n) classNames = [] for cls in list(modules[module].classes.keys()):
--- a/Graphics/UMLItem.py Fri May 30 13:17:20 2014 +0200 +++ b/Graphics/UMLItem.py Fri May 30 15:16:40 2014 +0200 @@ -104,7 +104,7 @@ @param assoc association to be added (AssociationWidget) """ - if assoc and not assoc in self.associations: + if assoc and assoc not in self.associations: self.associations.append(assoc) def removeAssociation(self, assoc):
--- a/Helpviewer/AdBlock/AdBlockManager.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/AdBlock/AdBlockManager.py Fri May 30 15:16:40 2014 +0200 @@ -246,8 +246,8 @@ Preferences.setHelp("AdBlockEnabled", self.__enabled) if self.__subscriptionsLoaded: subscriptions = [] - requiresSubscriptions = [] # intermediate store for - # subscription requiring others + requiresSubscriptions = [] + # intermediate store for subscription requiring others for subscription in self.__subscriptions: if subscription is None: continue
--- a/Helpviewer/Download/DownloadItem.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/Download/DownloadItem.py Fri May 30 15:16:40 2014 +0200 @@ -435,8 +435,9 @@ self.__md5Hash.addData(buffer) bytesWritten = self.__output.write(buffer) if bytesWritten == -1: - self.infoLabel.setText(self.tr("Error saving: {0}") - .format(self.__output.errorString())) + self.infoLabel.setText( + self.tr("Error saving: {0}") + .format(self.__output.errorString())) self.on_stopButton_clicked() else: self.__startedSaving = True @@ -447,8 +448,9 @@ """ Private slot to handle a network error. """ - self.infoLabel.setText(self.tr("Network Error: {0}") - .format(self.__reply.errorString())) + self.infoLabel.setText( + self.tr("Network Error: {0}") + .format(self.__reply.errorString())) self.tryAgainButton.setEnabled(True) self.tryAgainButton.setVisible(True) self.downloadFinished.emit()
--- a/Helpviewer/Feeds/FeedsManager.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/Feeds/FeedsManager.py Fri May 30 15:16:40 2014 +0200 @@ -52,8 +52,9 @@ self.__wasShown = False self.__loaded = False self.__feeds = [] - self.__replies = {} # dict key is the id of the request object - # dict value is a tuple of request and tree item + self.__replies = {} + # dict key is the id of the request object + # dict value is a tuple of request and tree item self.feedsTree.setContextMenuPolicy(Qt.CustomContextMenu) self.feedsTree.customContextMenuRequested.connect(
--- a/Helpviewer/HelpBrowserWV.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/HelpBrowserWV.py Fri May 30 15:16:40 2014 +0200 @@ -1187,8 +1187,8 @@ if element.tagName().lower() in ["input", "textarea"]: if menu.isEmpty(): pageMenu = self.page().createStandardContextMenu() - directionFound = False # used to detect double - # direction entry + directionFound = False + # used to detect double direction entry for act in pageMenu.actions(): if act.isSeparator(): menu.addSeparator()
--- a/Helpviewer/HelpTopicDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/HelpTopicDialog.py Fri May 30 15:16:40 2014 +0200 @@ -32,7 +32,7 @@ self.setupUi(self) self.label.setText(self.tr("Choose a &topic for <b>{0}</b>:") - .format(keyword)) + .format(keyword)) self.__links = links for topic in sorted(self.__links):
--- a/Helpviewer/Passwords/LoginForm.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/Passwords/LoginForm.py Fri May 30 15:16:40 2014 +0200 @@ -23,9 +23,10 @@ self.url = QUrl() self.name = "" self.hasAPassword = False - self.elements = [] # list of tuples of element name and value - # (string, string) - self.elementTypes = {} # dict of element name as key and type as value + self.elements = [] + # list of tuples of element name and value (string, string) + self.elementTypes = {} + # dict of element name as key and type as value def isValid(self): """
--- a/Helpviewer/Passwords/PasswordManager.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/Passwords/PasswordManager.py Fri May 30 15:16:40 2014 +0200 @@ -201,8 +201,8 @@ return data = [] - section = 0 # 0 = login data, 1 = forms data, - # 2 = never store info + section = 0 + # 0 = login data, 1 = forms data, 2 = never store info for line in lines.splitlines(): if line == self.FORMS: section = 1
--- a/Helpviewer/UserAgent/UserAgentManager.py Fri May 30 13:17:20 2014 +0200 +++ b/Helpviewer/UserAgent/UserAgentManager.py Fri May 30 15:16:40 2014 +0200 @@ -38,8 +38,8 @@ """ super(UserAgentManager, self).__init__(parent) - self.__agents = {} # dictionary with agent strings indexed - # by host name + self.__agents = {} + # dictionary with agent strings indexed by host name self.__loaded = False self.__saveTimer = AutoSaver(self, self.save)
--- a/MultiProject/MultiProject.py Fri May 30 13:17:20 2014 +0200 +++ b/MultiProject/MultiProject.py Fri May 30 15:16:40 2014 +0200 @@ -90,15 +90,15 @@ self.description = "" # description of the multi project self.name = "" self.opened = False - self.projects = [] # list of project info; each info entry is - # a dictionary - # 'name' : name of the project - # 'file' : project file name - # 'master' : flag indicating the master - # project - # 'description' : description of the project - # 'category' : name of the group - # 'uid' : unique identifier + self.projects = [] + # list of project info; each info entry is a dictionary + # 'name' : name of the project + # 'file' : project file name + # 'master' : flag indicating the master + # project + # 'description' : description of the project + # 'category' : name of the group + # 'uid' : unique identifier self.categories = [] def __loadRecent(self):
--- a/PluginManager/PluginManager.py Fri May 30 13:17:20 2014 +0200 +++ b/PluginManager/PluginManager.py Fri May 30 15:16:40 2014 +0200 @@ -283,7 +283,7 @@ if self.__develPluginFile: path = Utilities.splitPath(self.__develPluginFile)[0] - if not path in sys.path: + if path not in sys.path: sys.path.insert(2, path) UI.PixmapCache.addSearchPath(path)
--- a/PluginManager/PluginUninstallDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/PluginManager/PluginUninstallDialog.py Fri May 30 15:16:40 2014 +0200 @@ -113,7 +113,7 @@ """ Aborting...</p>""").format(pluginName)) return False - if not pluginDirectory in sys.path: + if pluginDirectory not in sys.path: sys.path.insert(2, pluginDirectory) module = imp.load_source(pluginName, pluginFile) if not hasattr(module, "packageName"):
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Fri May 30 15:16:40 2014 +0200 @@ -671,7 +671,7 @@ errorFiles.append( Utilities.normabspath(itm.data(0, self.filenameRole))) for file in openFiles: - if not file in errorFiles: + if file not in errorFiles: editor = vm.getOpenEditor(file) editor.clearStyleWarnings() @@ -838,9 +838,9 @@ if itm.childCount() > 0: for index in range(itm.childCount()): citm = itm.child(index) - if self.__itemFixable(citm) and not citm in fixableItems: + if self.__itemFixable(citm) and citm not in fixableItems: fixableItems.append(citm) - elif self.__itemFixable(itm) and not itm in fixableItems: + elif self.__itemFixable(itm) and itm not in fixableItems: fixableItems.append(itm) return fixableItems
--- a/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Fri May 30 15:16:40 2014 +0200 @@ -165,11 +165,12 @@ "W603": self.__fixW603, } self.__modified = False - self.__stackLogical = [] # these need to be fixed before the file - # is saved but after all other inline - # fixes. These work with logical lines. - self.__stack = [] # these need to be fixed before the file - # is saved but after all inline fixes + self.__stackLogical = [] + # These need to be fixed before the file is saved but after all + # other inline fixes. These work with logical lines. + self.__stack = [] + # These need to be fixed before the file is saved but after all + # inline fixes. self.__multiLineNumbers = None self.__docLineNumbers = None @@ -1900,8 +1901,7 @@ if have == self.__getlspace(lines[jline]): want = jlevel * 4 break - if want < 0: # Maybe it's a hanging - # comment like this one, + if want < 0: # Maybe it's a hanging comment like this one, # in which case we should shift it like its base # line got shifted. for j in range(i - 1, -1, -1):
--- a/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckerDialog.py Fri May 30 15:16:40 2014 +0200 @@ -394,7 +394,7 @@ errorFiles.append( Utilities.normabspath(itm.data(0, self.filenameRole))) for file in openFiles: - if not file in errorFiles: + if file not in errorFiles: editor = vm.getOpenEditor(file) editor.clearSyntaxError() editor.clearFlakesWarnings()
--- a/Plugins/PluginCodeStyleChecker.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/PluginCodeStyleChecker.py Fri May 30 15:16:40 2014 +0200 @@ -290,7 +290,7 @@ )) self.__projectBrowserAct.triggered.connect( self.__projectBrowserCodeStyleCheck) - if not self.__projectBrowserAct in menu.actions(): + if self.__projectBrowserAct not in menu.actions(): menu.addAction(self.__projectBrowserAct) def __projectCodeStyleCheck(self): @@ -378,7 +378,7 @@ @param editor reference to the editor """ if menuName == "Checks": - if not self.__editorAct in menu.actions(): + if self.__editorAct not in menu.actions(): menu.addAction(self.__editorAct) self.__editorAct.setEnabled(editor.isPyFile())
--- a/Plugins/PluginEricdoc.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/PluginEricdoc.py Fri May 30 15:16:40 2014 +0200 @@ -221,8 +221,8 @@ outdir = Utilities.toNativeSeparators( parms['qtHelpOutputDirectory']) if outdir == '': - outdir = 'help' # that is eric5_docs default QtHelp - # output dir + outdir = 'help' + # that is eric5_docs default QtHelp output dir # add it to the project data, if it isn't in already outdir = project.getRelativePath(outdir)
--- a/Plugins/PluginSyntaxChecker.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/PluginSyntaxChecker.py Fri May 30 15:16:40 2014 +0200 @@ -295,7 +295,7 @@ )) self.__projectBrowserAct.triggered.connect( self.__projectBrowserSyntaxCheck) - if not self.__projectBrowserAct in menu.actions(): + if self.__projectBrowserAct not in menu.actions(): menu.addAction(self.__projectBrowserAct) def __projectSyntaxCheck(self): @@ -373,7 +373,7 @@ @param editor reference to the editor """ if menuName == "Checks": - if not self.__editorAct in menu.actions(): + if self.__editorAct not in menu.actions(): menu.addAction(self.__editorAct) self.__editorAct.setEnabled( editor.getLanguage() in self.syntaxCheckService.getLanguages())
--- a/Plugins/PluginTabnanny.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/PluginTabnanny.py Fri May 30 15:16:40 2014 +0200 @@ -250,7 +250,7 @@ )) self.__projectBrowserAct.triggered.connect( self.__projectBrowserTabnanny) - if not self.__projectBrowserAct in menu.actions(): + if self.__projectBrowserAct not in menu.actions(): menu.addAction(self.__projectBrowserAct) def __projectTabnanny(self): @@ -327,7 +327,7 @@ @param editor reference to the editor """ if menuName == "Checks": - if not self.__editorAct in menu.actions(): + if self.__editorAct not in menu.actions(): menu.addAction(self.__editorAct) self.__editorAct.setEnabled(editor.isPyFile())
--- a/Plugins/VcsPlugins/__init__.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/VcsPlugins/__init__.py Fri May 30 15:16:40 2014 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> - # +# Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# """ Package containing the various version control system plugins.
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py Fri May 30 15:16:40 2014 +0200 @@ -106,8 +106,8 @@ self.__commitData = {} self.__commitDialog = None - self.__wcng = True # assume new generation working copy - # metadata format + self.__wcng = True + # assume new generation working copy metadata format def getPlugin(self): """ @@ -693,8 +693,8 @@ repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != \ - os.path.normcase(repodir) and \ + while (os.path.normcase(d) != + os.path.normcase(repodir)) and \ (d not in tree2 + tree) and \ (os.path.normcase(d) not in self.statusCache or self.statusCache[os.path.normcase(d)] == @@ -773,8 +773,8 @@ repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(d) != \ - os.path.normcase(repodir) and \ + while (os.path.normcase(d) != + os.path.normcase(repodir)) and \ (d not in tree) and \ (os.path.normcase(d) not in self.statusCache or self.statusCache[os.path.normcase(d)] == @@ -798,8 +798,8 @@ repodir = os.path.dirname(repodir) if os.path.splitdrive(repodir)[1] == os.sep: return # oops, project is not version controlled - while os.path.normcase(dname) != \ - os.path.normcase(repodir) and \ + while (os.path.normcase(dname) != + os.path.normcase(repodir)) and \ (os.path.normcase(dname) not in self.statusCache or self.statusCache[os.path.normcase(dname)] == self.canBeAdded):
--- a/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Fri May 30 15:16:40 2014 +0200 @@ -47,14 +47,14 @@ self.rx_status = QRegExp( '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+(\\S+)\\s+(.+)\\s*') - # flags (8 or 9 anything), revision, changed rev, author, path + # flags (8 or 9 anything), revision, changed rev, author, path self.rx_status2 = \ QRegExp('(.{8,9})\\s+(.+)\\s*') - # flags (8 or 9 anything), path + # flags (8 or 9 anything), path self.rx_changelist = \ QRegExp('--- \\S+ .([\\w\\s]+).:\\s+') - # three dashes, Changelist (translated), quote, - # changelist name, quote, : + # three dashes, Changelist (translated), quote, + # changelist name, quote, : @pyqtSlot(QListWidgetItem, QListWidgetItem) def on_changeLists_currentItemChanged(self, current, previous):
--- a/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/SvnStatusDialog.py Fri May 30 15:16:40 2014 +0200 @@ -196,14 +196,14 @@ self.rx_status = QRegExp( '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+(\\S+)\\s+(.+)\\s*') - # flags (8 or 9 anything), revision, changed rev, author, path + # flags (8 or 9 anything), revision, changed rev, author, path self.rx_status2 = \ QRegExp('(.{8,9})\\s+(.+)\\s*') - # flags (8 or 9 anything), path + # flags (8 or 9 anything), path self.rx_changelist = \ QRegExp('--- \\S+ .([\\w\\s]+).:\\s+') - # three dashes, Changelist (translated), quote, - # changelist name, quote, : + # three dashes, Changelist (translated), quote, + # changelist name, quote, : self.__nonverbose = True
--- a/Plugins/VcsPlugins/vcsSubversion/subversion.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/VcsPlugins/vcsSubversion/subversion.py Fri May 30 15:16:40 2014 +0200 @@ -111,8 +111,8 @@ self.__commitData = {} self.__commitDialog = None - self.__wcng = True # assume new generation working copy - # metadata format + self.__wcng = True + # assume new generation working copy metadata format def getPlugin(self): """ @@ -2238,10 +2238,9 @@ @return list of defined change list names (list of strings) """ changelists = [] - rx_changelist = \ - QRegExp('--- \\S+ .([\\w\\s]+).:\\s*') - # three dashes, Changelist (translated), quote, - # changelist name, quote, : + rx_changelist = QRegExp('--- \\S+ .([\\w\\s]+).:\\s*') + # three dashes, Changelist (translated), quote, + # changelist name, quote, : args = [] args.append("status")
--- a/Plugins/ViewManagerPlugins/Listspace/Listspace.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/ViewManagerPlugins/Listspace/Listspace.py Fri May 30 15:16:40 2014 +0200 @@ -46,7 +46,7 @@ """ editor = assembly.getEditor() super(StackedWidget, self).addWidget(assembly) - if not editor in self.editors: + if editor not in self.editors: self.editors.append(editor) def removeWidget(self, widget):
--- a/Plugins/ViewManagerPlugins/Listspace/__init__.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/ViewManagerPlugins/Listspace/__init__.py Fri May 30 15:16:40 2014 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> - # +# Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# """ Package containing the listspace view manager plugin.
--- a/Plugins/ViewManagerPlugins/Tabview/Tabview.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/ViewManagerPlugins/Tabview/Tabview.py Fri May 30 15:16:40 2014 +0200 @@ -358,7 +358,7 @@ self.setTabsClosable(True) self.navigationButton.setEnabled(True) - if not editor in self.editors: + if editor not in self.editors: self.editors.append(editor) editor.captionChanged.connect(self.__captionChange) editor.cursorLineChanged.connect(self.__cursorLineChanged) @@ -388,7 +388,7 @@ self.setTabsClosable(True) self.navigationButton.setEnabled(True) - if not editor in self.editors: + if editor not in self.editors: self.editors.append(editor) editor.captionChanged.connect(self.__captionChange) editor.cursorLineChanged.connect(self.__cursorLineChanged)
--- a/Plugins/ViewManagerPlugins/Tabview/__init__.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/ViewManagerPlugins/Tabview/__init__.py Fri May 30 15:16:40 2014 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> - # +# Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# """ Package containing the tabview view manager plugin.
--- a/Plugins/ViewManagerPlugins/__init__.py Fri May 30 13:17:20 2014 +0200 +++ b/Plugins/ViewManagerPlugins/__init__.py Fri May 30 15:16:40 2014 +0200 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- - # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> - # +# Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> +# """ Package containing the various view manager plugins.
--- a/Preferences/ConfigurationPages/HelpAppearancePage.py Fri May 30 13:17:20 2014 +0200 +++ b/Preferences/ConfigurationPages/HelpAppearancePage.py Fri May 30 15:16:40 2014 +0200 @@ -43,15 +43,15 @@ # set initial values self.standardFont = Preferences.getHelp("StandardFont") self.standardFontSample.setFont(self.standardFont) - self.standardFontSample.setText("{0} {1}" - .format(self.standardFont.family(), - self.standardFont.pointSize())) + self.standardFontSample.setText( + "{0} {1}".format(self.standardFont.family(), + self.standardFont.pointSize())) self.fixedFont = Preferences.getHelp("FixedFont") self.fixedFontSample.setFont(self.fixedFont) - self.fixedFontSample.setText("{0} {1}" - .format(self.fixedFont.family(), - self.fixedFont.pointSize())) + self.fixedFontSample.setText( + "{0} {1}".format(self.fixedFont.family(), + self.fixedFont.pointSize())) self.initColour("SaveUrlColor", self.secureURLsColourButton, Preferences.getHelp)
--- a/Preferences/ConfigurationPages/QtPage.py Fri May 30 13:17:20 2014 +0200 +++ b/Preferences/ConfigurationPages/QtPage.py Fri May 30 15:16:40 2014 +0200 @@ -70,9 +70,9 @@ """ Private slot to update the Qt4 tools sample label. """ - self.qt4SampleLabel.setText("Sample: {0}designer{1}" - .format(self.qt4PrefixEdit.text(), - self.qt4PostfixEdit.text())) + self.qt4SampleLabel.setText( + "Sample: {0}designer{1}".format(self.qt4PrefixEdit.text(), + self.qt4PostfixEdit.text())) @pyqtSlot(str) def on_qt4PrefixEdit_textChanged(self, txt):
--- a/Project/Project.py Fri May 30 13:17:20 2014 +0200 +++ b/Project/Project.py Fri May 30 15:16:40 2014 +0200 @@ -391,8 +391,8 @@ self.translationsRoot = "" # the translations prefix self.name = "" self.opened = False - self.subdirs = [""] # record the project dir as a relative path - # (i.e. empty path) + self.subdirs = [""] + # record the project dir as a relative path (i.e. empty path) self.otherssubdirs = [] self.vcs = None self.vcsRequested = False @@ -1559,8 +1559,8 @@ .format(targetfile), icon=E5MessageBox.Warning) if not res: - continue # don't overwrite, carry on - # with next file + continue + # don't overwrite, carry on with next file shutil.copy(file, target) except EnvironmentError: @@ -4613,7 +4613,7 @@ """<p>Reason: {0}</p>""").format(str(why))) return - if not "PKGLIST" in self.pdata["OTHERS"]: + if "PKGLIST" not in self.pdata["OTHERS"]: self.appendFile("PKGLIST") @pyqtSlot() @@ -4698,7 +4698,7 @@ archiveFile.writestr("VERSION", version.encode("utf-8")) archiveFile.close() - if not archive in self.pdata["OTHERS"]: + if archive not in self.pdata["OTHERS"]: self.appendFile(archive) if self.ui.notificationsEnabled(): @@ -4736,7 +4736,7 @@ if not path.endswith("/") and not path.endswith("\\"): path = "{0}/".format(path) - if not path in zipFile.namelist(): + if path not in zipFile.namelist(): self.__createZipDirEntries(os.path.split(path[:-1])[0], zipFile) zipFile.writestr(path, b"")
--- a/Project/ProjectBrowserSortFilterProxyModel.py Fri May 30 13:17:20 2014 +0200 +++ b/Project/ProjectBrowserSortFilterProxyModel.py Fri May 30 15:16:40 2014 +0200 @@ -48,7 +48,7 @@ return False sitem = self.sourceModel().item(sindex) try: - if not self.__filterType in sitem.getProjectTypes(): + if self.__filterType not in sitem.getProjectTypes(): return False if self.hideGeneratedForms and \ self.__filterType == ProjectBrowserSourceType and \
--- a/Project/ProjectSourcesBrowser.py Fri May 30 13:17:20 2014 +0200 +++ b/Project/ProjectSourcesBrowser.py Fri May 30 15:16:40 2014 +0200 @@ -627,8 +627,8 @@ self.unittestAction.setEnabled(False) self.checksMenu.menuAction().setEnabled( False) - elif fn.endswith('.rb'): # entry for mixed - # mode programs + elif fn.endswith('.rb'): + # entry for mixed mode programs for act in self.sourceMenuActions.values(): act.setEnabled(False) self.classDiagramAction.setEnabled(True) @@ -636,8 +636,8 @@ self.unittestAction.setEnabled(False) self.checksMenu.menuAction().setEnabled( False) - elif fn.endswith('.js'): # entry for mixed - # mode programs + elif fn.endswith('.js'): + # entry for mixed mode programs for act in self.sourceMenuActions.values(): act.setEnabled(False) self.unittestAction.setEnabled(False) @@ -645,8 +645,8 @@ False) self.graphicsMenu.menuAction().setEnabled( False) - else: # assume the source file is a - # Python file + else: + # assume the source file is a Python file for act in self.sourceMenuActions.values(): act.setEnabled(True) self.classDiagramAction.setEnabled(True) @@ -956,9 +956,9 @@ f = "{0}.coverage".format(basename) tf = "{0}.coverage".format(tbasename) - if os.path.isfile(f) and not f in files: + if os.path.isfile(f) and f not in files: files.append(f) - if os.path.isfile(tf) and not tf in files: + if os.path.isfile(tf) and tf not in files: files.append(tf) if files: @@ -1010,9 +1010,9 @@ f = "{0}.profile".format(basename) tf = "{0}.profile".format(tbasename) - if os.path.isfile(f) and not f in files: + if os.path.isfile(f) and f not in files: files.append(f) - if os.path.isfile(tf) and not tf in files: + if os.path.isfile(tf) and tf not in files: files.append(tf) if files:
--- a/PyUnit/UnittestDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/PyUnit/UnittestDialog.py Fri May 30 15:16:40 2014 +0200 @@ -485,11 +485,13 @@ self.startFailedButton.setDefault(False) self.startButton.setDefault(True) if self.runCount == 1: - self.sbLabel.setText(self.tr("Ran {0} test in {1:.3f}s") - .format(self.runCount, self.timeTaken)) + self.sbLabel.setText( + self.tr("Ran {0} test in {1:.3f}s") + .format(self.runCount, self.timeTaken)) else: - self.sbLabel.setText(self.tr("Ran {0} tests in {1:.3f}s") - .format(self.runCount, self.timeTaken)) + self.sbLabel.setText( + self.tr("Ran {0} tests in {1:.3f}s") + .format(self.runCount, self.timeTaken)) self.progressLed.off() self.unittestStopped.emit()
--- a/QScintilla/Editor.py Fri May 30 13:17:20 2014 +0200 +++ b/QScintilla/Editor.py Fri May 30 15:16:40 2014 +0200 @@ -168,18 +168,18 @@ self.lastCurrMarker = None # remember the last current line self.breaks = {} - # key: marker handle, - # value: (lineno, condition, temporary, - # enabled, ignorecount) + # key: marker handle, + # value: (lineno, condition, temporary, + # enabled, ignorecount) self.bookmarks = [] - # bookmarks are just a list of handles to the - # bookmark markers + # bookmarks are just a list of handles to the + # bookmark markers self.syntaxerrors = {} - # key: marker handle - # value: list of (error message, error index) + # key: marker handle + # value: list of (error message, error index) self.warnings = {} - # key: marker handle - # value: list of (warning message, warning type) + # key: marker handle + # value: list of (warning message, warning type) self.notcoveredMarkers = [] # just a list of marker handles self.showingNotcoveredMarkers = False @@ -192,21 +192,21 @@ self.lastModified = 0 self.line = -1 self.inReopenPrompt = False - # true if the prompt to reload a changed source is present + # true if the prompt to reload a changed source is present self.inFileRenamed = False - # true if we are propagating a rename action + # true if we are propagating a rename action self.inLanguageChanged = False - # true if we are propagating a language change + # true if we are propagating a language change self.inEolChanged = False - # true if we are propagating an eol change + # true if we are propagating an eol change self.inEncodingChanged = False - # true if we are propagating an encoding change + # true if we are propagating an encoding change self.inDragDrop = False - # true if we are in drop mode + # true if we are in drop mode self.inLinesChanged = False - # true if we are propagating a lines changed event + # true if we are propagating a lines changed event self.__hasTaskMarkers = False - # no task markers present + # no task markers present self.macros = {} # list of defined macros self.curMacro = None @@ -2790,13 +2790,13 @@ undo_ = True while self.isModified(): if undo_: - # try undo first + # try undo first if self.isUndoAvailable(): self.undo() else: undo_ = False else: - # try redo next + # try redo next if self.isRedoAvailable(): self.redo() else: @@ -5174,9 +5174,9 @@ f = "{0}.coverage".format(basename) tf = "{0}.coverage".format(tbasename) - if os.path.isfile(f) and not f in files: + if os.path.isfile(f) and f not in files: files.append(f) - if os.path.isfile(tf) and not tf in files: + if os.path.isfile(tf) and tf not in files: files.append(tf) if files: @@ -5353,9 +5353,9 @@ f = "{0}.profile".format(basename) tf = "{0}.profile".format(tbasename) - if os.path.isfile(f) and not f in files: + if os.path.isfile(f) and f not in files: files.append(f) - if os.path.isfile(tf) and not tf in files: + if os.path.isfile(tf) and tf not in files: files.append(tf) if files:
--- a/QScintilla/Exporters/ExporterPDF.py Fri May 30 13:17:20 2014 +0200 +++ b/QScintilla/Exporters/ExporterPDF.py Fri May 30 15:16:40 2014 +0200 @@ -575,16 +575,16 @@ utf8Len = 3 elif (utf8Ch[0] & 0xC0) == 0xC0: utf8Len = 2 - column -= 1 # will be incremented - # again later + column -= 1 + # will be incremented again later elif len(utf8Ch) == utf8Len: ch = utf8Ch.decode('utf8') self.pr.add(ch, style) utf8Ch = b"" utf8Len = 0 else: - column -= 1 # will be incremented - # again later + column -= 1 + # will be incremented again later else: self.pr.add(ch.decode(), style) column += 1
--- a/QScintilla/MiniEditor.py Fri May 30 13:17:20 2014 +0200 +++ b/QScintilla/MiniEditor.py Fri May 30 15:16:40 2014 +0200 @@ -2799,7 +2799,7 @@ line0 = self.__textEdit.text(0) if line0.startswith("#!") and \ ("python2" in line0 or - ("python" in line0 and not "python3" in line0)): + ("python" in line0 and "python3" not in line0)): return True if self.__curFile is not None:
--- a/QScintilla/Shell.py Fri May 30 13:17:20 2014 +0200 +++ b/QScintilla/Shell.py Fri May 30 15:16:40 2014 +0200 @@ -630,8 +630,9 @@ else: version = version.replace("#", self.tr("No.")) if platform != "" and dbgclient != "": - self.__write(self.tr('{0} on {1}, {2}') - .format(version, platform, dbgclient)) + self.__write( + self.tr('{0} on {1}, {2}') + .format(version, platform, dbgclient)) else: self.__write(version) self.__write('\n') @@ -1259,9 +1260,9 @@ self.dbs.startClient(False) # same as reset else: language = cmdList[1] - if not language in self.clientLanguages: + if language not in self.clientLanguages: language = cmdList[1].capitalize() - if not language in self.clientLanguages: + if language not in self.clientLanguages: language = "" if language: self.dbs.startClient(False, language)
--- a/QScintilla/SpellChecker.py Fri May 30 13:17:20 2014 +0200 +++ b/QScintilla/SpellChecker.py Fri May 30 15:16:40 2014 +0200 @@ -545,6 +545,5 @@ Public method to advance to the next error. @return self - @exception StopIteration raised to indicate the end of the iteration """ return self.__next__()
--- a/Snapshot/SnapshotFreehandGrabber.py Fri May 30 13:17:20 2014 +0200 +++ b/Snapshot/SnapshotFreehandGrabber.py Fri May 30 15:16:40 2014 +0200 @@ -260,9 +260,8 @@ self.__selection.append(p) else: # moving the whole selection - p = evt.pos() - self.__pBefore # Offset - self.__pBefore = evt.pos() # save position for - # next iteration + p = evt.pos() - self.__pBefore # Offset + self.__pBefore = evt.pos() # save position for next iteration self.__selection.translate(p) self.update()
--- a/Tasks/TaskFilter.py Fri May 30 13:17:20 2014 +0200 +++ b/Tasks/TaskFilter.py Fri May 30 15:16:40 2014 +0200 @@ -26,12 +26,17 @@ self.summaryFilter = None self.filenameFilter = None - self.typeFilter = Task.TypeNone # task type - self.scopeFilter = None # global (False) or project (True) - self.statusFilter = None # uncompleted (False) or - # completed (True) - self.prioritiesFilter = None # list of priorities - # [0 (high), 1 (normal), 2 (low)] + self.typeFilter = Task.TypeNone + # task type + + self.scopeFilter = None + # global (False) or project (True) + + self.statusFilter = None + # uncompleted (False) or completed (True) + + self.prioritiesFilter = None + # list of priorities [0 (high), 1 (normal), 2 (low)] def setActive(self, enabled): """ @@ -143,7 +148,7 @@ return False if self.prioritiesFilter is not None and \ - not task.priority in self.prioritiesFilter: + task.priority not in self.prioritiesFilter: return False return True
--- a/Templates/TemplateViewer.py Fri May 30 13:17:20 2014 +0200 +++ b/Templates/TemplateViewer.py Fri May 30 15:16:40 2014 +0200 @@ -363,9 +363,9 @@ self.variables = [] self.formatedVariables = [] for var in variables: - if not var in self.variables: + if var not in self.variables: self.variables.append(var) - if var.find(':') >= 0 and not var in self.formatedVariables: + if var.find(':') >= 0 and var not in self.formatedVariables: self.formatedVariables.append(var)
--- a/Toolbox/Startup.py Fri May 30 13:17:20 2014 +0200 +++ b/Toolbox/Startup.py Fri May 30 15:16:40 2014 +0200 @@ -129,7 +129,7 @@ if iconPath: UI.PixmapCache.addSearchPath(iconPath) for defaultIconPath in defaultIconPaths: - if not defaultIconPath in iconPaths: + if defaultIconPath not in iconPaths: UI.PixmapCache.addSearchPath(defaultIconPath)
--- a/UI/EmailDialog.py Fri May 30 13:17:20 2014 +0200 +++ b/UI/EmailDialog.py Fri May 30 15:16:40 2014 +0200 @@ -55,8 +55,8 @@ msg.set_payload(encdata) msg['Content-Transfer-Encoding'] = 'base64' -encoders.encode_base64 = _encode_base64 # WORK AROUND: implement our - # corrected encoder +encoders.encode_base64 = _encode_base64 +# WORK AROUND: implement our corrected encoder class EmailDialog(QDialog, Ui_EmailDialog):
--- a/UI/PixmapCache.py Fri May 30 13:17:20 2014 +0200 +++ b/UI/PixmapCache.py Fri May 30 15:16:40 2014 +0200 @@ -56,7 +56,7 @@ @param path path to add (string) """ - if not path in self.searchPath: + if path not in self.searchPath: self.searchPath.append(path) pixCache = PixmapCache()
--- a/UI/UserInterface.py Fri May 30 13:17:20 2014 +0200 +++ b/UI/UserInterface.py Fri May 30 15:16:40 2014 +0200 @@ -1165,11 +1165,13 @@ self.setWindowTitle( self.tr("{0} - Passive Mode").format(Program)) elif self.capProject and not self.capEditor: - self.setWindowTitle(self.tr("{0} - {1} - Passive Mode") - .format(self.capProject, Program)) + self.setWindowTitle( + self.tr("{0} - {1} - Passive Mode") + .format(self.capProject, Program)) elif not self.capProject and self.capEditor: - self.setWindowTitle(self.tr("{0} - {1} - Passive Mode") - .format(self.capEditor, Program)) + self.setWindowTitle( + self.tr("{0} - {1} - Passive Mode") + .format(self.capEditor, Program)) else: self.setWindowTitle( self.tr("{0} - {1} - {2} - Passive Mode")
--- a/Utilities/ClassBrowsers/rbclbr.py Fri May 30 13:17:20 2014 +0200 +++ b/Utilities/ClassBrowsers/rbclbr.py Fri May 30 15:16:40 2014 +0200 @@ -419,8 +419,8 @@ while acstack and \ acstack[-1][1] >= thisindent: del acstack[-1] - acstack.append(["public", thisindent]) # default access control - # is 'public' + acstack.append(["public", thisindent]) + # default access control is 'public' elif m.start("Module") >= 0: # we found a module definition @@ -460,8 +460,8 @@ while acstack and \ acstack[-1][1] >= thisindent: del acstack[-1] - acstack.append(["public", thisindent]) # default access control - # is 'public' + acstack.append(["public", thisindent]) + # default access control is 'public' elif m.start("AccessControl") >= 0: aclist = m.group("AccessControlList")
--- a/Utilities/ModuleParser.py Fri May 30 13:17:20 2014 +0200 +++ b/Utilities/ModuleParser.py Fri May 30 15:16:40 2014 +0200 @@ -465,7 +465,7 @@ @param name name of the global to add (string) @param attr Attribute object to be added """ - if not name in self.globals: + if name not in self.globals: self.globals[name] = attr else: self.globals[name].addAssignment(attr.lineno) @@ -760,7 +760,7 @@ "".join(m.group("ImportList").splitlines()) .replace("\\", "").split(',')] for name in names: - if not name in self.imports: + if name not in self.imports: self.imports.append(name) elif m.start("ImportFrom") >= 0: @@ -1273,7 +1273,7 @@ @param name name of the attribute to add (string) @param attr Attribute object to be added """ - if not name in self.attributes: + if name not in self.attributes: self.attributes[name] = attr else: self.attributes[name].addAssignment(attr.lineno) @@ -1297,7 +1297,7 @@ @param name name of the global to add (string) @param attr Attribute object to be added """ - if not name in self.globals: + if name not in self.globals: self.globals[name] = attr else: self.globals[name].addAssignment(attr.lineno)
--- a/Utilities/__init__.py Fri May 30 13:17:20 2014 +0200 +++ b/Utilities/__init__.py Fri May 30 15:16:40 2014 +0200 @@ -950,8 +950,8 @@ @return the complete filename (string) """ if ext[0] != ".": - ext = ".{0}".format(ext) # require leading separator to match - # os.path.splitext + ext = ".{0}".format(ext) + # require leading separator to match os.path.splitext return prefix + EXTSEP + ext[1:]
--- a/VCS/ProjectBrowserHelper.py Fri May 30 13:17:20 2014 +0200 +++ b/VCS/ProjectBrowserHelper.py Fri May 30 15:16:40 2014 +0200 @@ -301,8 +301,8 @@ status = self.vcs.vcsRemove(names) if status: if isRemoveDirs: - self.browser._removeDir() # remove directories from - # Project + self.browser._removeDir() + # remove directories from Project else: self.browser._removeFile() # remove file(s) from project
--- a/eric5.e4p Fri May 30 13:17:20 2014 +0200 +++ b/eric5.e4p Fri May 30 15:16:40 2014 +0200 @@ -1138,9 +1138,9 @@ <Source>Plugins/VcsPlugins/vcsMercurial/HgBookmarkRenameDialog.py</Source> <Source>Plugins/VcsPlugins/vcsMercurial/HgBookmarksInOutDialog.py</Source> <Source>Plugins/VcsPlugins/vcsMercurial/HgBookmarksListDialog.py</Source> - <Source>Utilities/mimetypes.py</Source> <Source>Plugins/VcsPlugins/vcsMercurial/HgConflictsListDialog.py</Source> <Source>cleanupSource.py</Source> + <Source>Utilities/MimeTypes.py</Source> </Sources> <Forms> <Form>PyUnit/UnittestDialog.ui</Form> @@ -1993,7 +1993,7 @@ <string>ExcludeMessages</string> </key> <value> - <string>W293, N802, N803, N807, N808, N821</string> + <string>N802, N803, N807, N808, N821, W293, E265</string> </value> <key> <string>FixCodes</string>
--- a/eric5_api.py Fri May 30 13:17:20 2014 +0200 +++ b/eric5_api.py Fri May 30 15:16:40 2014 +0200 @@ -279,7 +279,7 @@ continue for apiEntry in api: - if not apiEntry in apis: + if apiEntry not in apis: apis.append(apiEntry) for basesEntry in bases: if bases[basesEntry]:
--- a/install.py Fri May 30 13:17:20 2014 +0200 +++ b/install.py Fri May 30 15:16:40 2014 +0200 @@ -327,7 +327,7 @@ os.chmod(dstname, 0o644) break else: - if os.path.isdir(srcname) and not srcname in excludeDirs: + if os.path.isdir(srcname) and srcname not in excludeDirs: copyTree(srcname, dstname, filters, excludePatterns=excludePatterns)
--- a/uninstall.py Fri May 30 13:17:20 2014 +0200 +++ b/uninstall.py Fri May 30 15:16:40 2014 +0200 @@ -154,10 +154,10 @@ os.remove(f) # Cleanup the install directories - for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir', 'ericCSSDir', - 'ericIconDir', 'ericPixDir', 'ericTemplatesDir', - 'ericCodeTemplatesDir', 'ericOthersDir', 'ericStylesDir', - 'ericDir']: + for name in ['ericExamplesDir', 'ericDocDir', 'ericDTDDir', + 'ericCSSDir', 'ericIconDir', 'ericPixDir', + 'ericTemplatesDir', 'ericCodeTemplatesDir', + 'ericOthersDir', 'ericStylesDir', 'ericDir']: dirpath = getConfig(name) if os.path.exists(dirpath): shutil.rmtree(dirpath, True)