diff options
| author | Sebastian Heinlein <sebi@sebi-pc.daheim> | 2006-12-10 23:40:34 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-pc.daheim> | 2006-12-10 23:40:34 +0100 |
| commit | 0c3388641eac326fcb527060005b03755543fa72 (patch) | |
| tree | 4e64fb9757f00b268a93f156acb6265432e851b4 /AptSources/DistInfo.py | |
| parent | 4d027f3bde2f083f87b6e645e518607f731caa12 (diff) | |
| parent | 38491fe36963dceff062c38e298bcfedcae0ea56 (diff) | |
| download | python-apt-0c3388641eac326fcb527060005b03755543fa72.tar.gz | |
* merge with laptop
Diffstat (limited to 'AptSources/DistInfo.py')
| -rw-r--r-- | AptSources/DistInfo.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/AptSources/DistInfo.py b/AptSources/DistInfo.py index 2dbd9a1b..6387dbd2 100644 --- a/AptSources/DistInfo.py +++ b/AptSources/DistInfo.py @@ -43,6 +43,17 @@ class Suite: self.distribution = None self.available = True + def get_comp_desc(self, comp, short=False): + ''' Return a human readable description of a component ''' + if self.components.has_key(comp): + if self.components[comp][1] == "" or short == True: + return self.components[comp][0] + elif self.components[comp][1] != "": + return self.components[comp][1] + else: + return "Unnamed component" + return None + class Component: def __init__(self): self.name = "" @@ -102,7 +113,7 @@ class DistInfo: # reuse some properties of the parent suite if suite.match_uri == None: suite.match_uri = nanny.match_uri - if suite.valid_mirrors == None: + if suite.valid_mirrors == []: suite.valid_mirrors = nanny.valid_mirrors if suite.base_uri == None: suite.base_uri = nanny.base_uri @@ -148,7 +159,7 @@ class DistInfo: if __name__ == "__main__": - d = DistInfo ("Ubuntu", "../../data/templates") + d = DistInfo ("Ubuntu", "/usr/share/python-aptsources/templates") print d.changelogs_uri for suite in d.suites: print "\nSuite: %s" % suite.name @@ -157,7 +168,7 @@ if __name__ == "__main__": print "MatchURI: %s" % suite.match_uri print "Mirrors: %s" % suite.valid_mirrors for component in suite.components: - print " %s - %s - %s - %s" % (component, + print " %s - %s - %s" % (component, suite.components[component][0], suite.components[component][1]) for child in suite.children: |
