diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-06 10:38:09 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-02-06 10:38:09 +0100 |
| commit | 7520aea4b9ea79e180aa9dca5eed719158b70d91 (patch) | |
| tree | 58897c0bf74e68970643bff5eb85a47b5e4e4470 /DistUpgrade/DistUpgradeConfigParser.py | |
| parent | 6164b21e46fbd5b56b7c8245f577c137bda9ba11 (diff) | |
| parent | f593c02a4051313dd0044888a26d7ab3f4ba1133 (diff) | |
| download | python-apt-7520aea4b9ea79e180aa9dca5eed719158b70d91.tar.gz | |
* merged from the laptop branch
Diffstat (limited to 'DistUpgrade/DistUpgradeConfigParser.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeConfigParser.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/DistUpgrade/DistUpgradeConfigParser.py b/DistUpgrade/DistUpgradeConfigParser.py new file mode 100644 index 00000000..c87e2f1b --- /dev/null +++ b/DistUpgrade/DistUpgradeConfigParser.py @@ -0,0 +1,20 @@ +from ConfigParser import ConfigParser, NoOptionError + + +class DistUpgradeConfig(ConfigParser): + def __init__(self): + ConfigParser.__init__(self) + self.read(['DistUpgrade.cfg']) + def getlist(self, section, option): + try: + tmp = self.get(section, option) + except NoOptionError: + return [] + items = [x.strip() for x in tmp.split(",")] + return items + + +if __name__ == "__main__": + c = DistUpgradeConfigParser() + print c.getlist("Distro","MetaPkgs") + print c.getlist("Distro","ForcedPurges") |
