summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeConfigParser.py
diff options
context:
space:
mode:
authorSebastian Heinlein <sebastian.heinlein@web.de>2006-04-29 15:53:42 +0200
committerSebastian Heinlein <sebastian.heinlein@web.de>2006-04-29 15:53:42 +0200
commit4e093f33b5e9da902a69fc8bdf0fd2109a31c2d5 (patch)
tree54cc2932cb71aded4e39a71653dea7b540304049 /DistUpgrade/DistUpgradeConfigParser.py
parentd19de868ff0230aebfc0920bd31caa64d51ec920 (diff)
parentdc3dc10c9a2835ffef5708db35dd70344860adab (diff)
downloadpython-apt-4e093f33b5e9da902a69fc8bdf0fd2109a31c2d5.tar.gz
* merged from mvo
Diffstat (limited to 'DistUpgrade/DistUpgradeConfigParser.py')
-rw-r--r--DistUpgrade/DistUpgradeConfigParser.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/DistUpgrade/DistUpgradeConfigParser.py b/DistUpgrade/DistUpgradeConfigParser.py
index c87e2f1b..a4c55080 100644
--- a/DistUpgrade/DistUpgradeConfigParser.py
+++ b/DistUpgrade/DistUpgradeConfigParser.py
@@ -12,9 +12,17 @@ class DistUpgradeConfig(ConfigParser):
return []
items = [x.strip() for x in tmp.split(",")]
return items
+ def getListFromFile(self, section, option):
+ try:
+ filename = self.get(section, option)
+ except NoOptionError:
+ return []
+ items = [x.strip() for x in open(filename)]
+ return filter(lambda s: not s.startswith("#") and not s == "", items)
if __name__ == "__main__":
- c = DistUpgradeConfigParser()
+ c = DistUpgradeConfig()
print c.getlist("Distro","MetaPkgs")
print c.getlist("Distro","ForcedPurges")
+ print c.getListFromFile("Sources","ValidMirrors")