Cambiato sistema di ricerca delle release - ora basate su DownloadPage.
This commit is contained in:
parent
ebf1e22b0a
commit
e84f275f42
@ -6,6 +6,7 @@ from lxml import etree
|
||||
from packaging.version import parse as parse_version
|
||||
|
||||
class BuildVersion(object):
|
||||
DOWNLOADPAGE = "https://www.libreoffice.org/download/download/"
|
||||
ARCHIVE = "https://downloadarchive.documentfoundation.org/libreoffice/old/"
|
||||
RELEASE = "https://download.documentfoundation.org/libreoffice/stable/"
|
||||
DAILY = "https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@tb87-TDF/"
|
||||
@ -67,13 +68,23 @@ class BuildVersion(object):
|
||||
return { 'version': version, 'basedirurl': basedirurl }
|
||||
|
||||
# Stable releases.
|
||||
versions = etree.HTML(urllib.request.urlopen(BuildVersion.RELEASE).read()).xpath('//td/a')
|
||||
index = 1
|
||||
# Old approach - Doesn't really work because RelEng can screw order.
|
||||
#versions = etree.HTML(urllib.request.urlopen(BuildVersion.RELEASE).read()).xpath('//td/a')
|
||||
#index = 1
|
||||
#if branch == 'still':
|
||||
# index = -2
|
||||
#elif branch == 'fresh':
|
||||
# index = -1
|
||||
#version = self.__getlatestrel(versions[index].text.strip('/'))
|
||||
|
||||
# Now I'll rely on DownloadPage
|
||||
versions = etree.HTML(urllib.request.urlopen(BuildVersion.DOWNLOADPAGE).read()).xpath('//span[@class="dl_version_number"]')
|
||||
index = 0
|
||||
if branch == 'still':
|
||||
index = -2
|
||||
index = 1
|
||||
elif branch == 'fresh':
|
||||
index = -1
|
||||
version = self.__getlatestrel(versions[index].text.strip('/'))
|
||||
index = 0
|
||||
version = self.__getlatestrel(versions[index].text)
|
||||
|
||||
return { 'version': version, 'basedirurl': self.__getbaseurl(version) }
|
||||
|
||||
|
Reference in New Issue
Block a user