From dcf4d90e6935fce6c3cf2d3594e4d1bd69fa6b2a Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 3 Oct 2008 10:11:00 -0700 Subject: [PATCH] Subclass ConfigParser so that we can store path names as config options verbatim and avoid having the files be lowercase. --- src/pypungi/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index e8530b9c..4bddeddd 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -26,6 +26,13 @@ import createrepo import ConfigParser import pypungi.splittree +class MyConfigParser(ConfigParser.ConfigParser): + """A subclass of ConfigParser which does not lowercase options""" + + def optionxform(self, optionstr): + return optionstr + + class PungiBase(object): """The base Pungi class. Set up config items and logging here""" @@ -678,7 +685,7 @@ class Pungi(pypungi.PungiBase): # Create a ConfigParser object out of the contents so that we can # write it back out later and not worry about formatting - treeinfo = ConfigParser.SafeConfigParser() + treeinfo = MyConfigParser() treeinfo.readfp(treefile) treefile.close() treeinfo.add_section('checksums')