Sat, 10 Apr 2021 18:31:17 +0200
Applied some more code simplifications suggested by the new Simplify checker.
--- a/eric6.epj Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6.epj Sat Apr 10 18:31:17 2021 +0200 @@ -49,7 +49,7 @@ "DocstringType": "eric", "EnabledCheckerCategories": "C, D, E, M, N, Y, W", "ExcludeFiles": "*/ThirdParty/*, */coverage/*, */Ui_*.py, */Examples/*, */*_rc.py,*/pycodestyle.py,*/pyflakes/checker.py,*/mccabe.py,*/eradicate.py,*/ast_unparse.py", - "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W504,Y110,Y111,Y116,Y119", + "ExcludeMessages": "C101,E265,E266,E305,E402,M201,M301,M302,M303,M304,M305,M306,M307,M308,M311,M312,M313,M314,M315,M321,M701,M702,M811,M834,N802,N803,N807,N808,N821,W293,W504,Y110,Y111,Y116,Y119,Y401,Y402", "FixCodes": "", "FixIssues": false, "FutureChecker": "",
--- a/eric6/CondaInterface/__init__.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/CondaInterface/__init__.py Sat Apr 10 18:31:17 2021 +0200 @@ -35,12 +35,12 @@ proc = QProcess() proc.start(exe, ["info", "--json"]) - if not proc.waitForStarted(15000): + if not proc.waitForStarted(msecs=15000): __CondaVersionStr = QCoreApplication.translate( "CondaInterface", '<conda not found or not configured.>') else: - proc.waitForFinished(15000) + proc.waitForFinished(msecs=15000) output = str(proc.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace').strip() @@ -63,10 +63,9 @@ int(i) for i in __CondaVersionStr.split(".") ) __CondaRootPrefix = jsonDict["root_prefix"] - if "user_rc_path" in jsonDict: - __CondaUserConfig = jsonDict["user_rc_path"] - elif "rc_path" in jsonDict: - __CondaUserConfig = jsonDict["rc_path"] + __CondaUserConfig = jsonDict.get("user_rc_path") + if __CondaUserConfig is None: + __CondaUserConfig = jsonDict.get("rc_path") __initialized = True
--- a/eric6/DataViews/PyCoverageDialog.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/DataViews/PyCoverageDialog.py Sat Apr 10 18:31:17 2021 +0200 @@ -211,8 +211,8 @@ self.__createResultItem( file, str(n), str(m), pc, readableEx, readable) - total_statements = total_statements + n - total_executed = total_executed + m + total_statements += n + total_executed += m except CoverageException: total_exceptions += 1
--- a/eric6/DebugClients/Python/AsyncFile.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/DebugClients/Python/AsyncFile.py Sat Apr 10 18:31:17 2021 +0200 @@ -257,7 +257,7 @@ lines.append(line) if sizehint >= 0: - room = room - linelen + room -= linelen if room <= 0: break
--- a/eric6/DebugClients/Python/DebugUtilities.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/DebugClients/Python/DebugUtilities.py Sat Apr 10 18:31:17 2021 +0200 @@ -80,7 +80,7 @@ varargs = None if co.co_flags & CO_VARARGS: varargs = co.co_varnames[nargs] - nargs = nargs + 1 + nargs += 1 varkw = None if co.co_flags & CO_VARKEYWORDS: varkw = co.co_varnames[nargs]
--- a/eric6/DebugClients/Python/FlexCompleter.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/DebugClients/Python/FlexCompleter.py Sat Apr 10 18:31:17 2021 +0200 @@ -122,7 +122,7 @@ @return ammended word (string) """ if callable(val): - word = word + "(" + word += "(" return word def global_matches(self, text): @@ -141,11 +141,11 @@ if word[:n] == text: seen.add(word) if word in {'finally', 'try'}: - word = word + ':' + word += ':' elif word not in {'False', 'None', 'True', 'break', 'continue', 'pass', 'else'}: - word = word + ' ' + word += ' ' matches.append(word) for nspace in [self.namespace, builtins.__dict__]: for word, val in nspace.items(): @@ -227,7 +227,7 @@ ret = dir(klass) if hasattr(klass, '__bases__'): for base in klass.__bases__: - ret = ret + get_class_members(base) + ret += get_class_members(base) return ret #
--- a/eric6/DebugClients/Python/PyProfile.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/DebugClients/Python/PyProfile.py Sat Apr 10 18:31:17 2021 +0200 @@ -143,12 +143,11 @@ if self.cur and frame.f_back is not self.cur[-2]: rpt, rit, ret, rfn, rframe, rcur = self.cur if not isinstance(rframe, profile.Profile.fake_frame): - assert rframe.f_back is frame.f_back, ("Bad call", rfn, - # secok - rframe, rframe.f_back, - frame, frame.f_back) + assert rframe.f_back is frame.f_back, ( # secok + "Bad call", rfn, rframe, rframe.f_back, + frame, frame.f_back) self.trace_dispatch_return(rframe, 0) - assert (self.cur is None or # secok + assert (self.cur is None or # secok frame.f_back is self.cur[-2]), ("Bad call", self.cur[-3]) fcode = frame.f_code
--- a/eric6/E5Gui/E5ProcessDialog.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/E5Gui/E5ProcessDialog.py Sat Apr 10 18:31:17 2021 +0200 @@ -237,7 +237,7 @@ progress = int(match.group(1)) self.progressBar.setValue(progress) if not s.endswith("\n"): - s = s + "\n" + s += "\n" self.resultbox.insertPlainText(s) self.resultbox.ensureCursorVisible()
--- a/eric6/Graphics/ClassItem.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/ClassItem.py Sat Apr 10 18:31:17 2021 +0200 @@ -167,7 +167,7 @@ height = height + self.attrs.boundingRect().height() + self.margin if self.meths: width = max(width, self.meths.boundingRect().width()) - height = height + self.meths.boundingRect().height() + height += self.meths.boundingRect().height() self.setSize(width + 2 * self.margin, height + 2 * self.margin) def setModel(self, model):
--- a/eric6/Graphics/ImportsDiagramBuilder.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/ImportsDiagramBuilder.py Sat Apr 10 18:31:17 2021 +0200 @@ -94,13 +94,11 @@ None, 0, tot, self.tr("%v/%m Modules"), self.parent()) progress.setWindowTitle(self.tr("Imports Diagramm")) try: - prog = 0 progress.show() QApplication.processEvents() - for module in modules: + for prog, module in enumerate(modules): progress.setValue(prog) QApplication.processEvents() - prog = prog + 1 try: mod = Utilities.ModuleParser.readModule( module, extensions=extensions, caching=False)
--- a/eric6/Graphics/ModuleItem.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/ModuleItem.py Sat Apr 10 18:31:17 2021 +0200 @@ -120,7 +120,7 @@ height = self.header.boundingRect().height() if self.classes: width = max(width, self.classes.boundingRect().width()) - height = height + self.classes.boundingRect().height() + height += self.classes.boundingRect().height() self.setSize(width + 2 * self.margin, height + 2 * self.margin) def setModel(self, model):
--- a/eric6/Graphics/PackageDiagramBuilder.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/PackageDiagramBuilder.py Sat Apr 10 18:31:17 2021 +0200 @@ -328,19 +328,19 @@ for rect in generation: if rect.bottom() > currentHeight: currentHeight = rect.bottom() - currentWidth = currentWidth + rect.right() + currentWidth += rect.right() # update totals if currentWidth > width: width = currentWidth - height = height + currentHeight + height += currentHeight # store generation info widths.append(currentWidth) heights.append(currentHeight) # add in some whitespace - width = width * whiteSpaceFactor + width *= whiteSpaceFactor height = height * whiteSpaceFactor - 20 verticalWhiteSpace = 40.0
--- a/eric6/Graphics/PackageItem.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/PackageItem.py Sat Apr 10 18:31:17 2021 +0200 @@ -130,7 +130,7 @@ height = self.header.boundingRect().height() if self.modules: width = max(width, self.modules.boundingRect().width()) - height = height + self.modules.boundingRect().height() + height += self.modules.boundingRect().height() latchW = width / 3.0 latchH = min(15.0, latchW) self.setSize(width + 2 * self.margin,
--- a/eric6/Graphics/UMLClassDiagramBuilder.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Graphics/UMLClassDiagramBuilder.py Sat Apr 10 18:31:17 2021 +0200 @@ -180,19 +180,19 @@ for rect in generation: if rect.bottom() > currentHeight: currentHeight = rect.bottom() - currentWidth = currentWidth + rect.right() + currentWidth += rect.right() # update totals if currentWidth > width: width = currentWidth - height = height + currentHeight + height += currentHeight # store generation info widths.append(currentWidth) heights.append(currentHeight) # add in some whitespace - width = width * whiteSpaceFactor + width *= whiteSpaceFactor height = height * whiteSpaceFactor - 20 verticalWhiteSpace = 40.0
--- a/eric6/HexEdit/HexEditWidget.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/HexEdit/HexEditWidget.py Sat Apr 10 18:31:17 2021 +0200 @@ -1532,7 +1532,7 @@ else: if pos < 0: pos = 0 - pos = pos // 2 + pos //= 2 self.__bSelectionInit = pos self.__bSelectionBegin = pos self.__bSelectionEnd = pos @@ -1548,7 +1548,7 @@ """ if pos < 0: pos = 0 - pos = pos // 2 + pos //= 2 if pos >= self.__bSelectionInit: self.__bSelectionEnd = pos self.__bSelectionBegin = self.__bSelectionInit
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Sat Apr 10 18:31:17 2021 +0200 @@ -71,7 +71,7 @@ anything @type bool """ - super(CodeStyleFixer, self).__init__() + super().__init__() self.__filename = filename self.__origName = "" @@ -378,7 +378,7 @@ except (SyntaxError, tokenize.TokenError): return None - line = line - 1 + line -= 1 ls = None le = None for i in range(0, len(logical_start)): @@ -533,7 +533,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 quotes = re.match(r"""\s*[ru]?('''|'|\")""", self.__source[line]).group(1) left, right = self.__source[line].split(quotes, 1) @@ -565,7 +565,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 if code == "D112": insertChar = "r" else: @@ -600,7 +600,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 if not self.__source[line].lstrip().startswith( ('"""', 'r"""', 'u"""')): # only correctly formatted docstrings will be fixed @@ -643,7 +643,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 newText = "" if ( self.__source[line].rstrip().endswith(('"""', "'''")) and @@ -694,7 +694,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line - 1] = "" # Blank line before function/method docstring removed. return (1, "FIXD141", [], 0) @@ -724,7 +724,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line] = self.__eol + self.__source[line] # Blank line inserted before class docstring. return (1, "FIXD142", [], 0) @@ -754,7 +754,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line] += self.__eol # Blank line inserted after class docstring. return (1, "FIXD143", [], 0) @@ -784,7 +784,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 if not self.__source[line].rstrip().endswith("."): # only correct summary lines can be fixed here return (0, "", 0) @@ -818,7 +818,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line] = self.__eol + self.__source[line] # Blank line inserted after last paragraph of docstring. return (1, "FIXD145", [], 0) @@ -848,7 +848,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 indent = self.__getIndent(self.__source[line]) source = self.__source[line].strip() if code == "D221": @@ -902,7 +902,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line - 1] = "" if code == "D242": # Blank line before class docstring removed. @@ -937,7 +937,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line + 1] = "" if code == "D243": # Blank line after class docstring removed. @@ -972,7 +972,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 self.__source[line - 1] = "" # Blank line after last paragraph removed. return (1, "FIXD247", [], 0) @@ -1079,7 +1079,7 @@ modified = self.__fixReindent(line, pos, logical) if not modified: # fall back to simple method - line = line - 1 + line -= 1 text = self.__source[line] indentation = self.__getIndent(text) self.__source[line] = ( @@ -1301,7 +1301,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] if '"""' in text or "'''" in text or text.rstrip().endswith('\\'): @@ -1333,7 +1333,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] if '"""' in text or "'''" in text or text.rstrip().endswith('\\'): @@ -1363,7 +1363,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] if '"""' in text or "'''" in text or text.rstrip().endswith('\\'): @@ -1408,8 +1408,8 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 - pos = pos + 1 + line -= 1 + pos += 1 self.__source[line] = ( self.__source[line][:pos] + " " + @@ -1436,7 +1436,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] # This is necessary since pycodestyle sometimes reports columns that @@ -1474,7 +1474,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] left = text[:pos].rstrip(' \t#') right = text[pos:].lstrip(' \t#') @@ -1600,7 +1600,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 text = self.__source[line] if not text.lstrip().startswith("import"): return (0, "", [], 0) @@ -1650,7 +1650,7 @@ self.__multilineStringLines() ) isDocString = line in docStringLines - line = line - 1 + line -= 1 text = self.__source[line] if line > 0: prevText = self.__source[line - 1] @@ -1725,9 +1725,9 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 text = self.__source[line] - pos = pos + 1 + pos += 1 newText = ( text[:pos] + @@ -1765,7 +1765,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 text = self.__source[line] if text.rstrip().endswith("\\"): @@ -1802,7 +1802,7 @@ message and an ID for a deferred fix @rtype tuple of (int, str, list or int, int) """ - line = line - 1 + line -= 1 text = self.__source[line] rightPos = pos + 2 @@ -1848,7 +1848,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 text = self.__source[line] if code == "N804": arg = "cls" @@ -1901,7 +1901,7 @@ @rtype tuple of (int, str, list or int, int) """ if apply: - line = line - 1 + line -= 1 text = self.__source[line] index = text.find("(") + 1 left = text[:index] @@ -1920,7 +1920,7 @@ self.__source[line] = newText else: # they are on the next line - line = line + 1 + line += 1 text = self.__source[line] indent = self.__getIndent(text) right = text.lstrip()
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/injectionWildcard.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/injectionWildcard.py Sat Apr 10 18:31:17 2021 +0200 @@ -66,7 +66,7 @@ argumentString = '' if isinstance(callArgument, list): for li in callArgument: - argumentString = argumentString + ' {0}'.format(li) + argumentString += ' {0}'.format(li) elif isinstance(callArgument, str): argumentString = callArgument
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheck.py Sat Apr 10 18:31:17 2021 +0200 @@ -60,7 +60,7 @@ codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' + codestring += '\n' return codestring
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/jsCheckSyntax.py Sat Apr 10 18:31:17 2021 +0200 @@ -45,7 +45,7 @@ codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' + codestring += '\n' return codestring
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/jsonCheckSyntax.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/jsonCheckSyntax.py Sat Apr 10 18:31:17 2021 +0200 @@ -43,7 +43,7 @@ codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' + codestring += '\n' return codestring
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/tomlCheckSyntax.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/tomlCheckSyntax.py Sat Apr 10 18:31:17 2021 +0200 @@ -43,7 +43,7 @@ codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' + codestring += '\n' return codestring
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/yamlCheckSyntax.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/yamlCheckSyntax.py Sat Apr 10 18:31:17 2021 +0200 @@ -43,7 +43,7 @@ codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") if codestring and codestring[-1] != '\n': - codestring = codestring + '\n' + codestring += '\n' return codestring
--- a/eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/PromtEngine.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/PromtEngine.py Sat Apr 10 18:31:17 2021 +0200 @@ -33,7 +33,7 @@ @param plugin reference to the plugin object (TranslatorPlugin) @param parent reference to the parent object (QObject) """ - super(PromtEngine, self).__init__(plugin, parent) + super().__init__(plugin, parent) self.__mapping = { "de": "g", @@ -95,9 +95,7 @@ except ValueError: return self.tr("Promt: Invalid response received"), False - if "d" in responseDict: - responseDict = responseDict["d"] - + responseDict = responseDict.get("d", responseDict) result = responseDict["result"][:-1] # get rid of stub if responseDict["errCode"] == 0:
--- a/eric6/Project/ProjectTranslationsBrowser.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Project/ProjectTranslationsBrowser.py Sat Apr 10 18:31:17 2021 +0200 @@ -1257,7 +1257,7 @@ else: return if Utilities.isWindowsPlatform(): - lrelease = lrelease + '.exe' + lrelease += '.exe' if langs: langs = [self.project.getRelativePath(lang.fileName())
--- a/eric6/QScintilla/Editor.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/QScintilla/Editor.py Sat Apr 10 18:31:17 2021 +0200 @@ -5434,7 +5434,7 @@ if ct - ctshift < ctmin: ct = ctmin else: - ct = ct - ctshift + ct -= ctshift return ct #################################################################
--- a/eric6/QScintilla/Lexers/SubstyledLexer.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/QScintilla/Lexers/SubstyledLexer.py Sat Apr 10 18:31:17 2021 +0200 @@ -541,8 +541,7 @@ if style in self.__subStyles and substyle in self.__subStyles[style]: styleData = self.__subStyles[style][substyle]["Style"] - if "eolfill" in styleData: - eolFill = styleData["eolfill"] + eolFill = styleData.get("eolfill", self.eolFill(style)) return eolFill @@ -718,8 +717,7 @@ substyle in self.defaultSubStyles[style] ): styleData = self.defaultSubStyles[style][substyle]["Style"] - if "eolfill" in styleData: - eolFill = styleData["eolfill"] + eolFill = styleData.get("eolfill", self.defaultEolFill(style)) return eolFill
--- a/eric6/Snapshot/SnapshotFreehandGrabber.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Snapshot/SnapshotFreehandGrabber.py Sat Apr 10 18:31:17 2021 +0200 @@ -27,7 +27,7 @@ @param fill fill color (QColor) """ clip = QRegion(polygon) - clip = clip - QRegion(polygon) + clip -= QRegion(polygon) pen = QPen(outline, 1, Qt.PenStyle.SolidLine, Qt.PenCapStyle.SquareCap, Qt.PenJoinStyle.BevelJoin) @@ -146,7 +146,7 @@ # Draw the grey area around the selection. grey = QRegion(self.rect()) - grey = grey - QRegion(pol) + grey -= QRegion(pol) painter.setClipRegion(grey) painter.setPen(Qt.PenStyle.NoPen) painter.setBrush(overlayColor)
--- a/eric6/Tools/TRPreviewer.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Tools/TRPreviewer.py Sat Apr 10 18:31:17 2021 +0200 @@ -871,13 +871,11 @@ @param windowMenu reference to the window menu """ - idx = 0 - for wid in self.widgets: + for idx, wid in enumerate(self.widgets): act = windowMenu.addAction(wid.windowTitle()) act.setData(idx) act.setCheckable(True) act.setChecked(not wid.isHidden()) - idx = idx + 1 def toggleSelectedWidget(self, act): """
--- a/eric6/UI/BrowserModel.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/UI/BrowserModel.py Sat Apr 10 18:31:17 2021 +0200 @@ -1453,7 +1453,7 @@ except AttributeError: sname = sup supers.append(sname) - name = name + "({0})".format(", ".join(supers)) + name += "({0})".format(", ".join(supers)) BrowserItem.__init__(self, parent, name)
--- a/eric6/Utilities/ClassBrowsers/idlclbr.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/idlclbr.py Sat Apr 10 18:31:17 2021 +0200 @@ -326,7 +326,7 @@ meth_sig = meth_sig and meth_sig.replace('\\\n', '') or '' meth_sig = _commentsub('', meth_sig) meth_sig = _normalize(' ', meth_sig) - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start # close all interfaces/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: @@ -371,7 +371,7 @@ # close all interfaces/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: del classstack[-1] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start class_name = m.group("InterfaceName") inherit = m.group("InterfaceSupers") @@ -398,7 +398,7 @@ # close all interfaces/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: del classstack[-1] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start module_name = m.group("ModuleName") # remember this module @@ -410,7 +410,7 @@ classstack.append((cur_class, thisindent)) elif m.start("Attribute") >= 0: - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start index = -1 while index >= -len(classstack):
--- a/eric6/Utilities/ClassBrowsers/protoclbr.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/protoclbr.py Sat Apr 10 18:31:17 2021 +0200 @@ -299,7 +299,7 @@ meth_return = meth_return and meth_return.replace('\\\n', '') or '' meth_return = _commentsub('', meth_return) meth_return = _normalize(' ', meth_return) - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start # close all interfaces/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: @@ -333,7 +333,7 @@ # we found a message definition thisindent = indent indent += 1 - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start message_name = m.group("MessageName") # close all messages/services indented at least as much @@ -357,7 +357,7 @@ # close all messages/services indented at least as much while classstack and classstack[-1][1] >= thisindent: del classstack[-1] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start enum_name = m.group("EnumName") # remember this Enum @@ -378,7 +378,7 @@ # close all messages/services indented at least as much while classstack and classstack[-1][1] >= thisindent: del classstack[-1] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start service_name = m.group("ServiceName") # remember this Service
--- a/eric6/Utilities/ClassBrowsers/pyclbr.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/pyclbr.py Sat Apr 10 18:31:17 2021 +0200 @@ -463,7 +463,7 @@ meth_ret = m.group("MethodReturnAnnotation") meth_ret = meth_ret.replace('\\\n', '') meth_ret = _commentsub('', meth_ret) - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if modifierType and modifierIndent == thisindent: if modifierType == "@staticmethod": @@ -535,7 +535,7 @@ # close all classes indented at least as much while classstack and classstack[-1][1] >= thisindent: del classstack[-1] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start class_name = m.group("ClassName") inherit = m.group("ClassSupers") @@ -561,8 +561,7 @@ c = c[-1] if m in _modules: d = _modules[m] - if c in d: - n = d[c] + n = d.get(c, n) names.append(n) inherit = names # modify indentation level for conditional defines @@ -600,7 +599,7 @@ classstack.append((cur_class, thisindent)) elif m.start("Attribute") >= 0: - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start index = -1 while index >= -len(classstack): @@ -617,14 +616,14 @@ elif m.start("Main") >= 0: # 'main' part of the script, reset class stack - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start classstack = [] elif m.start("Variable") >= 0: thisindent = _indent(m.group("VariableIndent")) variable_name = m.group("VariableName") - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if thisindent == 0 or not classstack: # global variable, reset class stack first @@ -648,7 +647,7 @@ elif m.start("Publics") >= 0: idents = m.group("Identifiers") - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start pubs = Publics(module, file, lineno, idents) dictionary['__all__'] = pubs @@ -658,7 +657,7 @@ names = [n.strip() for n in "".join(m.group("ImportList").splitlines()) .replace("\\", "").split(',')] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if "@@Import@@" not in dictionary: dictionary["@@Import@@"] = Imports(module, file) @@ -677,7 +676,7 @@ names = [n.strip() for n in "".join(namesLines) .split(',')] - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if "@@Import@@" not in dictionary: dictionary["@@Import@@"] = Imports(module, file) @@ -696,7 +695,7 @@ elif m.start("CodingLine") >= 0: # a coding statement coding = m.group("Coding") - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if "@@Coding@@" not in dictionary: dictionary["@@Coding@@"] = ClbrBaseClasses.Coding(
--- a/eric6/Utilities/ClassBrowsers/rbclbr.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/rbclbr.py Sat Apr 10 18:31:17 2021 +0200 @@ -330,7 +330,7 @@ meth_sig = m.group("MethodSignature") meth_sig = meth_sig and meth_sig.replace('\\\n', '') or '' meth_sig = _commentsub('', meth_sig) - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if meth_name.startswith('self.'): meth_name = meth_name[5:] @@ -397,7 +397,7 @@ # we found a class definition thisindent = indent indent += 1 - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start # close all classes/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: @@ -442,7 +442,7 @@ # we found a module definition thisindent = indent indent += 1 - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start # close all classes/modules indented at least as much while classstack and classstack[-1][1] >= thisindent: @@ -521,7 +521,7 @@ index -= 1 elif m.start("Attribute") >= 0: - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start index = -1 while index >= -len(classstack): @@ -541,7 +541,7 @@ lastGlobalEntry = None elif m.start("Attr") >= 0: - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start index = -1 while index >= -len(classstack): @@ -608,7 +608,7 @@ elif m.start("CodingLine") >= 0: # a coding statement coding = m.group("Coding") - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if "@@Coding@@" not in dictionary: dictionary["@@Coding@@"] = ClbrBaseClasses.Coding(
--- a/eric6/Utilities/FtpUtilities.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/FtpUtilities.py Sat Apr 10 18:31:17 2021 +0200 @@ -253,7 +253,7 @@ if hour == 12 and am_pm == 'A': hour = 0 if hour != 12 and am_pm == 'P': - hour = hour + 12 + hour += 12 lastModified = QDateTime(QDate(year, month, day), QTime(hour, minute)) urlInfo.setLastModified(lastModified)
--- a/eric6/Utilities/__init__.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/Utilities/__init__.py Sat Apr 10 18:31:17 2021 +0200 @@ -1235,7 +1235,7 @@ for name in dirs[:]: if not os.path.islink(name): - dirs = dirs + getDirs(name, excludeDirs) + dirs += getDirs(name, excludeDirs) return dirs
--- a/eric6/WebBrowser/Download/DownloadManager.py Sat Apr 10 17:54:58 2021 +0200 +++ b/eric6/WebBrowser/Download/DownloadManager.py Sat Apr 10 18:31:17 2021 +0200 @@ -617,7 +617,7 @@ remaining = progressData[1] progress += progressData[0] speed += progressData[2] - progress = progress / len(progresses) + progress /= len(progresses) if self.isVisible(): self.infoLabel.setText(self.tr(