in distributions/validate.py [0:0]
def download_and_get_manifest(url: str):
print(f'Downloading {url}')
filename, _ = urlretrieve(url)
with zipfile.ZipFile(filename) as archive:
try:
with archive.open('AppxManifest.xml') as manifest:
return ElementTree.fromstring(manifest.read())
except KeyError:
# In the case of a bundle
with archive.open('AppxMetadata/AppxBundleManifest.xml') as manifest:
return ElementTree.fromstring(manifest.read())