Fix per numero di build vuoto.
This commit is contained in:
parent
3656b7d0a6
commit
db4c957e1d
@ -87,11 +87,14 @@ class Base(object):
|
|||||||
def fullversion(version):
|
def fullversion(version):
|
||||||
"""Get latest full version from Archive based on partial version."""
|
"""Get latest full version from Archive based on partial version."""
|
||||||
versionlist = etree.HTML(urllib.request.urlopen(Definitions.ARCHIVE).read()).xpath(f"//td/a[starts-with(text(), '{version}')]/text()")
|
versionlist = etree.HTML(urllib.request.urlopen(Definitions.ARCHIVE).read()).xpath(f"//td/a[starts-with(text(), '{version}')]/text()")
|
||||||
|
if versionlist:
|
||||||
cleanlist = sorted([ x.strip('/') for x in versionlist ])
|
cleanlist = sorted([ x.strip('/') for x in versionlist ])
|
||||||
|
|
||||||
# Sorting, then returning the last version
|
# Sorting, then returning the last version
|
||||||
return cleanlist[-1]
|
return cleanlist[-1]
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def urlfromqueryandver(query, version):
|
def urlfromqueryandver(query, version):
|
||||||
"""Returns the fetching URL based on the queried version and the numeric version of it."""
|
"""Returns the fetching URL based on the queried version and the numeric version of it."""
|
||||||
@ -139,6 +142,11 @@ class Base(object):
|
|||||||
else:
|
else:
|
||||||
# Named query
|
# Named query
|
||||||
a = Base.namedver(query)
|
a = Base.namedver(query)
|
||||||
|
|
||||||
|
if not a:
|
||||||
|
# a is empty
|
||||||
|
return retval
|
||||||
|
|
||||||
if isinstance(a, list) and len(a) > 1:
|
if isinstance(a, list) and len(a) > 1:
|
||||||
retval.extend([ RemoteBuild(query, version) for version in a ])
|
retval.extend([ RemoteBuild(query, version) for version in a ])
|
||||||
else:
|
else:
|
||||||
@ -168,6 +176,10 @@ class RemoteBuild(object):
|
|||||||
a = Base.namedver(self.query)
|
a = Base.namedver(self.query)
|
||||||
|
|
||||||
if isinstance(a, list):
|
if isinstance(a, list):
|
||||||
|
# if the number of versions is zero, return and exit
|
||||||
|
if not a:
|
||||||
|
return None
|
||||||
|
|
||||||
if len(a) == 1:
|
if len(a) == 1:
|
||||||
# version is a single one.
|
# version is a single one.
|
||||||
self.version = a[0]
|
self.version = a[0]
|
||||||
|
Reference in New Issue
Block a user