mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02:00
bitbake: fetch2/wget: Clean up whitespace/comments
Clean up the whitespace and comments style, keep pylint happy. (Bitbake rev: ee59fdaae68543ade03cacfdbbf14fdc7e469412) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -270,17 +270,16 @@ class Wget(FetchMethod):
|
|||||||
fp.read()
|
fp.read()
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
newheaders = dict((k,v) for k,v in list(req.headers.items())
|
newheaders = dict((k, v) for k, v in list(req.headers.items())
|
||||||
if k.lower() not in ("content-length", "content-type"))
|
if k.lower() not in ("content-length", "content-type"))
|
||||||
return self.parent.open(urllib.request.Request(req.get_full_url(),
|
return self.parent.open(urllib.request.Request(req.get_full_url(),
|
||||||
headers=newheaders,
|
headers=newheaders,
|
||||||
origin_req_host=req.origin_req_host,
|
origin_req_host=req.origin_req_host,
|
||||||
unverifiable=True))
|
unverifiable=True))
|
||||||
|
|
||||||
"""
|
|
||||||
Some servers (e.g. GitHub archives, hosted on Amazon S3) return 403
|
# Some servers (e.g. GitHub archives, hosted on Amazon S3) return 403
|
||||||
Forbidden when they actually mean 405 Method Not Allowed.
|
# Forbidden when they actually mean 405 Method Not Allowed.
|
||||||
"""
|
|
||||||
http_error_403 = http_error_405
|
http_error_403 = http_error_405
|
||||||
|
|
||||||
|
|
||||||
@@ -299,7 +298,7 @@ class Wget(FetchMethod):
|
|||||||
if exported_proxies:
|
if exported_proxies:
|
||||||
handlers.append(urllib.request.ProxyHandler())
|
handlers.append(urllib.request.ProxyHandler())
|
||||||
handlers.append(CacheHTTPHandler())
|
handlers.append(CacheHTTPHandler())
|
||||||
# XXX: Since Python 2.7.9 ssl cert validation is enabled by default
|
# Since Python 2.7.9 ssl cert validation is enabled by default
|
||||||
# see PEP-0476, this causes verification errors on some https servers
|
# see PEP-0476, this causes verification errors on some https servers
|
||||||
# so disable by default.
|
# so disable by default.
|
||||||
import ssl
|
import ssl
|
||||||
@@ -318,7 +317,7 @@ class Wget(FetchMethod):
|
|||||||
'''Adds Basic auth to http request, pass in login:password as string'''
|
'''Adds Basic auth to http request, pass in login:password as string'''
|
||||||
import base64
|
import base64
|
||||||
encodeuser = base64.b64encode(login_str.encode('utf-8')).decode("utf-8")
|
encodeuser = base64.b64encode(login_str.encode('utf-8')).decode("utf-8")
|
||||||
authheader = "Basic %s" % encodeuser
|
authheader = "Basic %s" % encodeuser
|
||||||
r.add_header("Authorization", authheader)
|
r.add_header("Authorization", authheader)
|
||||||
|
|
||||||
if ud.user and ud.pswd:
|
if ud.user and ud.pswd:
|
||||||
@@ -330,7 +329,7 @@ class Wget(FetchMethod):
|
|||||||
login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
|
login, unused, password = n.authenticators(urllib.parse.urlparse(uri).hostname)
|
||||||
add_basic_auth("%s:%s" % (login, password), r)
|
add_basic_auth("%s:%s" % (login, password), r)
|
||||||
except (TypeError, ImportError, IOError, netrc.NetrcParseError):
|
except (TypeError, ImportError, IOError, netrc.NetrcParseError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
with opener.open(r) as response:
|
with opener.open(r) as response:
|
||||||
pass
|
pass
|
||||||
@@ -395,18 +394,14 @@ class Wget(FetchMethod):
|
|||||||
(oldpn, oldpv, oldsuffix) = old
|
(oldpn, oldpv, oldsuffix) = old
|
||||||
(newpn, newpv, newsuffix) = new
|
(newpn, newpv, newsuffix) = new
|
||||||
|
|
||||||
"""
|
# Check for a new suffix type that we have never heard of before
|
||||||
Check for a new suffix type that we have never heard of before
|
if newsuffix:
|
||||||
"""
|
|
||||||
if (newsuffix):
|
|
||||||
m = self.suffix_regex_comp.search(newsuffix)
|
m = self.suffix_regex_comp.search(newsuffix)
|
||||||
if not m:
|
if not m:
|
||||||
bb.warn("%s has a possible unknown suffix: %s" % (newpn, newsuffix))
|
bb.warn("%s has a possible unknown suffix: %s" % (newpn, newsuffix))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
"""
|
# Not our package so ignore it
|
||||||
Not our package so ignore it
|
|
||||||
"""
|
|
||||||
if oldpn != newpn:
|
if oldpn != newpn:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -472,10 +467,9 @@ class Wget(FetchMethod):
|
|||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def _check_latest_version_by_dir(self, dirver, package, package_regex,
|
def _check_latest_version_by_dir(self, dirver, package, package_regex, current_version, ud, d):
|
||||||
current_version, ud, d):
|
|
||||||
"""
|
"""
|
||||||
Scan every directory in order to get upstream version.
|
Scan every directory in order to get upstream version.
|
||||||
"""
|
"""
|
||||||
version_dir = ['', '', '']
|
version_dir = ['', '', '']
|
||||||
version = ['', '', '']
|
version = ['', '', '']
|
||||||
|
|||||||
Reference in New Issue
Block a user