[Pkg-privacy-commits] [tails-installer] 118/210: Parse 32b releases too
Intrigeri
intrigeri at moszumanska.debian.org
Wed May 24 15:26:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to tag 3.90.0
in repository tails-installer.
commit 359b5c54e94a74ca5079d0c6feb8ba67e9761167
Author: Martin Briza <mbriza at redhat.com>
Date: Thu Jul 9 11:30:20 2015 +0200
Parse 32b releases too
---
liveusb/releases.py | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/liveusb/releases.py b/liveusb/releases.py
index b75fe2e..74c6353 100644
--- a/liveusb/releases.py
+++ b/liveusb/releases.py
@@ -39,9 +39,28 @@ def getSHA(url):
return i.group(2)
return ''
+def getSize(url):
+ return 0
+
def getDownload(url):
d = pyquery.PyQuery(urlread(url))
- return d('a.btn-success').attr('href')
+ ret = dict()
+ url = d('a.btn-success').attr('href')
+ ret[getArch(url)] = dict(
+ url = url,
+ sha256 = getSHA(url),
+ size = getSize(url)
+ )
+ for e in d.items("a"):
+ if "32-bit" in e.html().lower() and e.attr("href").endswith(".iso"):
+ altUrl = e.attr("href")
+ ret[getArch(altUrl)] = dict(
+ url = altUrl,
+ sha256 = getSHA(altUrl),
+ size = getSize(altUrl)
+ )
+ break
+ return ret
def getSpinDetails(url, source):
d = pyquery.PyQuery(urlread(url))
@@ -73,11 +92,7 @@ def getSpinDetails(url, source):
spin['description'] += line
download = getDownload(url + "/.." + d('a.btn').attr('href'))
- spin['variants'][getArch(download)] = dict(
- url = download,
- sha256 = getSHA(download),
- size = 0
- )
+ spin['variants'] = download
#spin['release'] = getRelease(download)
return spin
@@ -136,11 +151,7 @@ def getProductDetails(url, name):
product['logo'] = 'qrc:/logo-color-server.png'
download = getDownload(url + "/download")
- product['variants'][getArch(download)] = dict(
- url = download,
- sha256 = getSHA(download),
- size = 0
- )
+ product['variants'] = download
#product['release'] = getRelease(download)
return product
@@ -280,6 +291,7 @@ def get_fedora_releases():
return releases
# A backup list of releases, just in case we can't fetch them.
-fedora_releases = [{'releaseDate': '', 'source': 'Local', 'name': u'Custom OS...', 'logo': 'qrc:/icon-folder.svg', 'variants': {'': {'url': '', 'sha256': '', 'size': 0}}, 'summary': u'Pick a file from your drive(s)', 'screenshots': [], 'description': u'Here you can choose a OS image from your hard drive to be written to your flash disk'}, {'releaseDate': '', 'source': 'Workstation', 'name': 'Workstation', 'logo': 'qrc:/logo-color-workstation.png', 'description': "<p>Fedora Workstation is [...]
+fedora_releases = [{'releaseDate': '', 'source': 'Local', 'name': u'Custom OS...', 'logo': 'qrc:/icon-folder.svg', 'variants': {'': {'url': '', 'sha256': '', 'size': 0}}, 'summary': u'Pick a file from your drive(s)', 'screenshots': [], 'description': u'Here you can choose a OS image from your hard drive to be written to your flash disk'}, {'releaseDate': '', 'source': 'Workstation', 'name': 'Workstation', 'logo': 'qrc:/logo-color-workstation.png', 'description': "<p>Fedora Workstation is [...]
+
releases = fedora_releases
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list