def get_catalog(catalog_url):
"""Obtaines the Apple software catalog as a dict"""
try:
catalog_request = urlopen(catalog_url)
except (IOError, URLError, HTTPError):
raise CampiesError(
'Unable to download catalog URL {catalog_url}'.format(
catalog_url=catalog_url
)
)
catalog_xml = catalog_request.read()
try:
catalog = loads_plist(catalog_xml)
except xml.parsers.expat.ExpatError:
raise CampiesError(
'Unable to parse catalog XML to obtain software details'
)
return catalog
评论列表
文章目录