Fri, 09 Apr 2021 18:38:01 +0200
Applied some more code simplifications suggested by the new Simplify checker.
--- a/eric6.epj Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6.epj Fri Apr 09 18:38:01 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", + "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", "FixCodes": "", "FixIssues": false, "FutureChecker": "",
--- a/eric6/DataViews/CodeMetrics.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DataViews/CodeMetrics.py Fri Apr 09 18:38:01 2021 +0200 @@ -31,7 +31,7 @@ EMPTY = tokenize.NL -class Token(object): +class Token: """ Class to store the token related infos. """ @@ -44,7 +44,7 @@ self.__dict__.update(kw) -class Parser(object): +class Parser: """ Class used to parse the source code of a Python file. """ @@ -102,7 +102,7 @@ spacer = ' ' -class SourceStat(object): +class SourceStat: """ Class used to calculate and store the source code statistics. """
--- a/eric6/DataViews/CodeMetricsDialog.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DataViews/CodeMetricsDialog.py Fri Apr 09 18:38:01 2021 +0200 @@ -169,15 +169,13 @@ total = collections.defaultdict(int) CodeMetrics.summarize(total, 'files', len(files)) - progress = 0 - try: # disable updates of the list for speed self.resultList.setUpdatesEnabled(False) self.resultList.setSortingEnabled(False) # now go through all the files - for file in files: + for progress, file in enumerate(files, start=1): if self.cancelled: return @@ -193,7 +191,6 @@ self.__createResultItem(fitm, [identifier] + v) self.resultList.expandItem(fitm) - progress += 1 self.checkProgress.setValue(progress) QApplication.processEvents() finally:
--- a/eric6/DataViews/PyCoverageDialog.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DataViews/PyCoverageDialog.py Fri Apr 09 18:38:01 2021 +0200 @@ -186,7 +186,6 @@ total_exceptions = 0 cover.exclude(self.excludeList[0]) - progress = 0 try: # disable updates of the list for speed @@ -194,7 +193,7 @@ self.resultList.setSortingEnabled(False) # now go through all the files - for file in files: + for progress, file in enumerate(files, start=1): if self.cancelled: return @@ -217,7 +216,6 @@ except CoverageException: total_exceptions += 1 - progress += 1 self.checkProgress.setValue(progress) QApplication.processEvents() finally: @@ -359,14 +357,12 @@ 0, len(files), self.tr("%v/%m Files"), self) progress.setMinimumDuration(0) progress.setWindowTitle(self.tr("Coverage")) - count = 0 - for file in files: + for count, file in enumerate(files): progress.setValue(count) if progress.wasCanceled(): break cover.annotate([file], None) # , True) - count += 1 progress.setValue(len(files))
--- a/eric6/DataViews/PyProfileDialog.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DataViews/PyProfileDialog.py Fri Apr 09 18:38:01 2021 +0200 @@ -163,7 +163,6 @@ self.checkProgress.setMaximum(len(self.stats)) QApplication.processEvents() - progress = 0 total_calls = 0 prim_calls = 0 total_tt = 0 @@ -174,7 +173,9 @@ self.resultList.setSortingEnabled(False) # now go through all the files - for func, (cc, nc, tt, ct, _callers) in list(self.stats.items()): + for progress, (func, (cc, nc, tt, ct, _callers)) in enumerate( + list(self.stats.items()), start=1 + ): if self.cancelled: return @@ -207,7 +208,6 @@ self.__createResultItem(c, tt, tpc, ct, cpc, func[0], func[1], func[2]) - progress += 1 self.checkProgress.setValue(progress) QApplication.processEvents() finally:
--- a/eric6/DebugClients/Python/AsyncFile.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/AsyncFile.py Fri Apr 09 18:38:01 2021 +0200 @@ -31,7 +31,7 @@ return pending -class AsyncFile(object): +class AsyncFile: """ Class wrapping a socket object with a file interface. """
--- a/eric6/DebugClients/Python/DebugBase.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/DebugBase.py Fri Apr 09 18:38:01 2021 +0200 @@ -53,7 +53,7 @@ gRecursionLimit = limit -class DebugBase(object): +class DebugBase: """ Class implementing base class of the debugger.
--- a/eric6/DebugClients/Python/DebugClientBase.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/DebugClientBase.py Fri Apr 09 18:38:01 2021 +0200 @@ -107,7 +107,7 @@ ############################################################################### -class DebugClientBase(object): +class DebugClientBase: """ Class implementing the client side of the debugger.
--- a/eric6/DebugClients/Python/DebugVariables.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/DebugVariables.py Fri Apr 09 18:38:01 2021 +0200 @@ -18,7 +18,7 @@ ############################################################ -class BaseResolver(object): +class BaseResolver: """ Base class of the resolver class tree. """
--- a/eric6/DebugClients/Python/FlexCompleter.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/FlexCompleter.py Fri Apr 09 18:38:01 2021 +0200 @@ -54,7 +54,7 @@ __all__ = ["Completer"] -class Completer(object): +class Completer: """ Class implementing the command line completer object. """
--- a/eric6/DebugClients/Python/ModuleLoader.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/ModuleLoader.py Fri Apr 09 18:38:01 2021 +0200 @@ -15,7 +15,7 @@ from MultiprocessingExtension import patchMultiprocessing -class ModuleLoader(object): +class ModuleLoader: """ Class implementing an import hook patching modules to support debugging. """
--- a/eric6/DebugClients/Python/ThreadExtension.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DebugClients/Python/ThreadExtension.py Fri Apr 09 18:38:01 2021 +0200 @@ -18,7 +18,7 @@ _qtThreadNumber = 1 -class ThreadExtension(object): +class ThreadExtension: """ Class implementing the thread support for the debugger.
--- a/eric6/Debugger/VariablesViewer.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Debugger/VariablesViewer.py Fri Apr 09 18:38:01 2021 +0200 @@ -28,7 +28,7 @@ SORT_ROLE = Qt.ItemDataRole.UserRole -class VariableItem(object): +class VariableItem: """ Class implementing the data structure for all variable items. """
--- a/eric6/DocumentationTools/APIGenerator.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DocumentationTools/APIGenerator.py Fri Apr 09 18:38:01 2021 +0200 @@ -8,7 +8,7 @@ """ -class APIGenerator(object): +class APIGenerator: """ Class implementing the builtin documentation generator. """
--- a/eric6/DocumentationTools/IndexGenerator.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DocumentationTools/IndexGenerator.py Fri Apr 09 18:38:01 2021 +0200 @@ -14,7 +14,7 @@ from Utilities import joinext -class IndexGenerator(object): +class IndexGenerator: """ Class implementing the index generator for the builtin documentation generator.
--- a/eric6/DocumentationTools/ModuleDocumentor.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DocumentationTools/ModuleDocumentor.py Fri Apr 09 18:38:01 2021 +0200 @@ -55,7 +55,7 @@ pass -class ModuleDocument(object): +class ModuleDocument: """ Class implementing the builtin documentation generator. """
--- a/eric6/DocumentationTools/QtHelpGenerator.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/DocumentationTools/QtHelpGenerator.py Fri Apr 09 18:38:01 2021 +0200 @@ -55,7 +55,7 @@ HelpCollectionFile = 'collection.qhc' -class QtHelpGenerator(object): +class QtHelpGenerator: """ Class implementing the QtHelp generator for the builtin documentation generator.
--- a/eric6/E5Gui/E5ToolBarDialog.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Gui/E5ToolBarDialog.py Fri Apr 09 18:38:01 2021 +0200 @@ -21,7 +21,7 @@ import UI.PixmapCache -class E5ToolBarItem(object): +class E5ToolBarItem: """ Class storing data belonging to a toolbar entry of the toolbar dialog. """
--- a/eric6/E5Network/E5Ftp.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Network/E5Ftp.py Fri Apr 09 18:38:01 2021 +0200 @@ -39,7 +39,7 @@ pass -class E5FtpProxyType(object): +class E5FtpProxyType: """ Class defining the supported FTP proxy types. """
--- a/eric6/E5Network/E5NetworkProxyFactory.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Network/E5NetworkProxyFactory.py Fri Apr 09 18:38:01 2021 +0200 @@ -70,7 +70,7 @@ proxy.setPassword(password) -class HostnameMatcher(object): +class HostnameMatcher: """ Class implementing a matcher for host names. """
--- a/eric6/E5Network/E5TldExtractor.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Network/E5TldExtractor.py Fri Apr 09 18:38:01 2021 +0200 @@ -21,7 +21,7 @@ from E5Gui import E5MessageBox -class E5TldHostParts(object): +class E5TldHostParts: """ Class implementing the host parts helper. """
--- a/eric6/E5Network/E5UrlInfo.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Network/E5UrlInfo.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from PyQt5.QtCore import QDateTime -class E5UrlInfo(object): +class E5UrlInfo: """ Class implementing a replacement for QUrlInfo. """
--- a/eric6/E5Utilities/E5Cache.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/E5Utilities/E5Cache.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from PyQt5.QtCore import QDateTime, QTimer -class E5Cache(object): +class E5Cache: """ Class implementing a LRU cache of a specific size.
--- a/eric6/Graphics/UMLItem.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Graphics/UMLItem.py Fri Apr 09 18:38:01 2021 +0200 @@ -14,7 +14,7 @@ import Preferences -class UMLModel(object): +class UMLModel: """ Class implementing the UMLModel base class. """
--- a/eric6/HexEdit/HexEditChunks.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/HexEdit/HexEditChunks.py Fri Apr 09 18:38:01 2021 +0200 @@ -12,7 +12,7 @@ from PyQt5.QtCore import QBuffer, QIODevice, QByteArray -class HexEditChunk(object): +class HexEditChunk: """ Class implementing a container for the data chunks. """ @@ -25,7 +25,7 @@ self.absPos = 0 -class HexEditChunks(object): +class HexEditChunks: """ Class implementing the storage backend for the hex editor.
--- a/eric6/Network/IRC/IrcNetworkManager.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Network/IRC/IrcNetworkManager.py Fri Apr 09 18:38:01 2021 +0200 @@ -17,7 +17,7 @@ import Preferences -class IrcIdentity(object): +class IrcIdentity: """ Class implementing the IRC identity object. """ @@ -280,7 +280,7 @@ return identity -class IrcServer(object): +class IrcServer: """ Class implementing the IRC identity object. """ @@ -387,7 +387,7 @@ return pwConvert(self.__password, encode=False) -class IrcChannel(object): +class IrcChannel: """ Class implementing the IRC channel object. """ @@ -465,7 +465,7 @@ self.__autoJoin = enable -class IrcNetwork(object): +class IrcNetwork: """ Class implementing the IRC network object. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/AnnotationsChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ import AstUtilities -class AnnotationsChecker(object): +class AnnotationsChecker: """ Class implementing a checker for function type annotations. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleFixer.py Fri Apr 09 18:38:01 2021 +0200 @@ -38,7 +38,7 @@ ] -class CodeStyleFixer(object): +class CodeStyleFixer: """ Class implementing a fixer for certain code style issues. """ @@ -2039,7 +2039,7 @@ return (1, "FIXW603", [], 0) -class Reindenter(object): +class Reindenter: """ Class to reindent badly-indented code to uniformly use four-space indentation. @@ -2237,7 +2237,7 @@ return i -class IndentationWrapper(object): +class IndentationWrapper: """ Class used by fixers dealing with indentation. @@ -2464,7 +2464,7 @@ return valid_indents -class LineShortener(object): +class LineShortener: """ Class used to shorten lines to a given maximum of characters. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from .mccabe import PathGraphingAstVisitor -class ComplexityChecker(object): +class ComplexityChecker: """ Class implementing a checker for code complexity. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/DocStyleChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -22,7 +22,7 @@ ast.AsyncFunctionDef = ast.FunctionDef -class DocStyleContext(object): +class DocStyleContext: """ Class implementing the source context. """ @@ -116,7 +116,7 @@ return self.__special -class DocStyleChecker(object): +class DocStyleChecker: """ Class implementing a checker for documentation string conventions. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/MiscellaneousChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -39,7 +39,7 @@ yield node.id -class MiscellaneousChecker(object): +class MiscellaneousChecker: """ Class implementing a checker for miscellaneous checks. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Naming/NamingStyleChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -18,7 +18,7 @@ ast.AsyncFunctionDef = ast.FunctionDef -class NamingStyleChecker(object): +class NamingStyleChecker: """ Class implementing a checker for naming conventions. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/PathLib/PathlibChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/PathLib/PathlibChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -12,7 +12,7 @@ import copy -class PathlibChecker(object): +class PathlibChecker: """ Class implementing a checker for functions that can be replaced by use of the pathlib module.
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoXssVulnerability.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/djangoXssVulnerability.py Fri Apr 09 18:38:01 2021 +0200 @@ -113,7 +113,7 @@ ) -class DeepAssignation(object): +class DeepAssignation: """ Class to perform a deep analysis of an assign. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -14,7 +14,7 @@ from .SecurityNodeVisitor import SecurityNodeVisitor -class SecurityChecker(object): +class SecurityChecker: """ Class implementing a checker for security issues. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityContext.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityContext.py Fri Apr 09 18:38:01 2021 +0200 @@ -24,7 +24,7 @@ from . import SecurityUtils -class SecurityContext(object): +class SecurityContext: """ Class implementing a context class for security related checks. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityNodeVisitor.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityNodeVisitor.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from .SecurityContext import SecurityContext -class SecurityNodeVisitor(object): +class SecurityNodeVisitor: """ Class implementing an AST node visitor for security checks. """
--- a/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/CodeStyleChecker/Simplify/SimplifyChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from .SimplifyNodeVisitor import SimplifyNodeVisitor -class SimplifyChecker(object): +class SimplifyChecker: """ Class implementing a checker for to help simplifying Python code. """
--- a/eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py Fri Apr 09 18:38:01 2021 +0200 @@ -12,7 +12,7 @@ """ -class Message(object): +class Message(): """ Class defining the base for all specific message classes. """
--- a/eric6/Plugins/VcsPlugins/vcsGit/GitDiffParser.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsGit/GitDiffParser.py Fri Apr 09 18:38:01 2021 +0200 @@ -11,7 +11,7 @@ import os -class GitDiffParser(object): +class GitDiffParser: """ Class implementing a class to store and parse diff output. """
--- a/eric6/Plugins/VcsPlugins/vcsPySvn/SvnDialogMixin.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Plugins/VcsPlugins/vcsPySvn/SvnDialogMixin.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from E5Gui.E5OverrideCursor import E5OverridenCursor -class SvnDialogMixin(object): +class SvnDialogMixin: """ Class implementing a dialog mixin providing common callback methods for the pysvn client.
--- a/eric6/Preferences/__init__.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Preferences/__init__.py Fri Apr 09 18:38:01 2021 +0200 @@ -50,7 +50,7 @@ from QScintilla.Shell import ShellHistoryStyle -class Prefs(object): +class Prefs: """ A class to hold all configuration items for the application. """
--- a/eric6/Project/ProjectBrowser.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Project/ProjectBrowser.py Fri Apr 09 18:38:01 2021 +0200 @@ -311,12 +311,12 @@ self.psBrowser.selectFile(fn) elif self.project.isProjectForm(fn): self.pfBrowser.selectFile(fn) + elif self.project.isProjectResource(fn): + self.prBrowser.selectFile(fn) elif self.project.isProjectInterface(fn): self.piBrowser.selectFile(fn) elif self.project.isProjectProtocol(fn): self.ppBrowser.selectFile(fn) - elif self.project.isProjectProtocol(fn): - self.ppBrowser.selectFile(fn) def handleEditorLineChanged(self, fn, lineno): """ @@ -327,10 +327,10 @@ """ if ( Preferences.getProject("FollowEditor") and - Preferences.getProject("FollowCursorLine") + Preferences.getProject("FollowCursorLine") and + self.project.isProjectSource(fn) ): - if self.project.isProjectSource(fn): - self.psBrowser.selectFileLine(fn, lineno) + self.psBrowser.selectFileLine(fn, lineno) def getProjectBrowsers(self): """ @@ -351,22 +351,15 @@ interfaces, protocols, others". @return reference to the requested browser or None """ - if name == "sources": - return self.psBrowser - elif name == "forms": - return self.pfBrowser - elif name == "resources": - return self.prBrowser - elif name == "translations": - return self.ptBrowser - elif name == "interfaces": - return self.piBrowser - elif name == "protocols": - return self.ppBrowser - elif name == "others": - return self.poBrowser - else: - return None + return { + "sources": self.psBrowser, + "forms": self.pfBrowser, + "resources": self.prBrowser, + "translations": self.ptBrowser, + "interfaces": self.piBrowser, + "protocols": self.ppBrowser, + "others": self.poBrowser, + }.get(name, None) def getProjectBrowserNames(self): """
--- a/eric6/Project/ProjectBrowserModel.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Project/ProjectBrowserModel.py Fri Apr 09 18:38:01 2021 +0200 @@ -37,7 +37,7 @@ ProjectBrowserProtocolsType = 7 -class ProjectBrowserItemMixin(object): +class ProjectBrowserItemMixin: """ Class implementing common methods of project browser items.
--- a/eric6/QScintilla/DocstringGenerator/BaseDocstringGenerator.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/QScintilla/DocstringGenerator/BaseDocstringGenerator.py Fri Apr 09 18:38:01 2021 +0200 @@ -35,7 +35,7 @@ return indent -class BaseDocstringGenerator(object): +class BaseDocstringGenerator: """ Class implementing a docstring generator base class. """ @@ -161,7 +161,7 @@ return [] -class FunctionInfo(object): +class FunctionInfo: """ Class implementing an object to store function information.
--- a/eric6/QScintilla/Lexers/Lexer.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/QScintilla/Lexers/Lexer.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ import Preferences -class Lexer(object): +class Lexer: """ Class to implement the lexer mixin class. """
--- a/eric6/QScintilla/MarkupProviders/MarkupBase.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/QScintilla/MarkupProviders/MarkupBase.py Fri Apr 09 18:38:01 2021 +0200 @@ -8,7 +8,7 @@ """ -class MarkupBase(object): +class MarkupBase: """ Class implementing the base class for the markup providers.
--- a/eric6/Tasks/TaskFilter.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Tasks/TaskFilter.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from .Task import Task -class TaskFilter(object): +class TaskFilter: """ Class implementing a filter for tasks. """
--- a/eric6/Toolbox/SingleApplication.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Toolbox/SingleApplication.py Fri Apr 09 18:38:01 2021 +0200 @@ -120,7 +120,7 @@ raise RuntimeError("'handleCommand' must be overridden") -class SingleApplicationClient(object): +class SingleApplicationClient: """ Class implementing the single application client base class. """
--- a/eric6/Tools/TRPreviewer.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Tools/TRPreviewer.py Fri Apr 09 18:38:01 2021 +0200 @@ -431,7 +431,7 @@ self.translations.reload() -class Translation(object): +class Translation: """ Class to store the properties of a translation. """
--- a/eric6/UI/BrowserModel.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/UI/BrowserModel.py Fri Apr 09 18:38:01 2021 +0200 @@ -860,7 +860,7 @@ self.endInsertRows() -class BrowserItem(object): +class BrowserItem: """ Class implementing the data structure for browser items. """
--- a/eric6/UI/PixmapCache.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/UI/PixmapCache.py Fri Apr 09 18:38:01 2021 +0200 @@ -13,7 +13,7 @@ from PyQt5.QtGui import QPixmap, QIcon, QPainter -class PixmapCache(object): +class PixmapCache: """ Class implementing a pixmap cache for icons. """
--- a/eric6/UI/SplashScreen.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/UI/SplashScreen.py Fri Apr 09 18:38:01 2021 +0200 @@ -55,7 +55,7 @@ QApplication.processEvents() -class NoneSplashScreen(object): +class NoneSplashScreen: """ Class implementing a "None" splashscreen for eric.
--- a/eric6/Utilities/BackgroundClient.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/BackgroundClient.py Fri Apr 09 18:38:01 2021 +0200 @@ -19,7 +19,7 @@ from zlib import adler32 -class BackgroundClient(object): +class BackgroundClient: """ Class implementing the main part of the background client. """
--- a/eric6/Utilities/ClassBrowsers/ClbrBaseClasses.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/ClbrBaseClasses.py Fri Apr 09 18:38:01 2021 +0200 @@ -8,7 +8,7 @@ """ -class _ClbrBase(object): +class _ClbrBase: """ Class implementing the base of all class browser objects. """ @@ -153,7 +153,7 @@ self.classes[name] = _class -class ClbrVisibilityMixinBase(object): +class ClbrVisibilityMixinBase: """ Class implementing the base class of all visibility mixins. """
--- a/eric6/Utilities/ClassBrowsers/jsclbr.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/jsclbr.py Fri Apr 09 18:38:01 2021 +0200 @@ -75,7 +75,7 @@ VisibilityMixin.__init__(self) -class Visitor(object): +class Visitor: """ Class implementing a visitor going through the parsed tree. """
--- a/eric6/Utilities/ClassBrowsers/pyclbr.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/ClassBrowsers/pyclbr.py Fri Apr 09 18:38:01 2021 +0200 @@ -215,7 +215,7 @@ VisibilityMixin.__init__(self) -class Publics(object): +class Publics: """ Class to represent the list of public identifiers. """ @@ -236,7 +236,7 @@ for e in idents.split(',')] -class Imports(object): +class Imports: """ Class to represent the list of imported modules. """ @@ -289,7 +289,7 @@ return self.imports -class ImportedModule(object): +class ImportedModule: """ Class to represent an imported module. """
--- a/eric6/Utilities/ModuleParser.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/ModuleParser.py Fri Apr 09 18:38:01 2021 +0200 @@ -349,7 +349,7 @@ _modules = {} # cache of modules we've seen -class VisibilityBase(object): +class VisibilityBase: """ Class implementing the visibility aspect of all objects. """ @@ -396,7 +396,7 @@ self.visibility = 2 -class Module(object): +class Module: """ Class to represent a Python module. """ @@ -593,7 +593,7 @@ ) else: meth_pyqtSig = None - 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": @@ -708,7 +708,7 @@ elif m.start("Class") >= 0: # we found a class definition thisindent = _indent(m.group("ClassIndent")) - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start # close all classes indented at least as much while classstack and classstack[-1][1] >= thisindent: @@ -772,7 +772,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): @@ -788,7 +788,7 @@ 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 = [] @@ -796,7 +796,7 @@ thisindent = _indent(m.group("VariableIndent")) variable_name = m.group("VariableName") isSignal = m.group("VariableSignal") != "" - lineno = lineno + src.count('\n', last_lineno_pos, start) + lineno += src.count('\n', last_lineno_pos, start) last_lineno_pos = start if thisindent == 0: # global variable @@ -863,9 +863,8 @@ conditionalsstack.append(thisindent) deltaindentcalculated = 0 - elif m.start("Comment") >= 0: - if modulelevel: - continue + elif m.start("Comment") >= 0 and modulelevel: + continue modulelevel = False @@ -901,7 +900,7 @@ ) meth_sig = m.group("MethodSignature") meth_sig = meth_sig and meth_sig.replace('\\\n', '') or '' - 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:] @@ -969,20 +968,11 @@ if cur_obj: cur_obj.addDescription(contents) - elif m.start("String") >= 0: - pass - - elif m.start("Comment") >= 0: - pass - - elif m.start("ClassIgnored") >= 0: - pass - elif m.start("Class") >= 0: # 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: @@ -1033,7 +1023,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: @@ -1110,7 +1100,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): @@ -1140,7 +1130,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): @@ -1206,7 +1196,12 @@ else: indent = 0 - elif m.start("BeginEnd") >= 0: + elif ( + m.start("String") >= 0 or + m.start("Comment") >= 0 or + m.start("ClassIgnored") >= 0 or + m.start("BeginEnd") >= 0 + ): pass def createHierarchy(self): @@ -1656,18 +1651,24 @@ pathname = os.path.join(p, name) if ext == '.ptl': # Quixote page template - return (open(pathname), pathname, - # __IGNORE_WARNING_Y115__ - ('.ptl', 'r', PTL_SOURCE)) + return ( + open(pathname), pathname, + # __IGNORE_WARNING_Y115__ + ('.ptl', 'r', PTL_SOURCE) + ) elif ext == '.rb': # Ruby source file - return (open(pathname), pathname, - # __IGNORE_WARNING_Y115__ - ('.rb', 'r', RB_SOURCE)) + return ( + open(pathname), pathname, + # __IGNORE_WARNING_Y115__ + ('.rb', 'r', RB_SOURCE) + ) else: - return (open(pathname), pathname, - # __IGNORE_WARNING_Y115__ - (ext, 'r', PY_SOURCE)) + return ( + open(pathname), pathname, + # __IGNORE_WARNING_Y115__ + (ext, 'r', PY_SOURCE) + ) raise ImportError # standard Python module file
--- a/eric6/Utilities/PasswordChecker.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/PasswordChecker.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ import re -class PasswordChecker(object): +class PasswordChecker: """ Class implementing a checker for password strength. """
--- a/eric6/Utilities/crypto/py3AES.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/Utilities/crypto/py3AES.py Fri Apr 09 18:38:01 2021 +0200 @@ -58,7 +58,7 @@ return b[:-numpads] -class AES(object): +class AES: """ Class implementing the Advanced Encryption Standard algorithm. """ @@ -609,7 +609,7 @@ return output -class AESModeOfOperation(object): +class AESModeOfOperation: """ Class implementing the different AES mode of operations. """
--- a/eric6/ViewManager/ViewManager.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/ViewManager/ViewManager.py Fri Apr 09 18:38:01 2021 +0200 @@ -4399,11 +4399,7 @@ @return flag indicating successful reset of all dirty flags @rtype bool """ - for editor in self.editors: - if not self.checkDirty(editor): - return False - - return True + return all(self.checkDirty(editor) for editor in self.editors) def checkFileDirty(self, fn): """
--- a/eric6/WebBrowser/AdBlock/AdBlockRule.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/AdBlock/AdBlockRule.py Fri Apr 09 18:38:01 2021 +0200 @@ -76,7 +76,7 @@ ElementHideOption = 16384 -class AdBlockRule(object): +class AdBlockRule: """ Class implementing the AdBlock rule. """ @@ -529,23 +529,18 @@ return True if len(self.__blockedDomains) == 0: - for dom in self.__allowedDomains: - if self.__isMatchingDomain(domain, dom): - return True + return any(self.__isMatchingDomain(domain, dom) + for dom in self.__allowedDomains) elif len(self.__allowedDomains) == 0: - for dom in self.__blockedDomains: - if self.__isMatchingDomain(domain, dom): - return False - return True + return all(not self.__isMatchingDomain(domain, dom) + for dom in self.__blockedDomains) else: - for dom in self.__blockedDomains: - if self.__isMatchingDomain(domain, dom): - return False - for dom in self.__allowedDomains: - if self.__isMatchingDomain(domain, dom): - return True - - return False + return ( + all(not self.__isMatchingDomain(domain, dom) + for dom in self.__blockedDomains) and + any(self.__isMatchingDomain(domain, dom) + for dom in self.__allowedDomains) + ) def matchThirdParty(self, req): """ @@ -987,11 +982,8 @@ if not filterString.endswith("^") or not filterString.startswith("||"): return False - for filterChar in filterString: - if filterChar in ["/", ":", "?", "=", "&", "*"]: - return False - - return True + return all(filterChar not in ["/", ":", "?", "=", "&", "*"] + for filterChar in filterString) def __filterIsOnlyEndsMatch(self, filterString): """ @@ -1003,13 +995,12 @@ @return flag indicating a end of string match filter @rtype bool """ - index = 0 - for filterChar in filterString: + for index, filterChar in enumerate(filterString): + # __IGNORE_WARNING_Y111__ if filterChar in ["^", "*"]: return False elif filterChar == "|": - return bool(index == len(filterString) - 1) - index += 1 + return index == len(filterString) - 1 return False @@ -1046,9 +1037,7 @@ @rtype bool """ if self.__regExp is not None: - for matcher in self.__stringMatchers: - if matcher not in url: - return False + return all(matcher in url for matcher in self.__stringMatchers) return True
--- a/eric6/WebBrowser/AdBlock/AdBlockSearchTree.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/AdBlock/AdBlockSearchTree.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from .AdBlockRule import AdBlockRuleType -class AdBlockSearchTreeNode(object): +class AdBlockSearchTreeNode: """ Class implementing the AdBlock search tree node. """ @@ -23,7 +23,7 @@ self.children = {} -class AdBlockSearchTree(object): +class AdBlockSearchTree: """ Class implementing the AdBlock search tree. """
--- a/eric6/WebBrowser/Bookmarks/BookmarkNode.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/Bookmarks/BookmarkNode.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from PyQt5.QtCore import QDateTime -class BookmarkNode(object): +class BookmarkNode: """ Class implementing the bookmark node type. """
--- a/eric6/WebBrowser/ClosedTabsManager.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/ClosedTabsManager.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from PyQt5.QtCore import pyqtSignal, QUrl, QObject -class ClosedTab(object): +class ClosedTab: """ Class implementing a structure to store data about a closed tab. """
--- a/eric6/WebBrowser/History/HistoryFilterModel.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/History/HistoryFilterModel.py Fri Apr 09 18:38:01 2021 +0200 @@ -12,7 +12,7 @@ from .HistoryModel import HistoryModel -class HistoryData(object): +class HistoryData: """ Class storing some history data. """
--- a/eric6/WebBrowser/History/HistoryManager.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/History/HistoryManager.py Fri Apr 09 18:38:01 2021 +0200 @@ -25,7 +25,7 @@ HISTORY_VERSIONS = [HISTORY_VERSION_60, HISTORY_VERSION_42] -class HistoryEntry(object): +class HistoryEntry: """ Class implementing a history entry. """
--- a/eric6/WebBrowser/Passwords/LoginForm.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/Passwords/LoginForm.py Fri Apr 09 18:38:01 2021 +0200 @@ -10,7 +10,7 @@ from PyQt5.QtCore import QUrl -class LoginForm(object): +class LoginForm: """ Class implementing a data structure for login forms. """
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingThreatList.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingThreatList.py Fri Apr 09 18:38:01 2021 +0200 @@ -8,7 +8,7 @@ """ -class ThreatList(object): +class ThreatList: """ Class implementing the threat list info. """ @@ -60,7 +60,7 @@ return '/'.join(self.asTuple()) -class HashPrefixList(object): +class HashPrefixList: """ Class implementing a container for threat list data. """
--- a/eric6/WebBrowser/SafeBrowsing/SafeBrowsingUrl.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/SafeBrowsing/SafeBrowsingUrl.py Fri Apr 09 18:38:01 2021 +0200 @@ -17,7 +17,7 @@ import Preferences -class SafeBrowsingUrl(object): +class SafeBrowsingUrl: """ Class implementing an URL representation suitable for Google Safe Browsing. """
--- a/eric6/WebBrowser/SpeedDial/Page.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/SpeedDial/Page.py Fri Apr 09 18:38:01 2021 +0200 @@ -8,7 +8,7 @@ """ -class Page(object): +class Page: """ Class to hold the data for a speed dial page. """
--- a/eric6/WebBrowser/Tools/WebHitTestResult.py Fri Apr 09 18:13:36 2021 +0200 +++ b/eric6/WebBrowser/Tools/WebHitTestResult.py Fri Apr 09 18:38:01 2021 +0200 @@ -15,7 +15,7 @@ from PyQt5.QtCore import QPoint, QRect, QUrl -class WebHitTestResult(object): +class WebHitTestResult: """ Class implementing an object for testing certain aspects of a web page. """