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 'Download-URL' in p:
p['Download-URL'] = urllib.basejoin(url, p['Download-URL'])
flavor = p.get('Flavor')
if flavor == 'source':
pkg = PimpPackage_source(self, p)
elif flavor == 'binary':
pkg = PimpPackage_binary(self, p)
elif flavor == 'installer':
pkg = PimpPackage_installer(self, p)
elif flavor == 'hidden':
pkg = PimpPackage_installer(self, p)
else:
pkg = PimpPackage(self, dict(p))
self._packages.append(pkg)
评论列表
文章目录