@@ -57,33 +57,30 @@ def get_url(directory: str, arch: str) -> Tuple[Optional[str], Optional[str]]:
57
57
"""Searches the http directory and returns both url to installer
58
58
and version.
59
59
"""
60
- logging .info ('Url to find %s' , directory )
61
- logging .info ('Arch %s' , arch )
60
+ logging .debug ('Url for installers look-up %s' , directory )
62
61
lst = requests .get (directory , allow_redirects = True )
63
62
tree = BeautifulSoup (lst .content , 'html.parser' )
64
63
links = tree .find_all ('a' )
65
- logging .info ('Links %s' , links )
66
64
installer , version = None , None
67
65
os_name , local_arch = _current_platform ()
68
66
for k in links :
69
- logging .info ('Parsing link: %s' , k .get ('href' ))
67
+ logging .debug ('Parsing link: %s' , k .get ('href' ))
70
68
match = VERSION_RE .match (k .get ('href' ))
71
69
if match and match .group ('platform' ) == os_name :
72
- logging .info ('Platform matched: ' + os_name )
73
- if arch == "amd64" :
74
- logging .info ('Arch: amd64' )
75
- if match .group ('architecture' ) is None :
76
- logging .info ('architecture is none' )
77
- installer = lst .url + k .get ('href' )
78
- version = match .group ('version' )
79
- break
80
- else :
81
- if (local_arch == match .group ('architecture' )) \
82
- or (local_arch == arch and not match .group ('architecture' )):
83
- logging .info ('Second part of it' )
84
- installer = lst .url + k .get ('href' )
85
- version = match .group ('version' )
86
- break
70
+ # if arch == "amd64":
71
+ # logging.info('Arch: amd64')
72
+ # if match.group('architecture') is None:
73
+ # logging.info('architecture is none')
74
+ # installer = lst.url + k.get('href')
75
+ # version = match.group('version')
76
+ # break
77
+ # else:
78
+ if (local_arch == match .group ('architecture' )) \
79
+ or (local_arch == arch and not match .group ('architecture' )):
80
+ logging .info ('Second part of it' )
81
+ installer = lst .url + k .get ('href' )
82
+ version = match .group ('version' )
83
+ break
87
84
return installer , version
88
85
89
86
0 commit comments