diff options
author | Erik Troan <ewt@redhat.com> | 1999-05-05 18:52:40 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-05-05 18:52:40 +0000 |
commit | 662f9f7639059e040c566c0938bce1baabdf8c47 (patch) | |
tree | 5ce563e0a1af9501bb1a683609c375aa2413514a /comps.py | |
parent | 5fe45f2f1abee7b69128f975fc2da034de18ab63 (diff) | |
download | anaconda-662f9f7639059e040c566c0938bce1baabdf8c47.tar.gz anaconda-662f9f7639059e040c566c0938bce1baabdf8c47.tar.xz anaconda-662f9f7639059e040c566c0938bce1baabdf8c47.zip |
provide seq views of headerlist and package
Diffstat (limited to 'comps.py')
-rw-r--r-- | comps.py | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -4,6 +4,9 @@ import types class Package: + def __getitem__(self, item): + return self.h[item] + def __repr__(self): return self.name @@ -14,6 +17,14 @@ class Package: class HeaderList: + def selected(self): + l = [] + keys = self.packages.keys() + keys.sort() + for name in keys: + if self.packages[name].selected: l.append(self.packages[name]) + return l + def has_key(self, item): return self.packages.has_key(item) @@ -71,14 +82,6 @@ class ComponentSet: return self.comps[key] return self.compsDict[key] - def selected(self): - l = [] - keys = self.packages.keys() - keys.sort() - for name in keys: - if self.packages[name].selected: l.append(self.packages[name]) - return l - def readCompsFile(self, arch, filename, packages): file = open(filename, "r") lines = file.readlines() |