From 052937f0b5bf00aec9512184856ecfd29ec2c886 Mon Sep 17 00:00:00 2001 From: "Steven M. Gava" Date: Mon, 11 Feb 2002 02:20:53 +0000 Subject: further work on config saving --- Lib/idlelib/configHandler.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'Lib/idlelib/configHandler.py') diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 1052429b14..7028683097 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -206,7 +206,7 @@ class IdleConf: return self.userCfg[configType].Get(section, option, type=type) elif self.defaultCfg[configType].has_option(section,option): return self.defaultCfg[configType].Get(section, option, type=type) - else: + else: #returning default, print warning warning=('\n Warning: configHandler.py - IdleConf.GetOption -\n'+ ' problem retrieving configration option '+`option`+'\n'+ ' from section '+`section`+'.\n'+ @@ -311,7 +311,16 @@ class IdleConf: 'console-foreground':'#000000', 'console-background':'#ffffff' } for element in theme.keys(): - colour=cfgParser.Get(type,themeName,element,default=theme[element]) + print 'themeName:',themeName,'theme exists:',cfgParser.has_section( + themeName) + if not cfgParser.has_option(themeName,element): + #we are going to return a default, print warning + warning=('\n Warning: configHandler.py - IdleConf.GetThemeDict'+ + ' -\n problem retrieving theme element '+`element`+ + '\n from theme '+`themeName`+'.\n'+ + ' returning default value: '+`theme[element]`+'\n') + sys.stderr.write(warning) + colour=cfgParser.Get(themeName,element,default=theme[element]) theme[element]=colour return theme @@ -323,7 +332,7 @@ class IdleConf: def CurrentKeys(self): """ - Returns the name of the currently active theme + Returns the name of the currently active key set """ return self.GetOption('main','Keys','name',default='') -- cgit v1.2.1