From: W. Trevor King Date: Sat, 31 Jul 2010 14:02:00 +0000 (-0400) Subject: Use RawConfigParser instead of SafeConfigParser as base class in hooke.config. X-Git-Url: http://git.tremily.us/?p=hooke.git;a=commitdiff_plain;h=bd783dae165a9da2691ef569d19a96afbe449ecf Use RawConfigParser instead of SafeConfigParser as base class in hooke.config. This allows us to use things like the upcomming plot x format = %.3g --- diff --git a/hooke/config.py b/hooke/config.py index 6d9cceb..57756a0 100644 --- a/hooke/config.py +++ b/hooke/config.py @@ -119,8 +119,8 @@ def get_setting(settings, match): return s return None -class HookeConfigParser (configparser.SafeConfigParser): - """A wrapper around configparser.SafeConfigParser. +class HookeConfigParser (configparser.RawConfigParser): + """A wrapper around configparser.RawConfigParser. You will probably only need .read and .write. @@ -147,9 +147,9 @@ class HookeConfigParser (configparser.SafeConfigParser): """ def __init__(self, paths=None, default_settings=None, defaults=None, dict_type=OrderedDict, indent='# ', **kwargs): - # Can't use super() because SafeConfigParser is a classic class + # Can't use super() because RawConfigParser is a classic class #super(HookeConfigParser, self).__init__(defaults, dict_type) - configparser.SafeConfigParser.__init__(self, defaults, dict_type) + configparser.RawConfigParser.__init__(self, defaults, dict_type) if paths == None: paths = [] self._config_paths = paths @@ -199,9 +199,9 @@ class HookeConfigParser (configparser.SafeConfigParser): for filename in filenames: if os.path.abspath(os.path.expanduser(filename)) not in paths: self._config_paths.append(filename) - # Can't use super() because SafeConfigParser is a classic class + # Can't use super() because RawConfigParser is a classic class #return super(HookeConfigParser, self).read(filenames) - return configparser.SafeConfigParser.read(self, filenames) + return configparser.RawConfigParser.read(self, filenames) def _write_setting(self, fp, section=None, option=None, value=None, **kwargs):