Sun, 03 Dec 2023 19:46:34 +0100
Corrected some uses of dict.keys(), dict.values() and dict.items().
--- a/scripts/install.py Sun Dec 03 16:44:52 2023 +0100 +++ b/scripts/install.py Sun Dec 03 19:46:34 2023 +0100 @@ -714,7 +714,7 @@ # set install prefix, if not None if distDir: - for key in list(cfg.keys()): + for key in cfg: cfg[key] = os.path.normpath(os.path.join(distDir, cfg[key].lstrip(os.sep))) try:
--- a/src/eric7/CodeFormatting/IsortConfigurationDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/CodeFormatting/IsortConfigurationDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -91,7 +91,7 @@ self.__tomlButton.clicked.connect(self.__createTomlSnippet) self.profileComboBox.addItem("") - self.profileComboBox.addItems(sorted(profiles.keys())) + self.profileComboBox.addItems(sorted(profiles)) self.pythonComboBox.addItem("", "") self.pythonComboBox.addItem(self.tr("All Versions"), "all")
--- a/src/eric7/DataViews/PyProfileDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/DataViews/PyProfileDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -182,7 +182,7 @@ # now go through all the files now = time.monotonic() for progress, (func, (cc, nc, tt, ct, _callers)) in enumerate( - list(self.stats.items()), start=1 + self.stats.items(), start=1 ): if self.cancelled: return
--- a/src/eric7/DebugClients/Python/DebugVariables.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/DebugClients/Python/DebugVariables.py Sun Dec 03 19:46:34 2023 +0100 @@ -519,7 +519,7 @@ """ d = [] start = count = 0 - allKeys = list(var.keys()) + allKeys = list(var) try: # Fast path: all items from same type allKeys.sort()
--- a/src/eric7/Debugger/DebugServer.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Debugger/DebugServer.py Sun Dec 03 19:46:34 2023 +0100 @@ -426,7 +426,7 @@ @return list of supported languages @rtype list of str """ - languages = list(self.__debuggerInterfaceRegistry.keys()) + languages = list(self.__debuggerInterfaceRegistry) with contextlib.suppress(ValueError): languages.remove("None")
--- a/src/eric7/Debugger/DebuggerInterfacePython.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Debugger/DebuggerInterfacePython.py Sun Dec 03 19:46:34 2023 +0100 @@ -134,7 +134,7 @@ proc = QProcess(self) if environment is not None: env = QProcessEnvironment() - for key, value in list(environment.items()): + for key, value in environment.items(): env.insert(key, value) proc.setProcessEnvironment(env) args = arguments[:] @@ -697,7 +697,7 @@ @return list of connected debugger backend IDs @rtype list of str """ - return sorted(self.__connections.keys()) + return sorted(self.__connections) def __flush(self): """ @@ -1041,7 +1041,7 @@ @param temp flag indicating a temporary breakpoint @type bool """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: self.__sendJsonCommand( "RequestBreakpoint", @@ -1068,7 +1068,7 @@ @param enable flag indicating enabling or disabling a breakpoint @type bool """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: self.__sendJsonCommand( "RequestBreakpointEnable", @@ -1093,7 +1093,7 @@ @param count number of occurrences to ignore @type int """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: self.__sendJsonCommand( "RequestBreakpointIgnore", @@ -1118,7 +1118,7 @@ @param temp flag indicating a temporary watch expression @type bool """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: # cond is combination of cond and special (s. watch expression # viewer) @@ -1143,7 +1143,7 @@ @param enable flag indicating enabling or disabling a watch expression @type bool """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: # cond is combination of cond and special (s. watch expression # viewer) @@ -1168,7 +1168,7 @@ @param count number of occurrences to ignore @type int """ - debuggerList = [debuggerId] if debuggerId else list(self.__connections.keys()) + debuggerList = [debuggerId] if debuggerId else list(self.__connections) for debuggerId in debuggerList: # cond is combination of cond and special (s. watch expression # viewer)
--- a/src/eric7/DocumentationTools/APIGenerator.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/DocumentationTools/APIGenerator.py Sun Dec 03 19:46:34 2023 +0100 @@ -53,7 +53,7 @@ """ bases = {} self.includePrivate = includePrivate - classNames = sorted(self.module.classes.keys()) + classNames = sorted(self.module.classes) for className in classNames: if ( not self.__isPrivate(self.module.classes[className]) @@ -82,7 +82,7 @@ moduleNameStr = "{0}".format(self.moduleName) - for globalName in sorted(self.module.globals.keys()): + for globalName in sorted(self.module.globals): if not self.__isPrivate(self.module.globals[globalName]): if self.module.globals[globalName].isPublic(): iconId = Editor.AttributeID @@ -98,7 +98,7 @@ """ Private method to generate the api section for classes. """ - classNames = sorted(self.module.classes.keys()) + classNames = sorted(self.module.classes) for className in classNames: if not self.__isPrivate(self.module.classes[className]): self.__addClassVariablesAPI(className) @@ -113,7 +113,7 @@ from eric7.QScintilla.Editor import Editor _class = self.module.classes[className] - methods = sorted(_class.methods.keys()) + methods = sorted(_class.methods) if "__init__" in methods: methods.remove("__init__") if _class.isPublic(): @@ -160,7 +160,7 @@ _class = self.module.classes[className] classNameStr = "{0}{1}.".format(self.moduleName, className) - for variable in sorted(_class.globals.keys()): + for variable in sorted(_class.globals): if not self.__isPrivate(_class.globals[variable]): if _class.globals[variable].isPublic(): iconId = Editor.AttributeID @@ -176,7 +176,7 @@ """ from eric7.QScintilla.Editor import Editor - funcNames = sorted(self.module.functions.keys()) + funcNames = sorted(self.module.functions) for funcName in funcNames: if not self.__isPrivate(self.module.functions[funcName]): if self.module.functions[funcName].isPublic():
--- a/src/eric7/DocumentationTools/IndexGenerator.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/DocumentationTools/IndexGenerator.py Sun Dec 03 19:46:34 2023 +0100 @@ -104,7 +104,7 @@ # 1) subpackages if package["subpackages"]: subpacks = package["subpackages"] - names = sorted(subpacks.keys()) + names = sorted(subpacks) lst = [] for name in names: link = FileSystemUtilities.joinext("index-{0}".format(name), ".html") @@ -126,7 +126,7 @@ # 2) modules if package["modules"]: mods = package["modules"] - names = sorted(mods.keys()) + names = sorted(mods) lst = [] for name in names: link = FileSystemUtilities.joinext(name, ".html") @@ -183,7 +183,7 @@ basename = basename.replace(os.sep, ".") if not basename.endswith("."): basename = "{0}.".format(basename) - for package, element in list(self.packages.items()): + for package, element in self.packages.items(): try: if basename: package = package.replace(basename, "")
--- a/src/eric7/DocumentationTools/ModuleDocumentor.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/DocumentationTools/ModuleDocumentor.py Sun Dec 03 19:46:34 2023 +0100 @@ -230,7 +230,7 @@ attrNames = [] scope = class_ if class_ is not None else self.module attrNames = sorted( - attr for attr in scope.globals.keys() if not scope.globals[attr].isSignal + attr for attr in scope.globals if not scope.globals[attr].isSignal ) s = ( "".join( @@ -253,7 +253,7 @@ @return The classes list section. (string) """ - names = sorted(self.module.classes.keys()) + names = sorted(self.module.classes) if names: self.empty = False s = self.__genListSection(names, self.module.classes) @@ -268,7 +268,7 @@ @return The modules list section. (string) """ - names = sorted(self.module.modules.keys()) + names = sorted(self.module.modules) if names: self.empty = False s = self.__genListSection(names, self.module.modules) @@ -283,7 +283,7 @@ @return The functions list section. (string) """ - names = sorted(self.module.functions.keys()) + names = sorted(self.module.functions) if names: self.empty = False s = self.__genListSection(names, self.module.functions) @@ -298,7 +298,7 @@ @return The classes details section. (string) """ - classNames = sorted(self.module.classes.keys()) + classNames = sorted(self.module.classes) classes = [] for className in classNames: _class = self.module.classes[className] @@ -421,7 +421,7 @@ methList = [] methBodies = [] methods = sorted( - k for k in obj.methods.keys() if obj.methods[k].modifier == modifierFilter + k for k in obj.methods if obj.methods[k].modifier == modifierFilter ) if "__init__" in methods: methods.remove("__init__") @@ -501,7 +501,7 @@ @return The Ruby modules details section. (string) """ - rbModulesNames = sorted(self.module.modules.keys()) + rbModulesNames = sorted(self.module.modules) rbModules = [] for rbModuleName in rbModulesNames: rbModule = self.module.modules[rbModuleName] @@ -551,7 +551,7 @@ @return The classes list and classes details section. (tuple of two string) """ - classNames = sorted(obj.classes.keys()) + classNames = sorted(obj.classes) classes = [] for className in classNames: _class = obj.classes[className] @@ -641,7 +641,7 @@ @return The functions details section. (string) """ funcBodies = [] - funcNames = sorted(self.module.functions.keys()) + funcNames = sorted(self.module.functions) for funcName in funcNames: try: funcBody = TemplatesListsStyleCSS.functionTemplate.format( @@ -765,7 +765,7 @@ @return The list section. (string) """ lst = [] - keys = sorted(dictionary.keys()) + keys = sorted(dictionary) for key in keys: lst.append( template.format(
--- a/src/eric7/EricGraphics/EricGraphicsView.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/EricGraphics/EricGraphicsView.py Sun Dec 03 19:46:34 2023 +0100 @@ -254,8 +254,7 @@ starty = sys.maxsize endx = 0 endy = 0 - items = self.filteredItems(list(self.scene().items())) - for itm in items: + for itm in self.filteredItems(self.scene().items()): rect = itm.sceneBoundingRect() itmEndX = rect.x() + rect.width() itmEndY = rect.y() + rect.height() @@ -286,8 +285,7 @@ """ endx = 0 endy = 0 - items = self.filteredItems(list(self.scene().items())) - for itm in items: + for itm in self.filteredItems(self.scene().items()): rect = itm.sceneBoundingRect() itmEndX = rect.x() + rect.width() itmEndY = rect.y() + rect.height() @@ -438,4 +436,4 @@ @return list of interesting collision items (QGraphicsItem) """ # just return the list unchanged - return items + return list(items)
--- a/src/eric7/EricNetwork/EricJsonServer.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/EricNetwork/EricJsonServer.py Sun Dec 03 19:46:34 2023 +0100 @@ -135,7 +135,7 @@ @rtype list of str """ if self.__multiplex: - return list(self.__connections.keys()) + return list(self.__connections) else: return [] @@ -245,7 +245,7 @@ proc.setProcessChannelMode(QProcess.ProcessChannelMode.ForwardedChannels) if environment is not None: env = QProcessEnvironment() - for key, value in list(environment.items()): + for key, value in environment.items(): env.insert(key, value) proc.setProcessEnvironment(env) args = [clientScript, self.__hostAddress, str(self.serverPort())]
--- a/src/eric7/EricWidgets/EricToolBarDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/EricWidgets/EricToolBarDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -107,7 +107,7 @@ self.__widgetActionToToolBarItemID[id(action)] = None categoryItem.setExpanded(True) - for tbID, actions in list(self.__manager.toolBarsActions().items()): + for tbID, actions in self.__manager.toolBarsActions().items(): tb = self.__manager.toolBarById(tbID) default = self.__manager.isDefaultToolBar(tb) tbItem = EricToolBarItem( @@ -453,7 +453,7 @@ self.__removedToolBarIDs = [] # step 2: save configured toolbars - for tbItem in list(self.__toolbarItems.values()): + for tbItem in self.__toolbarItems.values(): if not tbItem.isChanged: continue
--- a/src/eric7/EricWidgets/EricToolBarManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/EricWidgets/EricToolBarManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -101,7 +101,7 @@ @param name object name of the toolbar (string) @return reference to the toolbar (QToolBar) """ - for toolBar in list(self.__allToolBars.values()): + for toolBar in self.__allToolBars.values(): if toolBar.objectName() == name: return toolBar return None @@ -114,12 +114,12 @@ @return reference to the action (QAction) """ # check objectName() first - for action in list(self.__allActions.values()): + for action in self.__allActions.values(): if action.objectName() == name: return action # check text() next - for action in list(self.__allActions.values()): + for action in self.__allActions.values(): if action.text() == name: return action @@ -240,7 +240,7 @@ @param toolBars dictionary with toolbar id as key and a list of actions as value """ - for key, actions in list(toolBars.items()): + for key, actions in toolBars.items(): tb = self.__allToolBars[key] self.setToolBar(tb, actions) @@ -653,7 +653,7 @@ @param actions dictionary with toolbar id as key and a list of widget actions as value """ - for tbID in list(actions.keys())[:]: + for tbID in list(actions): toolBar = self.__allToolBars[tbID] newActions = self.__toolBars[tbID][:] newActionsWithSeparators = self.__toolBarsWithSeparators[tbID][:] @@ -688,7 +688,7 @@ @return list of categories (list of string) """ - return list(self.__categoryToActions.keys()) + return list(self.__categoryToActions) def categoryActions(self, category): """
--- a/src/eric7/Graphics/ApplicationDiagramBuilder.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Graphics/ApplicationDiagramBuilder.py Sun Dec 03 19:46:34 2023 +0100 @@ -180,7 +180,7 @@ modules = self.__buildModulesDict() # step 1: build a dictionary of packages - for module in sorted(modules.keys()): + for module in sorted(modules): if "." in module: packageName, moduleName = module.rsplit(".", 1) else: @@ -191,7 +191,7 @@ packages[packageName] = ([moduleName], []) # step 2: assign modules to dictionaries and update import relationship - for module in sorted(modules.keys()): + for module in sorted(modules): package = module.rsplit(".", 1)[0] impLst = [] for moduleImport in modules[module].imports: @@ -213,7 +213,7 @@ n = "{0}.{1}".format(root, moduleImport) if n in modules: impLst.append(n) - for moduleImport in list(modules[module].from_imports.keys()): + for moduleImport in modules[module].from_imports: if moduleImport.startswith("."): dots = len(moduleImport) - len(moduleImport.lstrip(".")) if dots == 1: @@ -263,7 +263,7 @@ except KeyError: continue - for package in sorted(packages.keys()): + for package in sorted(packages): if package: relPackage = package.replace(root, "") if relPackage and relPackage[0] == ".":
--- a/src/eric7/Graphics/ImportsDiagramBuilder.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Graphics/ImportsDiagramBuilder.py Sun Dec 03 19:46:34 2023 +0100 @@ -160,7 +160,7 @@ externalMods = [] packageList = self.shortPackage.split(".") packageListLen = len(packageList) - for module in sorted(modules.keys()): + for module in sorted(modules): impLst = [] for importName in modules[module].imports: n = ( @@ -174,7 +174,7 @@ impLst.append(n) if n not in externalMods: externalMods.append(n) - for importName in list(modules[module].from_imports.keys()): + for importName in modules[module].from_imports: if importName.startswith("."): dots = len(importName) - len(importName.lstrip(".")) if dots == 1: @@ -200,7 +200,7 @@ externalMods.append(n) classNames = [] - for class_ in list(modules[module].classes.keys()): + for class_ in modules[module].classes: className = modules[module].classes[class_].name if className not in classNames: classNames.append(className)
--- a/src/eric7/Graphics/PackageDiagramBuilder.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Graphics/PackageDiagramBuilder.py Sun Dec 03 19:46:34 2023 +0100 @@ -255,9 +255,9 @@ # step 1: build all classes found in the modules classesFound = False - for modName in list(modules.keys()): + for modName in modules: module = modules[modName] - for cls in list(module.classes.keys()): + for cls in module.classes: classesFound = True self.__addLocalClass(cls, module.classes[cls], 0, 0) if not classesFound and not subpackages: @@ -277,7 +277,7 @@ routes = [] nodes = [] - for modName in list(modules.keys()): + for modName in modules: module = modules[modName] todo = [module.createHierarchy()] while todo: @@ -313,15 +313,14 @@ if hierarchy.get(className): todo.append(hierarchy.get(className)) - children = list(hierarchy.get(className).keys()) - for child in children: + for child in hierarchy.get(className, []): if (className, child) not in routes: routes.append((className, child)) del todo[0] # step 3: build the subpackages - for subpackage in sorted(subpackages.keys()): + for subpackage in sorted(subpackages): self.__addPackage(subpackage, subpackages[subpackage], 0, 0) nodes.append(subpackage) @@ -427,9 +426,9 @@ name = "{0} (Module)".format(name) cl = ClassModel( name, - sorted(_class.methods.keys())[:], - sorted(_class.attributes.keys())[:], - sorted(_class.globals.keys())[:], + sorted(_class.methods), + sorted(_class.attributes), + sorted(_class.globals), ) cw = ClassItem( cl,
--- a/src/eric7/Graphics/UMLClassDiagramBuilder.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Graphics/UMLClassDiagramBuilder.py Sun Dec 03 19:46:34 2023 +0100 @@ -148,8 +148,7 @@ if hierarchy.get(className): todo.append(hierarchy.get(className)) - children = list(hierarchy.get(className).keys()) - for child in children: + for child in hierarchy.get(className, []): if (className, child) not in routes: routes.append((className, child)) @@ -268,9 +267,9 @@ name = "{0} (Module)".format(name) cl = ClassModel( name, - sorted(_class.methods.keys())[:], - sorted(_class.attributes.keys())[:], - sorted(_class.globals.keys())[:], + sorted(_class.methods), + sorted(_class.attributes), + sorted(_class.globals), ) cw = ClassItem( cl,
--- a/src/eric7/HexEdit/HexEditSearchReplaceWidget.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/HexEdit/HexEditSearchReplaceWidget.py Sun Dec 03 19:46:34 2023 +0100 @@ -577,7 +577,7 @@ @exception ValueError raised to indicate an invalid dataFormat parameter """ - if dataFormat not in self.__formatAndValidators.keys(): + if dataFormat not in self.__formatAndValidators: raise ValueError("Bad value for 'dataFormat' parameter.") if dataFormat == "hex": # hex format @@ -608,7 +608,7 @@ @exception ValueError raised to indicate an invalid dataFormat parameter """ - if dataFormat not in self.__formatAndValidators.keys(): + if dataFormat not in self.__formatAndValidators: raise ValueError("Bad value for 'dataFormat' parameter.") if dataFormat == "hex": # hex format
--- a/src/eric7/MicroPython/Devices/CircuitPythonUpdater/CircuitPythonUpdaterInterface.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/MicroPython/Devices/CircuitPythonUpdater/CircuitPythonUpdaterInterface.py Sun Dec 03 19:46:34 2023 +0100 @@ -265,7 +265,7 @@ """ localBundles = circup.get_bundles_local_dict() dlg = EricListSelectionDialog( - sorted(localBundles.keys()), + sorted(localBundles), title=self.tr("Remove Bundles"), message=self.tr("Select the bundles to be removed:"), checkBoxSelection=True, @@ -613,7 +613,7 @@ modNames[moduleItem.replace(".py", "").lower()] = metadata dlg = EricListSelectionDialog( - sorted(modNames.keys()), + sorted(modNames), title=self.tr("Uninstall Modules"), message=self.tr("Select the modules/packages to be uninstalled:"), checkBoxSelection=True,
--- a/src/eric7/MicroPython/MicroPythonFileManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/MicroPython/MicroPythonFileManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -337,8 +337,8 @@ for name, nstat in destinationFiles: destinationDict[name] = nstat - destinationSet = set(destinationDict.keys()) - sourceSet = set(sourceDict.keys()) + destinationSet = set(destinationDict) + sourceSet = set(sourceDict) toAdd = sourceSet - destinationSet # add to dev toDelete = destinationSet - sourceSet # delete from dev toUpdate = destinationSet.intersection(sourceSet) # update files
--- a/src/eric7/MicroPython/UF2FlashDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/MicroPython/UF2FlashDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -674,7 +674,7 @@ if not OSUtilities.isWindowsPlatform(): userMounts = FileSystemUtilities.getUserMounts() - boardTypes = [boardType] if boardType else [*SupportedUF2Boards.keys()] + boardTypes = [boardType] if boardType else list(SupportedUF2Boards) for board in boardTypes: for vidpid, volumes in SupportedUF2Boards[board]["volumes"].items(): for volume, description in volumes: @@ -782,9 +782,7 @@ if len(devices) == 0: # no device set yet devices = [ - d - for d in Devices.getFoundDevices()[0] - if d[0] in SupportedUF2Boards + d for d in Devices.getFoundDevices()[0] if d[0] in SupportedUF2Boards ] self.devicesComboBox.addItem("") self.devicesComboBox.addItem(self.tr("Manual Select"))
--- a/src/eric7/Network/IRC/IrcNetworkManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Network/IRC/IrcNetworkManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -615,7 +615,7 @@ @return list of channel names (list of string) """ - return sorted(self.__channels.keys()) + return sorted(self.__channels) def getChannel(self, channelName): """ @@ -899,7 +899,7 @@ @return names of all identities (list of string) """ - return list(self.__identities.keys()) + return list(self.__identities) def addIdentity(self, identity): """ @@ -1017,4 +1017,4 @@ if not self.__loaded: self.__load() - return sorted(self.__networks.keys()) + return sorted(self.__networks)
--- a/src/eric7/PipInterface/Pip.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/PipInterface/Pip.py Sun Dec 03 19:46:34 2023 +0100 @@ -895,7 +895,7 @@ ) with contextlib.suppress(json.JSONDecodeError, KeyError): data = json.loads(dataStr) - result = list(data["releases"].keys()) + result = list(data["releases"]) return result
--- a/src/eric7/PipInterface/PipVulnerabilityChecker.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/PipInterface/PipVulnerabilityChecker.py Sun Dec 03 19:46:34 2023 +0100 @@ -255,7 +255,7 @@ return VulnerabilityCheckError.SummaryDbUnavailable, [] fullDb = None - vulnerablePackages = frozenset(db.keys()) + vulnerablePackages = frozenset(db) vulnerabilities = collections.defaultdict(list) for package in packages:
--- a/src/eric7/PluginManager/PluginManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/PluginManager/PluginManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -10,6 +10,7 @@ import contextlib import datetime import importlib +import itertools import os import pathlib import sys @@ -176,8 +177,9 @@ """ Public method to finalize the setup of the plugin manager. """ - for module in list(self.__onDemandInactiveModules.values()) + list( - self.__onDemandActiveModules.values() + for module in itertools.chain( + self.__onDemandInactiveModules.values(), + self.__onDemandActiveModules.values(), ): if hasattr(module, "moduleSetup"): module.moduleSetup() @@ -526,7 +528,7 @@ found = False if not package: package = "__None__" - for moduleName in list(sys.modules.keys())[:]: + for moduleName in list(sys.modules): if moduleName == pluginName or moduleName.split(".")[0] in packages: found = True del sys.modules[moduleName] @@ -538,7 +540,7 @@ Note: The plugins are not activated. """ - names = sorted(self.__onDemandInactiveModules.keys()) + names = sorted(self.__onDemandInactiveModules) for name in names: self.initOnDemandPlugin(name) @@ -602,7 +604,7 @@ and self.__develPluginName in inactiveList ): inactiveList.remove(self.__develPluginName) - names = sorted(self.__inactiveModules.keys()) + names = sorted(self.__inactiveModules) for name in names: if name not in inactiveList: self.activatePlugin(name) @@ -791,7 +793,7 @@ @return reference to the initialized plugin object and an error string @rtype tuple of (QObject, str) """ - for name, module in list(self.__onDemandInactiveModules.items()): + for name, module in self.__onDemandInactiveModules.items(): if ( getPluginHeaderEntry(module, "pluginType", "") == type_ and getPluginHeaderEntry(module, "pluginTypename", "") == typename @@ -799,7 +801,7 @@ return self.activatePlugin(name, onDemand=True) if maybeActive: - for name, module in list(self.__onDemandActiveModules.items()): + for name, module in self.__onDemandActiveModules.items(): if ( getPluginHeaderEntry(module, "pluginType", "") == type_ and getPluginHeaderEntry(module, "pluginTypename", "") == typename @@ -822,7 +824,7 @@ infos = [] # 1. active, non-on-demand modules - for name in list(self.__activeModules.keys()): + for name in self.__activeModules: info = self.__getShortInfo(self.__activeModules[name]) info.update( { @@ -834,7 +836,7 @@ infos.append(info) # 2. inactive, non-on-demand modules - for name in list(self.__inactiveModules.keys()): + for name in self.__inactiveModules: info = self.__getShortInfo(self.__inactiveModules[name]) info.update( { @@ -846,7 +848,7 @@ infos.append(info) # 3. active, on-demand modules - for name in list(self.__onDemandActiveModules.keys()): + for name in self.__onDemandActiveModules: info = self.__getShortInfo(self.__onDemandActiveModules[name]) info.update( { @@ -858,7 +860,7 @@ infos.append(info) # 4. inactive, non-on-demand modules - for name in list(self.__onDemandInactiveModules.keys()): + for name in self.__onDemandInactiveModules: info = self.__getShortInfo(self.__onDemandInactiveModules[name]) info.update( { @@ -870,7 +872,7 @@ infos.append(info) # 5. failed modules - for name in list(self.__failedModules.keys()): + for name in self.__failedModules: info = self.__getShortInfo(self.__failedModules[name]) info.update( { @@ -956,7 +958,7 @@ Public method called to perform actions upon shutdown of the IDE. """ names = [] - for name in list(self.__inactiveModules.keys()): + for name in self.__inactiveModules: names.append(name) Preferences.getSettings().setValue(self.__inactivePluginsKey, names) @@ -974,8 +976,9 @@ """ pluginDict = {} - for module in list(self.__onDemandActiveModules.values()) + list( - self.__onDemandInactiveModules.values() + for module in itertools.chain( + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), ): if ( getPluginHeaderEntry(module, "pluginType", "") == type_ @@ -1000,8 +1003,9 @@ @return preview pixmap @rtype QPixmap """ - for module in list(self.__onDemandActiveModules.values()) + list( - self.__onDemandInactiveModules.values() + for module in itertools.chain( + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), ): if ( getPluginHeaderEntry(module, "pluginType", "") == type_ @@ -1025,8 +1029,9 @@ """ apis = [] - for module in list(self.__activeModules.values()) + list( - self.__onDemandActiveModules.values() + for module in itertools.chain( + self.__activeModules.values(), + self.__onDemandActiveModules.values(), ): if hasattr(module, "apiFiles"): apis.extend(module.apiFiles(language)) @@ -1043,8 +1048,9 @@ @rtype dict (key: str, value: list of str) """ helpFiles = {} - for module in list(self.__activeModules.values()) + list( - self.__onDemandActiveModules.values() + for module in itertools.chain( + self.__activeModules.values(), + self.__onDemandActiveModules.values(), ): if hasattr(module, "helpFiles"): helpFiles.update(module.helpFiles()) @@ -1088,15 +1094,11 @@ """ infos = [] - for module in list(self.__activeModules.values()) + list( - self.__inactiveModules.values() - ): - if hasattr(module, "exeDisplayDataList"): - infos.extend(module.exeDisplayDataList()) - elif hasattr(module, "exeDisplayData"): - infos.append(module.exeDisplayData()) - for module in list(self.__onDemandActiveModules.values()) + list( - self.__onDemandInactiveModules.values() + for module in itertools.chain( + self.__activeModules.values(), + self.__inactiveModules.values(), + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), ): if hasattr(module, "exeDisplayDataList"): infos.extend(module.exeDisplayDataList()) @@ -1139,10 +1141,10 @@ @rtype dict """ configData = {} - for module in ( - list(self.__activeModules.values()) - + list(self.__onDemandActiveModules.values()) - + list(self.__onDemandInactiveModules.values()) + for module in itertools.chain( + self.__activeModules.values(), + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), ): if hasattr(module, "getConfigData"): configData.update(module.getConfigData()) @@ -1201,14 +1203,15 @@ """ vcsDict = {} - for module in list(self.__onDemandActiveModules.values()) + list( - self.__onDemandInactiveModules.values() + for module in itertools.chain( + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), ): if getPluginHeaderEntry( module, "pluginType", "" ) == "version_control" and hasattr(module, "getVcsSystemIndicator"): res = module.getVcsSystemIndicator() - for indicator, vcsData in list(res.items()): + for indicator, vcsData in res.items(): if indicator in vcsDict: vcsDict[indicator].append(vcsData) else: @@ -1485,11 +1488,11 @@ @param type_ type of the plugin to clear private data for @type str """ - for module in ( - list(self.__onDemandActiveModules.values()) - + list(self.__onDemandInactiveModules.values()) - + list(self.__activeModules.values()) - + list(self.__inactiveModules.values()) + for module in itertools.chain( + self.__onDemandActiveModules.values(), + self.__onDemandInactiveModules.values(), + self.__activeModules.values(), + self.__inactiveModules.values(), ): if getPluginHeaderEntry(module, "pluginType", "") == type_ and hasattr( module, "clearPrivateData"
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -438,7 +438,7 @@ "FixCodes": "", "FixIssues": False, "EnabledCheckerCategories": ",".join( - CodeStyleCheckerDialog.checkCategories.keys() + CodeStyleCheckerDialog.checkCategories ), "MaxLineLength": 88, # better code formatting than pycodestyle.MAX_LINE_LENGTH @@ -2666,7 +2666,7 @@ self.__options[5] = True self.__options[6] = self.lineLengthSpinBox.value() - self.files = list(fixesDict.keys()) + self.files = list(fixesDict) # now go through all the files self.progress = 0 self.files.sort() @@ -2812,7 +2812,7 @@ enabledCategoriesList = ( [c.strip() for c in enabledCategories.split(",") if bool(c.strip())] if enabledCategories - else list(CodeStyleCheckerDialog.checkCategories.keys()) + else list(CodeStyleCheckerDialog.checkCategories) ) for row in range(self.categoriesList.count()): itm = self.categoriesList.item(row)
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleStatisticsDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -51,7 +51,7 @@ textWrapper = textwrap.TextWrapper(width=80) - for msgCode in sorted(stats.keys()): + for msgCode in sorted(stats): message = getTranslatedMessage(msgCode, [], example=True) if message is None: continue
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py Sun Dec 03 19:46:34 2023 +0100 @@ -213,7 +213,7 @@ @return sorted list of (line, nodes) tuples @rtype list of tuple of (int,int) """ - lst = [(line, self.__count[line]) for line in sorted(self.__count.keys())] + lst = [(line, self.__count[line]) for line in sorted(self.__count)] return lst def score(self): @@ -223,9 +223,8 @@ @return median line complexity value @rtype float """ - lst = self.__count.values() - sortedList = sorted(lst) - listLength = len(lst) + sortedList = sorted(self.__count.values()) + listLength = len(sortedList) medianIndex = (listLength - 1) // 2 if listLength == 0:
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/translations.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Miscellaneous/translations.py Sun Dec 03 19:46:34 2023 +0100 @@ -121,16 +121,15 @@ "M197": QCoreApplication.translate( "MiscellaneousChecker", "unnecessary use of map - use a {0} instead", - ), "M198": QCoreApplication.translate( "MiscellaneousChecker", - "unnecessary {0} passed to dict() - remove the outer call to dict()" + "unnecessary {0} passed to dict() - remove the outer call to dict()", ), "M199": QCoreApplication.translate( "MiscellaneousChecker", "unnecessary list comprehension passed to {0}() prevents short-circuiting" - " - rewrite as a generator" + " - rewrite as a generator", ), ## Dictionaries with sorted keys "M201": QCoreApplication.translate(
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/blackListCalls.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/blackListCalls.py Sun Dec 03 19:46:34 2023 +0100 @@ -196,7 +196,7 @@ """ return { "Call": [ - (checkBlacklist, tuple(_blacklists.keys())), + (checkBlacklist, tuple(_blacklists)), ], }
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/blackListImports.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/blackListImports.py Sun Dec 03 19:46:34 2023 +0100 @@ -62,13 +62,13 @@ """ return { "Import": [ - (checkBlacklist, tuple(_blacklists.keys())), + (checkBlacklist, tuple(_blacklists)), ], "ImportFrom": [ - (checkBlacklist, tuple(_blacklists.keys())), + (checkBlacklist, tuple(_blacklists)), ], "Call": [ - (checkBlacklist, tuple(_blacklists.keys())), + (checkBlacklist, tuple(_blacklists)), ], }
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Unused/UnusedChecker.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Unused/UnusedChecker.py Sun Dec 03 19:46:34 2023 +0100 @@ -423,7 +423,7 @@ if self.__args["IgnoreDunderGlobals"]: # eliminate some special cases - for name in list(errors.keys()): + for name in list(errors): if name.startswith("__") and name.endswith("__"): errors.pop(name)
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/translations.py Sun Dec 03 19:46:34 2023 +0100 @@ -526,7 +526,7 @@ """ knownCodes = [] for catalog in messageCatalogs.values(): - knownCodes += list(catalog.keys()) + knownCodes += list(catalog) return {c.split(".", 1)[0] for c in knownCodes}
--- a/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckService.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/CheckerPlugins/SyntaxChecker/SyntaxCheckService.py Sun Dec 03 19:46:34 2023 +0100 @@ -107,7 +107,7 @@ @return list of languanges supported @rtype list of str """ - return list(self.__supportedLanguages.keys()) + ["MicroPython"] + return list(self.__supportedLanguages) + ["MicroPython"] def removeLanguage(self, lang): """
--- a/src/eric7/Plugins/DocumentationPlugins/Ericapi/EricapiConfigDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/DocumentationPlugins/Ericapi/EricapiConfigDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -48,9 +48,7 @@ self.ignoreDirPicker.setDefaultDirectory(project.getProjectPath()) self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) - for language in sorted( - DocumentationTools.supportedExtensionsDictForApis.keys() - ): + for language in sorted(DocumentationTools.supportedExtensionsDictForApis): self.languagesList.addItem(language) self.ppath = project.getProjectPath()
--- a/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/IbmWatsonEngine.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/IbmWatsonEngine.py Sun Dec 03 19:46:34 2023 +0100 @@ -71,7 +71,7 @@ @return list of supported language codes @rtype list of str """ - return list(self.__availableTranslations.keys()) + return list(self.__availableTranslations) def supportedTargetLanguages(self, original): """
--- a/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/LibreTranslateEngine.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorEngines/LibreTranslateEngine.py Sun Dec 03 19:46:34 2023 +0100 @@ -76,7 +76,7 @@ @return list of supported language codes @rtype list of str """ - return list(self.__availableTranslations.keys()) + return list(self.__availableTranslations) def supportedTargetLanguages(self, original): """
--- a/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorLanguagesDb.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/UiExtensionPlugins/Translator/TranslatorLanguagesDb.py Sun Dec 03 19:46:34 2023 +0100 @@ -172,7 +172,7 @@ @return list of supported language codes @rtype list of str """ - return list(self.__languages.keys()) + return list(self.__languages) def convertTwoToThree(self, code): """
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitFetchDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitFetchDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -40,7 +40,7 @@ self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) - self.remotesComboBox.addItems(sorted(self.__repos.keys())) + self.remotesComboBox.addItems(sorted(self.__repos)) self.remotesComboBox.addItem(self.__all) self.remotesComboBox.addItem(self.__custom)
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitLogBrowserDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -1790,7 +1790,7 @@ shouldReopen = ( self.vcs.gitCherryPick( self.repodir, - [commits[i] for i in sorted(commits.keys(), reverse=True)], + [commits[i] for i in sorted(commits, reverse=True)], ) or pfile.stat().st_mtime != lastModified )
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitPullDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitPullDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -40,7 +40,7 @@ self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) - self.remotesComboBox.addItems(sorted(self.__repos.keys())) + self.remotesComboBox.addItems(sorted(self.__repos)) self.remotesComboBox.addItem(self.__all) self.remotesComboBox.addItem(self.__custom)
--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitPushDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitPushDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -50,7 +50,7 @@ self.__localBranches = self.__vcs.gitGetBranchesList(self.__repodir) - self.remotesComboBox.addItems(sorted(self.__repos.keys())) + self.remotesComboBox.addItems(sorted(self.__repos)) for localBranch in self.__localBranches: itm = QTreeWidgetItem(self.branchesTree, ["", localBranch, "", ""])
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -1442,7 +1442,7 @@ branchFilter = self.__allBranchesFilter self.branchCombo.clear() self.branchCombo.addItems( - [self.__allBranchesFilter] + sorted(self.__branchColors.keys()) + [self.__allBranchesFilter] + sorted(self.__branchColors) ) self.branchCombo.setCurrentIndex(self.branchCombo.findText(branchFilter)) @@ -2338,9 +2338,9 @@ bookmark, ok = QInputDialog.getItem( self, self.tr("Move Bookmark"), - self.tr( - "Select the bookmark to be moved to changeset '{0}':" - ).format(changeset), + self.tr("Select the bookmark to be moved to changeset '{0}':").format( + changeset + ), [""] + bookmarksList, 0, False,
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -74,7 +74,7 @@ self.protocolEditButton.setIcon(EricPixmapCache.getIcon("edit")) self.minimumProtocolComboBox.addItem(self.tr("Default"), "") - for protocol in sorted(self.__minimumProtocols.keys()): + for protocol in sorted(self.__minimumProtocols): self.minimumProtocolComboBox.addItem( self.__minimumProtocols[protocol], protocol )
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostMinimumProtocolDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostMinimumProtocolDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -40,7 +40,7 @@ self.setupUi(self) self.minimumProtocolComboBox.addItem("", "") - for minimumProtocol in sorted(allowedProtocols.keys()): + for minimumProtocol in sorted(allowedProtocols): self.minimumProtocolComboBox.addItem( allowedProtocols[minimumProtocol], minimumProtocol )
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListAllGuardsDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListAllGuardsDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -52,7 +52,7 @@ if line: patchName, guards = line.strip().split(":", 1) guardsDict[patchName] = guards.strip().split() - for patchName in sorted(guardsDict.keys()): + for patchName in sorted(guardsDict): patchItm = QTreeWidgetItem(self.guardsTree, [patchName]) patchItm.setExpanded(True) for guard in guardsDict[patchName]:
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/hg.py Sun Dec 03 19:46:34 2023 +0100 @@ -1007,9 +1007,7 @@ dlg = DeleteFilesConfirmationDialog( self.parent(), self.tr("Re-Merge"), - self.tr( - "Do you really want to re-merge these files or directories?" - ), + self.tr("Do you really want to re-merge these files or directories?"), names, ) yes = dlg.exec() == QDialog.DialogCode.Accepted @@ -1106,7 +1104,7 @@ dname = os.path.normcase(dname) found = False - for name in list(self.statusCache.keys()): + for name in self.statusCache: if name in names: found = True names[name] = self.statusCache[name] @@ -1120,7 +1118,7 @@ if output: repoPath = self.getClient().getRepository() - dirs = [x for x in names.keys() if os.path.isdir(x)] + dirs = [x for x in names if os.path.isdir(x)] for line in output.splitlines(): if line and line[0] in "MARC!?I": flag, path = line.split(" ", 1)
--- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnChangeListsDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -97,7 +97,7 @@ """ Private slot called when the user pressed the button. """ - self.changeLists.addItems(sorted(self.changeListsDict.keys())) + self.changeLists.addItems(sorted(self.changeListsDict)) self.buttonBox.button(QDialogButtonBox.StandardButton.Close).setEnabled(True) self.buttonBox.button(QDialogButtonBox.StandardButton.Cancel).setEnabled(False)
--- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnPropListDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnPropListDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -125,7 +125,7 @@ for name in fnames: proplist = self.client.proplist(name, recurse=recursive) for counter, (path, prop) in enumerate(proplist): - for propName, propVal in list(prop.items()): + for propName, propVal in prop.items(): self.__generateItem(path, propName, propVal) self.propsFound = True if counter % 30 == 0 and self._clientCancelCallback():
--- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py Sun Dec 03 19:46:34 2023 +0100 @@ -135,7 +135,7 @@ self.statusList.append("{0} {1}".format(status, file.path)) except KeyError: self.statusList.append("{0} {1}".format(status, file.path)) - for name in list(self.reportedStates.keys()): + for name in self.reportedStates: if name not in states: self.statusList.append(" {0}".format(name)) self.reportedStates = states
--- a/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsPySvn/subversion.py Sun Dec 03 19:46:34 2023 +0100 @@ -1580,7 +1580,7 @@ allFiles = client.status( dname, recurse=True, get_all=True, ignore=True, update=False ) - dirs = [x for x in names.keys() if os.path.isdir(x)] + dirs = [x for x in names if os.path.isdir(x)] for file in allFiles: name = os.path.normcase(file.path) if self.__isVersioned(file):
--- a/src/eric7/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsSubversion/SvnChangeListsDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -147,7 +147,7 @@ Qt.FocusReason.OtherFocusReason ) else: - self.changeLists.addItems(sorted(self.changeListsDict.keys())) + self.changeLists.addItems(sorted(self.changeListsDict)) self.changeLists.setCurrentRow(0) self.changeLists.setFocus(Qt.FocusReason.OtherFocusReason)
--- a/src/eric7/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py Sun Dec 03 19:46:34 2023 +0100 @@ -116,7 +116,7 @@ self.statusList.append("{0} {1}".format(status, name)) except KeyError: self.statusList.append("{0} {1}".format(status, name)) - for name in list(self.reportedStates.keys()): + for name in self.reportedStates: if name not in states: self.statusList.append(" {0}".format(name)) self.reportedStates = states
--- a/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/VcsPlugins/vcsSubversion/subversion.py Sun Dec 03 19:46:34 2023 +0100 @@ -1457,7 +1457,7 @@ return names found = False - for name in list(self.statusCache.keys()): + for name in self.statusCache: if os.path.dirname(name) == dname: if shortcut: found = True
--- a/src/eric7/Plugins/WizardPlugins/SetupWizard/SetupWizardDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Plugins/WizardPlugins/SetupWizard/SetupWizardDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -594,7 +594,7 @@ entryPoints[itm.data(0, Qt.ItemDataRole.UserRole)][ itm.text(1) ] = itm.text(2) - for epType in list(entryPoints.keys()): + for epType in list(entryPoints): if entryPoints[epType]: entryPoints[epType] = SetupCfgUtilities.toString( entryPoints[epType]
--- a/src/eric7/Preferences/ConfigurationDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -1073,7 +1073,7 @@ # generate the list entries self.__expandedEntries = [] - for key in sorted(self.configItems.keys()): + for key in sorted(self.configItems): pageData = self.configItems[key] if pageData[3]: if pageData[3] in self.itmDict:
--- a/src/eric7/Preferences/ConfigurationPages/EditorAPIsPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorAPIsPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -282,7 +282,7 @@ pathlib.Path(f).name: pathlib.Path(f) for f in pluginAPIFiles } dlg = EricListSelectionDialog( - sorted(pluginAPIFilesDict.keys()), + sorted(pluginAPIFilesDict), title=self.tr("Add from Plugin APIs"), message=self.tr("Select from the list of API files installed by plugins"), checkBoxSelection=True,
--- a/src/eric7/Preferences/ConfigurationPages/EditorExportersPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorExportersPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -37,7 +37,7 @@ self.pageIds["PDF"] = self.stackedWidget.indexOf(self.pdfPage) self.pageIds["RTF"] = self.stackedWidget.indexOf(self.rtfPage) self.pageIds["TeX"] = self.stackedWidget.indexOf(self.texPage) - exporters = sorted(self.pageIds.keys()) + exporters = sorted(self.pageIds) for exporter in exporters: self.exportersCombo.addItem(exporter, self.pageIds[exporter])
--- a/src/eric7/Preferences/ConfigurationPages/EditorHighlightersPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorHighlightersPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -51,7 +51,7 @@ self.extras = ["-----------", self.tr("Alternative")] self.editorLexerCombo.addItem("") self.editorLexerCombo.addItem(EricPixmapCache.getIcon("fileText"), "Text") - for lang in sorted(lexers.keys()): + for lang in sorted(lexers): self.editorLexerCombo.addItem(Lexers.getLanguageIcon(lang, False), lang) self.editorLexerCombo.addItems(self.extras)
--- a/src/eric7/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -92,7 +92,7 @@ self.lexers = lexers # set initial values - languages = sorted([""] + list(self.lexers.keys())) + languages = sorted([""] + list(self.lexers)) self.__populateLanguages(languages) def setMode(self, displayMode): @@ -111,7 +111,7 @@ """ Public slot to save the Editor Highlighting Styles configuration. """ - for lexer in list(self.lexers.values()): + for lexer in self.lexers.values(): lexer.writeSettings() def __populateLanguages(self, languages): @@ -570,7 +570,7 @@ stylesDir = getConfig("ericStylesDir") - lexerNames = list(self.lexers.keys()) + lexerNames = list(self.lexers) if not exportAll: if self.lexer: preselect = [self.lexer.language()]
--- a/src/eric7/Preferences/ConfigurationPages/EditorKeywordsPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorKeywordsPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -42,7 +42,7 @@ } } - languages = sorted([""] + list(Lexers.getSupportedLanguages().keys())) + languages = sorted([""] + list(Lexers.getSupportedLanguages())) self.__populateLanguages(languages) def setMode(self, displayMode):
--- a/src/eric7/Preferences/ConfigurationPages/EditorLanguageTabIndentOverrideDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorLanguageTabIndentOverrideDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -67,7 +67,7 @@ """ from eric7.QScintilla import Lexers - languages = list(Lexers.getSupportedLanguages().keys()) + languages = list(Lexers.getSupportedLanguages()) for lang in filterLanguages: if lang in languages: languages.remove(lang)
--- a/src/eric7/Preferences/ConfigurationPages/EditorPropertiesPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorPropertiesPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -30,7 +30,7 @@ self.setupUi(self) self.setObjectName("EditorPropertiesPage") - self.languages = sorted(list(lexers.keys())[:]) + self.languages = sorted(lexers) # set initial values # All
--- a/src/eric7/Preferences/ConfigurationPages/EditorTypingPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/EditorTypingPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -45,7 +45,7 @@ self.__extensionPages[language] = page self.__pageIds[language] = self.stackedWidget.addWidget(page) - for language in sorted(self.__pageIds.keys()): + for language in sorted(self.__pageIds): self.languageCombo.addItem(language, self.__pageIds[language]) # set initial values
--- a/src/eric7/Preferences/ConfigurationPages/InterfaceLightPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/InterfaceLightPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -122,7 +122,7 @@ locales[locale] = translator.translate( "InterfacePage", "English", "Translate this with your language" ) + " ({0})".format(locale) - localeList = sorted(locales.keys()) + localeList = sorted(locales) try: uiLanguage = Preferences.getUILanguage() if uiLanguage == "None" or uiLanguage is None:
--- a/src/eric7/Preferences/ConfigurationPages/InterfacePage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/InterfacePage.py Sun Dec 03 19:46:34 2023 +0100 @@ -251,7 +251,7 @@ locales[locale] = translator.translate( "InterfacePage", "English", "Translate this with your language" ) + " ({0})".format(locale) - localeList = sorted(locales.keys()) + localeList = sorted(locales) try: uiLanguage = Preferences.getUILanguage() if uiLanguage == "None" or uiLanguage is None:
--- a/src/eric7/Preferences/ConfigurationPages/MicroPythonPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/MicroPythonPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -49,7 +49,7 @@ self.workspacePicker.setMode(EricPathPickerModes.DIRECTORY_MODE) - self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes.keys())) + self.colorSchemeComboBox.addItems(sorted(AnsiColorSchemes)) # populate the chart theme combobox if QChart is not None:
--- a/src/eric7/Preferences/ConfigurationPages/ProjectBrowserPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/ProjectBrowserPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -42,7 +42,7 @@ self.__projectBrowsersLists = {"": []} try: projectTypes = ericApp().getObject("Project").getProjectTypes() - for projectType in sorted(projectTypes.keys()): + for projectType in sorted(projectTypes): self.projectTypeCombo.addItem(projectTypes[projectType], projectType) self.__projectBrowsersLists[ projectType
--- a/src/eric7/Preferences/ConfigurationPages/ViewmanagerPage.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/ConfigurationPages/ViewmanagerPage.py Sun Dec 03 19:46:34 2023 +0100 @@ -35,8 +35,7 @@ self.windowComboBox.clear() currentVm = Preferences.getViewManager() - keys = sorted(self.viewmanagers.keys()) - for key in keys: + for key in sorted(self.viewmanagers): self.windowComboBox.addItem(self.tr(self.viewmanagers[key]), key) currentIndex = self.windowComboBox.findText( self.tr(self.viewmanagers[currentVm])
--- a/src/eric7/Preferences/__init__.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Preferences/__init__.py Sun Dec 03 19:46:34 2023 +0100 @@ -2628,7 +2628,7 @@ if len(keyList) == 0: # build from scratch - for key in list(editorLexerAssocDefaults.keys()): + for key in editorLexerAssocDefaults: editorLexerAssoc[key] = editorLexerAssocDefaults[key] else: for key in keyList: @@ -2638,7 +2638,7 @@ ) # check for new default lexer associations - for key in list(editorLexerAssocDefaults.keys()): + for key in editorLexerAssocDefaults: if key not in editorLexerAssoc: editorLexerAssoc[key] = editorLexerAssocDefaults[key] return editorLexerAssoc @@ -2669,7 +2669,7 @@ (string) @return the requested lexer language (string) """ - for pattern, language in list(getEditorLexerAssocs().items()): + for pattern, language in getEditorLexerAssocs().items(): if fnmatch.fnmatch(filename, pattern): return language @@ -4056,7 +4056,7 @@ Module function to save the reset layout. """ if Prefs.resetLayout: - for key in list(Prefs.geometryDefaults.keys()): + for key in Prefs.geometryDefaults: Prefs.settings.setValue("Geometry/" + key, Prefs.geometryDefaults[key])
--- a/src/eric7/Project/CreateDialogCodeDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Project/CreateDialogCodeDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -121,7 +121,7 @@ classesList = [] vagueClassesList = [] - for klass in list(self.__module.classes.values()): + for klass in self.__module.classes.values(): if not set(klass.super).isdisjoint( CreateDialogCodeDialog.DialogClasses ): @@ -298,7 +298,7 @@ clsName = self.classNameCombo.currentText() if clsName: cls = self.__module.classes[clsName] - for meth in list(cls.methods.values()): + for meth in cls.methods.values(): if meth.name.startswith("on_"): if meth.pyqtSignature is not None: sig = ", ".join(
--- a/src/eric7/Project/LexerAssociationDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Project/LexerAssociationDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -46,7 +46,7 @@ self.editorLexerCombo.addItem("") self.editorLexerCombo.addItem(EricPixmapCache.getIcon("fileText"), "Text") - for lang in sorted(Lexers.getSupportedLanguages().keys()): + for lang in sorted(Lexers.getSupportedLanguages()): self.editorLexerCombo.addItem(Lexers.getLanguageIcon(lang, False), lang) self.editorLexerCombo.addItems(self.extras) @@ -55,9 +55,7 @@ # set initial values self.project = project - for ext, lexer in list( - self.project.getProjectData(dataKey="LEXERASSOCS").items() - ): + for ext, lexer in self.project.getProjectData(dataKey="LEXERASSOCS").items(): QTreeWidgetItem(self.editorLexerList, [ext, lexer]) self.editorLexerList.sortByColumn(0, Qt.SortOrder.AscendingOrder)
--- a/src/eric7/Project/Project.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Project/Project.py Sun Dec 03 19:46:34 2023 +0100 @@ -710,7 +710,7 @@ @return list of known file categories @rtype list of str """ - return list(self.__fileCategoriesRepository.keys()) + return list(self.__fileCategoriesRepository) def getFileCategoryFilters(self, categories=None, withOthers=False, withAll=True): """ @@ -910,7 +910,7 @@ # File categories handled by activated plugin project browsers for fileCategory in [ f - for f in self.__fileCategoriesRepository.keys() + for f in self.__fileCategoriesRepository if f not in ["SOURCES", "FORMS", "RESOURCES", "TRANSLATIONS", "OTHERS"] ]: for ext in self.__fileCategoriesRepository[ @@ -948,7 +948,7 @@ with contextlib.suppress(KeyError): if self.__fileTypeCallbacks[self.__pdata["PROJECTTYPE"]] is not None: ftypes = self.__fileTypeCallbacks[self.__pdata["PROJECTTYPE"]]() - for pattern, ftype in list(ftypes.items()): + for pattern, ftype in ftypes.items(): if pattern not in self.__pdata["FILETYPES"]: self.__pdata["FILETYPES"][pattern] = ftype self.setDirty(True) @@ -1872,7 +1872,7 @@ if fnmatch.fnmatch(bfn, "*.ts") or fnmatch.fnmatch(bfn, "*.qm"): filetype = "TRANSLATIONS" else: - for pattern in sorted(self.__pdata["FILETYPES"].keys(), reverse=True): + for pattern in sorted(self.__pdata["FILETYPES"], reverse=True): if fnmatch.fnmatch(bfn, pattern): filetype = self.__pdata["FILETYPES"][pattern] break @@ -1988,7 +1988,7 @@ # get all relevant filename patterns patterns = [] ignorePatterns = [] - for pattern, patterntype in list(self.__pdata["FILETYPES"].items()): + for pattern, patterntype in self.__pdata["FILETYPES"].items(): if patterntype == filetype: patterns.append(pattern) elif patterntype == "__IGNORE__": @@ -2283,7 +2283,7 @@ for fn in self.__pdata[fileCategory][:]: filetype = fileCategory bfn = os.path.basename(fn) - for pattern in sorted(self.__pdata["FILETYPES"].keys(), reverse=True): + for pattern in sorted(self.__pdata["FILETYPES"], reverse=True): if fnmatch.fnmatch(bfn, pattern): filetype = self.__pdata["FILETYPES"][pattern] break @@ -2776,8 +2776,7 @@ .getPluginDisplayStrings("version_control") ) vcsSystemsDisplay = [self.tr("None")] - keys = sorted(vcsSystemsDict.keys()) - for key in keys: + for key in sorted(vcsSystemsDict): vcsSystemsDisplay.append(vcsSystemsDict[key]) vcsSelected, ok = QInputDialog.getItem( None, @@ -2870,8 +2869,7 @@ ignoreList = [os.path.split(environmentPath)[-1]] with EricOverrideCursor(): # search the project directory for files with known extensions - filespecs = list(self.__pdata["FILETYPES"].keys()) - for filespec in filespecs: + for filespec in self.__pdata["FILETYPES"]: files = FileSystemUtilities.direntries( self.ppath, filesonly=True, @@ -3122,7 +3120,7 @@ @return the requested lexer language (string) """ # try user settings first - for pattern, language in list(self.__pdata["LEXERASSOCS"].items()): + for pattern, language in self.__pdata["LEXERASSOCS"].items(): if fnmatch.fnmatch(filename, pattern): return language @@ -5612,7 +5610,7 @@ filetype = "" bfn = os.path.basename(fn) - for pattern in sorted(self.__pdata["FILETYPES"].keys(), reverse=True): + for pattern in sorted(self.__pdata["FILETYPES"], reverse=True): if fnmatch.fnmatch(bfn, pattern): filetype = self.__pdata["FILETYPES"][pattern] break
--- a/src/eric7/Project/ProjectBrowser.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Project/ProjectBrowser.py Sun Dec 03 19:46:34 2023 +0100 @@ -248,7 +248,7 @@ @return list of project browser types @rtype list of str """ - return list(self.__browserRepository.keys()) + return list(self.__browserRepository) def getProjectBrowserUserStrings(self): """ @@ -378,7 +378,7 @@ browsersList = ( Preferences.getProjectBrowsers(self.project.getProjectType()) if self.project.isOpen() - else list(self.__browserRepository.keys()) + else list(self.__browserRepository) ) browsersList = [b for b in browsersList if b in self.__browserRepository]
--- a/src/eric7/Project/ProjectBrowserModel.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Project/ProjectBrowserModel.py Sun Dec 03 19:46:34 2023 +0100 @@ -895,7 +895,7 @@ itemCache = {} if len(statesList) == 1 and statesList[0] == "--RESET--": statesList = [] - for name in list(self.__vcsStatus.keys()): + for name in self.__vcsStatus: statesList.append(" {0}".format(name)) for name in statesList: @@ -969,7 +969,7 @@ """ Public method used to handle a change in preferences. """ - for code in list(self.colorNames.keys()): + for code in self.colorNames: color = Preferences.getProjectBrowserColour(self.colorNames[code]) if color.name() == self.itemBackgroundColors[code].name(): continue
--- a/src/eric7/QScintilla/APIsManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/APIsManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -252,7 +252,7 @@ """ Public slot to reload the api information. """ - for api in list(self.__apis.values()): + for api in self.__apis.values(): api and api.reloadAPIs() def getAPIs(self, language, projectType="", forPreparation=False):
--- a/src/eric7/QScintilla/Editor.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/Editor.py Sun Dec 03 19:46:34 2023 +0100 @@ -1214,8 +1214,7 @@ self.supportedLanguages = {} supportedLanguages = Lexers.getSupportedLanguages() - languages = sorted(supportedLanguages.keys()) - for language in languages: + for language in sorted(supportedLanguages): if language != "Guessed": self.supportedLanguages[language] = supportedLanguages[language][:2] act = menu.addAction( @@ -6752,7 +6751,7 @@ self.setCursorPosition(line - 1, index) self.ensureLineVisible(line - 1) else: - for handle in list(self.syntaxerrors.keys()): + for handle in list(self.syntaxerrors): if self.markerLine(handle) == line - 1: del self.syntaxerrors[handle] self.markerDeleteHandle(handle) @@ -6804,7 +6803,7 @@ """ Public slot to handle the 'Clear all syntax error' context menu action. """ - for handle in list(self.syntaxerrors.keys()): + for handle in list(self.syntaxerrors): line = self.markerLine(handle) + 1 self.toggleSyntaxError(line, 0, False) @@ -6909,7 +6908,7 @@ ): self._warnings[handle].append(warn) else: - for handle in list(self._warnings.keys()): + for handle in list(self._warnings): if self.markerLine(handle) == line - 1: del self._warnings[handle] self.markerDeleteHandle(handle) @@ -7022,7 +7021,7 @@ @param warningKind kind of warning to clear (Editor.WarningCode, Editor.WarningPython, Editor.WarningStyle) """ - for handle in list(self._warnings.keys()): + for handle in list(self._warnings): issues = [] for msg, warningType in self._warnings[handle]: if warningType == warningKind: @@ -8992,7 +8991,7 @@ eol = self.getLineSeparator() lastWithEol = True newLines = [] - for txt in sorted(selText.keys(), key=keyFun, reverse=reverse): + for txt in sorted(selText, key=keyFun, reverse=reverse): for line in selText[txt]: txt = txtLines[line] if not txt.endswith(eol): @@ -9135,7 +9134,7 @@ @param name name of the plug-in @type str """ - for key in list(self.__mouseClickHandlers.keys()): + for key in list(self.__mouseClickHandlers): if self.__mouseClickHandlers[key][0] == name: del self.__mouseClickHandlers[key]
--- a/src/eric7/QScintilla/EditorOutlineModel.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/EditorOutlineModel.py Sun Dec 03 19:46:34 2023 +0100 @@ -75,7 +75,7 @@ self.__editor.text(), self.__filename, self.__module ) if dictionary is not None: - keys = list(dictionary.keys()) + keys = list(dictionary) if len(keys) > 0: parentItem = self.rootItem @@ -269,6 +269,4 @@ @return list of supported programming languages @rtype str """ - return list(ClassBrowsers.ClassBrowserRegistry.keys()) + list( - cls.SupportedLanguages.keys() - ) + return list(ClassBrowsers.ClassBrowserRegistry) + list(cls.SupportedLanguages)
--- a/src/eric7/QScintilla/Exporters/ExporterHTML.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/Exporters/ExporterHTML.py Sun Dec 03 19:46:34 2023 +0100 @@ -506,7 +506,7 @@ if "sphinx" in sys.modules: # Make sure any Sphinx polution of docutils has been removed. unloadKeys = [ - k for k in sys.modules.keys() if k.startswith(("docutils", "sphinx")) + k for k in sys.modules if k.startswith(("docutils", "sphinx")) ] for key in unloadKeys: sys.modules.pop(key)
--- a/src/eric7/QScintilla/Lexers/SubstyledLexer.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/Lexers/SubstyledLexer.py Sun Dec 03 19:46:34 2023 +0100 @@ -186,9 +186,7 @@ if subStyleStart < 0: continue - for subStyleIndex, subStyleKey in enumerate( - sorted(subStylesData.keys()) - ): + for subStyleIndex, subStyleKey in enumerate(sorted(subStylesData)): styleNo = subStyleStart + subStyleIndex subStyle = subStylesData[subStyleKey] # set the words @@ -270,7 +268,7 @@ ) settings.setValue(key, len(self.__subStyles[baseStyle])) for subStyleIndex, subStyle in enumerate( - sorted(self.__subStyles[baseStyle].keys()) + sorted(self.__subStyles[baseStyle]) ): substyleKey = "Scintilla/{0}/style{1}/substyle{2}/".format( self.language(), baseStyle, subStyleIndex @@ -718,7 +716,7 @@ @rtype int """ if style in self.__subStyles: - lastSubStyle = sorted(self.__subStyles[style].keys())[-1] + lastSubStyle = sorted(self.__subStyles[style])[-1] subStyle = lastSubStyle + 1 self.__subStyles[style][subStyle] = { "Description": "",
--- a/src/eric7/QScintilla/Lexers/__init__.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/Lexers/__init__.py Sun Dec 03 19:46:34 2023 +0100 @@ -273,7 +273,7 @@ """ return [ lang - for lang in getSupportedLanguages().keys() + for lang in getSupportedLanguages() if lang != "Guessed" and not lang.startswith("Pygments|") ]
--- a/src/eric7/QScintilla/MiniEditor.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/MiniEditor.py Sun Dec 03 19:46:34 2023 +0100 @@ -3743,8 +3743,7 @@ self.supportedLanguages = {} supportedLanguages = Lexers.getSupportedLanguages() - languages = sorted(supportedLanguages.keys()) - for language in languages: + for language in sorted(supportedLanguages): if language != "Guessed": self.supportedLanguages[language] = supportedLanguages[language][:2] act = menu.addAction(
--- a/src/eric7/QScintilla/Shell.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QScintilla/Shell.py Sun Dec 03 19:46:34 2023 +0100 @@ -2114,7 +2114,7 @@ # do the history related stuff self.__maxHistoryEntries = Preferences.getShell("MaxHistoryEntries") - for key in list(self.__historyLists.keys()): + for key in list(self.__historyLists): self.__historyLists[key] = self.__historyLists[key][ -self.__maxHistoryEntries : ]
--- a/src/eric7/QtHelpInterface/QtHelpDocumentationSettings.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/QtHelpInterface/QtHelpDocumentationSettings.py Sun Dec 03 19:46:34 2023 +0100 @@ -121,7 +121,7 @@ @return list of components @rtype list of str """ - return [k for k in self._componentToNamespace.keys()] + return list(self._componentToNamespace) def versions(self): """ @@ -130,7 +130,7 @@ @return list of versions @rtype list of QVersionNumber """ - return [k for k in self._versionToNamespace.keys()] + return list(self._versionToNamespace) def namespaces(self): """ @@ -139,7 +139,7 @@ @return list of namespaces @rtype list of str """ - return [k for k in self._namespaceToFilename.keys()] + return list(self._namespaceToFilename) def namespaceToFilename(self): """
--- a/src/eric7/Templates/TemplateMultipleVariablesDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Templates/TemplateMultipleVariablesDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -131,7 +131,7 @@ @return dictionary with the variable as a key and its value (string) """ values = {} - for var, textEdit in list(self.variablesEntries.items()): + for var, textEdit in self.variablesEntries.items(): try: values[var] = textEdit.text() except AttributeError:
--- a/src/eric7/Templates/TemplatePropertiesDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Templates/TemplatePropertiesDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -55,8 +55,7 @@ self.languages = [("All", self.tr("All"))] supportedLanguages = Lexers.getSupportedLanguages() - languages = sorted(supportedLanguages.keys()) - for language in languages: + for language in sorted(supportedLanguages): self.languages.append((language, supportedLanguages[language][0])) self.groupMode = groupMode
--- a/src/eric7/Templates/TemplateViewer.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Templates/TemplateViewer.py Sun Dec 03 19:46:34 2023 +0100 @@ -131,7 +131,7 @@ """ Public method to remove all template entries of this group. """ - for name in list(self.entries.keys())[:]: + for name in list(self.entries): self.removeEntry(name) def hasEntry(self, name): @@ -289,7 +289,7 @@ number of lines (integer) and the length of the last line (integer) """ txt = self.template - for var, val in list(varDict.items()): + for var, val in varDict.items(): txt = ( self.__expandFormattedVariable(var, val, txt) if var in self.formatedVariables @@ -727,7 +727,7 @@ # Remove predefined variables from list so user doesn't have to fill # these values out in the dialog. - for v in list(varValues.keys()): + for v in varValues: if v in variables: variables.remove(v) @@ -911,7 +911,7 @@ @return list of all group names (list of strings) """ - groups = sorted(list(self.groups.keys())[:]) + groups = sorted(self.groups) return groups def removeGroup(self, itm):
--- a/src/eric7/Testing/TestingWidget.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Testing/TestingWidget.py Sun Dec 03 19:46:34 2023 +0100 @@ -805,7 +805,7 @@ headerText = self.tr("<h3>Versions of Frameworks and their Plugins</h3>") versionsText = "" interpreter = self.__determineInterpreter(venvName) - for framework in sorted(self.__frameworkRegistry.getFrameworks().keys()): + for framework in sorted(self.__frameworkRegistry.getFrameworks()): executor = self.__frameworkRegistry.createExecutor(framework, self) versions = executor.getVersions(interpreter) if versions:
--- a/src/eric7/Testing/__init__.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Testing/__init__.py Sun Dec 03 19:46:34 2023 +0100 @@ -18,7 +18,7 @@ @return list of supported programming languages @rtype list of str """ - return list(FrameworkNames.keys()) + return list(FrameworkNames) def isLanguageSupported(language):
--- a/src/eric7/UI/BrowserModel.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/UI/BrowserModel.py Sun Dec 03 19:46:34 2023 +0100 @@ -647,7 +647,7 @@ except ImportError: return - keys = list(dictionary.keys()) + keys = list(dictionary) if len(keys) > 0: if repopulate: last = len(keys) - 1 @@ -773,9 +773,9 @@ # build sorted list of names keys = [] - for name in list(cl.classes.keys()): + for name in cl.classes: keys.append((name, "c")) - for name in list(cl.methods.keys()): + for name in cl.methods: keys.append((name, "m")) if len(cl.attributes): @@ -830,9 +830,9 @@ # build sorted list of names keys = [] - for name in list(fn.classes.keys()): + for name in fn.classes: keys.append((name, "c")) - for name in list(fn.methods.keys()): + for name in fn.methods: keys.append((name, "m")) if len(keys) > 0: @@ -862,7 +862,7 @@ if not attributes: return - keys = list(attributes.keys()) + keys = list(attributes) if len(keys) > 0: if repopulate: self.beginInsertRows(
--- a/src/eric7/UI/FindFileWidget.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/UI/FindFileWidget.py Sun Dec 03 19:46:34 2023 +0100 @@ -519,9 +519,7 @@ "^{0}$".format( assoc.replace(".", r"\.").replace("*", ".*") ) - for assoc in list( - Preferences.getEditorLexerAssocs().keys() - ) + for assoc in Preferences.getEditorLexerAssocs() if assoc not in self.__project.getFileCategoryExtension( fileType, reverse=True
--- a/src/eric7/UI/Previewers/PreviewerHTML.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/UI/Previewers/PreviewerHTML.py Sun Dec 03 19:46:34 2023 +0100 @@ -700,7 +700,7 @@ if "sphinx" in sys.modules: # Make sure any Sphinx polution of docutils has been removed. unloadKeys = [ - k for k in sys.modules.keys() if k.startswith(("docutils", "sphinx")) + k for k in sys.modules if k.startswith(("docutils", "sphinx")) ] for key in unloadKeys: sys.modules.pop(key)
--- a/src/eric7/Utilities/__init__.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Utilities/__init__.py Sun Dec 03 19:46:34 2023 +0100 @@ -1118,7 +1118,7 @@ versions[pinfo["module_name"]] = pinfo["version"] info.append("Plugins Version Numbers:") - for pluginModuleName in sorted(versions.keys()): + for pluginModuleName in sorted(versions): info.append( " {0} {1}".format(pluginModuleName, versions[pluginModuleName]) )
--- a/src/eric7/Utilities/crypto/py3PBKDF2.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/Utilities/crypto/py3PBKDF2.py Sun Dec 03 19:46:34 2023 +0100 @@ -103,7 +103,7 @@ "'digestmod{0}iterations{0}salt{0}hashed_password".format(Delimiter) ) - if digestname not in Hashes.keys(): + if digestname not in Hashes: raise ValueError( "Unsupported hash algorithm '{0}' for hash encoded password '{1}'.".format( digestname, pwHash @@ -136,7 +136,7 @@ "'digestmod{0}iterations{0}salt".format(Delimiter) ) - if digestname not in Hashes.keys(): + if digestname not in Hashes: raise ValueError( "Unsupported hash algorithm '{0}' for hash parameters '{1}'.".format( digestname, hashParameters
--- a/src/eric7/VCS/ProjectHelper.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/VCS/ProjectHelper.py Sun Dec 03 19:46:34 2023 +0100 @@ -217,8 +217,7 @@ return vcsSystemsDisplay = [] - keys = sorted(vcsSystemsDict.keys()) - for key in keys: + for key in sorted(vcsSystemsDict): vcsSystemsDisplay.append(vcsSystemsDict[key]) vcsSelected, ok = QInputDialog.getItem( None, @@ -234,7 +233,7 @@ return selectedVcsSystem = None - for vcsSystem, vcsSystemDisplay in list(vcsSystemsDict.items()): + for vcsSystem, vcsSystemDisplay in vcsSystemsDict.items(): if vcsSystemDisplay == vcsSelected: selectedVcsSystem = vcsSystem break @@ -447,8 +446,7 @@ return vcsSystemsDisplay = [] - keys = sorted(vcsSystemsDict.keys()) - for key in keys: + for key in sorted(vcsSystemsDict): vcsSystemsDisplay.append(vcsSystemsDict[key]) vcsSelected, ok = QInputDialog.getItem( None, @@ -464,7 +462,7 @@ return selectedVcsSystem = None - for vcsSystem, vcsSystemDisplay in list(vcsSystemsDict.items()): + for vcsSystem, vcsSystemDisplay in vcsSystemsDict.items(): if vcsSystemDisplay == vcsSelected: selectedVcsSystem = vcsSystem break
--- a/src/eric7/ViewManager/ViewManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/ViewManager/ViewManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -924,8 +924,7 @@ menu = QMenu(QCoreApplication.translate("ViewManager", "Export as")) supportedExporters = Exporters.getSupportedFormats() - exporters = sorted(supportedExporters.keys()) - for exporter in exporters: + for exporter in sorted(supportedExporters): act = menu.addAction(supportedExporters[exporter]) act.setData(exporter)
--- a/src/eric7/VirtualEnv/VirtualenvManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/VirtualEnv/VirtualenvManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -304,7 +304,7 @@ ) if not ok: dlg = VirtualenvNameDialog( - list(self.__virtualEnvironments.keys()), metadata.name + list(self.__virtualEnvironments), metadata.name ) if dlg.exec() != QDialog.DialogCode.Accepted: return @@ -603,7 +603,7 @@ @return list of defined virtual environments @rtype list of str """ - environments = list(self.__virtualEnvironments.keys()) + environments = list(self.__virtualEnvironments) if noRemote: environments = [ name for name in environments if not self.isRemoteEnvironment(name)
--- a/src/eric7/WebBrowser/Network/ProtocolHandlerManagerDialog.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/Network/ProtocolHandlerManagerDialog.py Sun Dec 03 19:46:34 2023 +0100 @@ -33,7 +33,7 @@ self.__manager = manager handlers = self.__manager.protocolHandlers() - for scheme in sorted(handlers.keys()): + for scheme in sorted(handlers): QTreeWidgetItem( self.protocolHandlersList, [scheme, handlers[scheme].toString()] )
--- a/src/eric7/WebBrowser/OpenSearch/OpenSearchManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/OpenSearch/OpenSearchManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -133,7 +133,7 @@ @return sorted list of all engine names (list of strings) """ - return sorted(self.__engines.keys()) + return sorted(self.__engines) def enginesCount(self): """ @@ -311,7 +311,7 @@ os.unlink(file_) if name == self.__current: - self.setCurrentEngineName(list(self.__engines.keys())[0]) + self.setCurrentEngineName(list(self.__engines)[0]) self.changed.emit() @@ -352,7 +352,7 @@ writer = OpenSearchWriter() - for engine in list(self.__engines.values()): + for engine in self.__engines.values(): name = self.generateEngineFileName(engine.name()) fileName = qdir.filePath(name) @@ -413,7 +413,7 @@ self.__keywords[keyword] = self.engine(engineName) if self.__current not in self.__engines and len(self.__engines) > 0: - self.__current = list(self.__engines.keys())[0] + self.__current = list(self.__engines)[0] self.__loading = False self.currentEngineChanged.emit()
--- a/src/eric7/WebBrowser/Passwords/PasswordManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/Passwords/PasswordManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -235,7 +235,7 @@ if not self.__loaded: self.__load() - return sorted(self.__logins.keys()) + return sorted(self.__logins) def sitesCount(self): """
--- a/src/eric7/WebBrowser/Tools/WebIconProvider.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/Tools/WebIconProvider.py Sun Dec 03 19:46:34 2023 +0100 @@ -236,7 +236,7 @@ if dlg.exec() == QDialog.DialogCode.Accepted: changed = False urls = dlg.getUrls() - for url in list(self.__iconsDB.keys())[:]: + for url in list(self.__iconsDB): if url not in urls: del self.__iconsDB[url] changed = True
--- a/src/eric7/WebBrowser/UserAgent/UserAgentManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/UserAgent/UserAgentManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -134,7 +134,7 @@ if not self.__loaded: self.__load() - return sorted(self.__agents.keys()) + return sorted(self.__agents) def hostsCount(self): """
--- a/src/eric7/WebBrowser/WebBrowserWindow.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/WebBrowserWindow.py Sun Dec 03 19:46:34 2023 +0100 @@ -4806,11 +4806,11 @@ self.__setStatusBarVisible(act.isChecked()) elif name == "__SHOW__": - for _text, tb in list(self.__toolbars.values()): + for _text, tb in self.__toolbars.values(): tb.show() elif name == "__HIDE__": - for _text, tb in list(self.__toolbars.values()): + for _text, tb in self.__toolbars.values(): tb.hide() else:
--- a/src/eric7/WebBrowser/ZoomManager/ZoomManager.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/WebBrowser/ZoomManager/ZoomManager.py Sun Dec 03 19:46:34 2023 +0100 @@ -179,7 +179,7 @@ """ self.load() - return sorted(self.__zoomDB.keys()) + return sorted(self.__zoomDB) def sitesCount(self): """
--- a/src/eric7/eric7_api.py Sun Dec 03 16:44:52 2023 +0100 +++ b/src/eric7/eric7_api.py Sun Dec 03 19:46:34 2023 +0100 @@ -297,7 +297,7 @@ sys.exit(3) try: with open(basesFile, "w", encoding="utf-8", newline=newline) as out: - for baseEntry in sorted(basesDict.keys()): + for baseEntry in sorted(basesDict): out.write( "{0} {1}\n".format( baseEntry, " ".join(sorted(basesDict[baseEntry]))