summaryrefslogtreecommitdiffstats
path: root/comps.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-05-05 18:52:40 +0000
committerErik Troan <ewt@redhat.com>1999-05-05 18:52:40 +0000
commit662f9f7639059e040c566c0938bce1baabdf8c47 (patch)
tree5ce563e0a1af9501bb1a683609c375aa2413514a /comps.py
parent5fe45f2f1abee7b69128f975fc2da034de18ab63 (diff)
downloadanaconda-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.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/comps.py b/comps.py
index 3233ec691..ce86f0476 100644
--- a/comps.py
+++ b/comps.py
@@ -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()