summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/configHandler.py
diff options
context:
space:
mode:
authorSteven M. Gava <elguavas@python.net>2001-11-04 07:03:08 (GMT)
committerSteven M. Gava <elguavas@python.net>2001-11-04 07:03:08 (GMT)
commit9930061ce28b1fc60d267ae3474c74a41e655cd5 (patch)
tree019243ddaeed08681457aeb96fa0a94be23b792f /Lib/idlelib/configHandler.py
parentc99213f99369020c06bb75721fd41e2681445834 (diff)
downloadcpython-9930061ce28b1fc60d267ae3474c74a41e655cd5.zip
cpython-9930061ce28b1fc60d267ae3474c74a41e655cd5.tar.gz
cpython-9930061ce28b1fc60d267ae3474c74a41e655cd5.tar.bz2
further config system work
Diffstat (limited to 'Lib/idlelib/configHandler.py')
-rw-r--r--Lib/idlelib/configHandler.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index e32c6e6..4539627 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -5,7 +5,7 @@
##
##---------------------------------------------------------------------------##
"""
-Provides access to configuration information
+Provides access to stored idle configuration information
"""
import os
@@ -153,8 +153,17 @@ class IdleConf:
return cfgParser.sections()
def GetHighlight(self, theme, element):
+ #get some fallback defaults
+ defaultFg=self.GetOption('highlight', theme, 'normal' + "-foreground",
+ default='#000000')
+ defaultBg=self.GetOption('highlight', theme, 'normal' + "-background",
+ default='#ffffff')
+ #try for requested element colours
fore = self.GetOption('highlight', theme, element + "-foreground")
back = self.GetOption('highlight', theme, element + "-background")
+ #fall back if required
+ if not fore: fore=defaultFg
+ if not back: back=defaultBg
return {"foreground": fore,
"background": back}