From af9a9a4528609b04f21a81cc47d98dc3744c71eb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 25 Sep 2003 20:34:25 +0000 Subject: [PATCH] Updated to get rid of apply and map, and only update the ColourDB once. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wxPython/lib/colourdb.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wxPython/wxPython/lib/colourdb.py b/wxPython/wxPython/lib/colourdb.py index 82c20f43f4..ec9ae457f2 100644 --- a/wxPython/wxPython/lib/colourdb.py +++ b/wxPython/wxPython/lib/colourdb.py @@ -17,7 +17,7 @@ Load color names/values from the rgb.txt file on my system... def getColourList(): - return map(lambda x: x[0], getColourInfoList()) + return [ x[0] for x in getColourInfoList() ] @@ -656,10 +656,14 @@ def getColourInfoList(): ] +_haveUpdated = False + def updateColourDB(): - from wxPython.wx import wxTheColourDatabase - cl = getColourInfoList() - for info in cl: - apply(wxTheColourDatabase.Append, info) + global _haveUpdated + if not _haveUpdated: + from wxPython.wx import wxTheColourDatabase + cl = getColourInfoList() + for info in cl: + wxTheColourDatabase.Append(*info)