diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2005-01-07 13:43:31 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2005-01-07 13:43:31 (GMT) |
commit | 1dd087cbad1bb0f51c8283cc3d7d8c6621121f04 (patch) | |
tree | 4cc165bde828e302662f957ca9ef4faf09a05244 /Lib/plat-mac | |
parent | da49e1981a71aef5a2b802bd5d7fc96006be92d1 (diff) | |
download | cpython-1dd087cbad1bb0f51c8283cc3d7d8c6621121f04.zip cpython-1dd087cbad1bb0f51c8283cc3d7d8c6621121f04.tar.gz cpython-1dd087cbad1bb0f51c8283cc3d7d8c6621121f04.tar.bz2 |
Allow relative URLs for included databases and packages.
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r-- | Lib/plat-mac/pimp.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 625e388..255b57c 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -402,18 +402,21 @@ class PimpDatabase: self._maintainer = plistdata.get('Maintainer', '') self._description = plistdata.get('Description', '').strip() self._url = url - self._appendPackages(plistdata['Packages']) + self._appendPackages(plistdata['Packages'], url) others = plistdata.get('Include', []) - for url in others: - self.appendURL(url, included=1) + for o in others: + o = urllib.basejoin(url, o) + self.appendURL(o, included=1) - def _appendPackages(self, packages): + def _appendPackages(self, packages, url): """Given a list of dictionaries containing package descriptions create the PimpPackage objects and append them to our internal storage.""" for p in packages: p = dict(p) + if p.has_key('Download-URL'): + p['Download-URL'] = urllib.basejoin(url, p['Download-URL']) flavor = p.get('Flavor') if flavor == 'source': pkg = PimpPackage_source(self, p) |