From 4718bf894103887262287293599f4188e2601d37 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Tue, 12 Feb 2008 21:34:12 +0000 Subject: Convert some custom sort comparison functions to equivalent key functions. --- Lib/idlelib/configDialog.py | 7 +------ Lib/idlelib/configHandler.py | 10 +--------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index e7a0690..d0e4066 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -980,16 +980,11 @@ class ConfigDialog(Toplevel): self.SetThemeType() ##load theme element option menu themeNames = list(self.themeElements.keys()) - themeNames.sort(self.__ThemeNameIndexCompare) + themeNames.sort(key=lambda x: self.themeElements[x][1]) self.optMenuHighlightTarget.SetMenu(themeNames,themeNames[0]) self.PaintThemeSample() self.SetHighlightTarget() - def __ThemeNameIndexCompare(self,a,b): - if self.themeElements[a][1] int(h2[2]): - return 1 - else: - return 0 - def GetAllExtraHelpSourcesList(self): """ Returns a list of tuples containing the details of all additional help -- cgit v0.12