summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-04-11 17:03:55 -0700
committerChris Larson <chris_larson@mentor.com>2010-04-11 17:34:11 -0700
commitd39ab776e7ceaefc8361150151cf0892dcb70d9c (patch)
tree603dad748ff3fcbf9a5ff39b5c692f6455fbf5e3 /lib/bb/fetch
parentb3b314aade1f0a04e888361e1ac946e5195e1509 (diff)
downloadbitbake-d39ab776e7ceaefc8361150151cf0892dcb70d9c.tar.gz
Apply some 2to3 transforms that don't cause issues in 2.6
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/fetch')
-rw-r--r--lib/bb/fetch/cvs.py4
-rw-r--r--lib/bb/fetch/perforce.py26
-rw-r--r--lib/bb/fetch/wget.py2
3 files changed, 16 insertions, 16 deletions
diff --git a/lib/bb/fetch/cvs.py b/lib/bb/fetch/cvs.py
index c0d43618f..61976f7ef 100644
--- a/lib/bb/fetch/cvs.py
+++ b/lib/bb/fetch/cvs.py
@@ -139,8 +139,8 @@ class Cvs(Fetch):
bb.msg.debug(2, bb.msg.domain.Fetcher, "Fetch: checking for module directory")
pkg = data.expand('${PN}', d)
pkgdir = os.path.join(data.expand('${CVSDIR}', localdata), pkg)
- moddir = os.path.join(pkgdir,localdir)
- if os.access(os.path.join(moddir,'CVS'), os.R_OK):
+ moddir = os.path.join(pkgdir, localdir)
+ if os.access(os.path.join(moddir, 'CVS'), os.R_OK):
bb.msg.note(1, bb.msg.domain.Fetcher, "Update " + loc)
# update sources there
os.chdir(moddir)
diff --git a/lib/bb/fetch/perforce.py b/lib/bb/fetch/perforce.py
index 67de6f59f..5b6c60187 100644
--- a/lib/bb/fetch/perforce.py
+++ b/lib/bb/fetch/perforce.py
@@ -35,15 +35,15 @@ class Perforce(Fetch):
def supports(self, url, ud, d):
return ud.type in ['p4']
- def doparse(url,d):
+ def doparse(url, d):
parm = {}
path = url.split("://")[1]
delim = path.find("@");
if delim != -1:
- (user,pswd,host,port) = path.split('@')[0].split(":")
+ (user, pswd, host, port) = path.split('@')[0].split(":")
path = path.split('@')[1]
else:
- (host,port) = data.getVar('P4PORT', d).split(':')
+ (host, port) = data.getVar('P4PORT', d).split(':')
user = ""
pswd = ""
@@ -53,19 +53,19 @@ class Perforce(Fetch):
plist = path.split(';')
for item in plist:
if item.count('='):
- (key,value) = item.split('=')
+ (key, value) = item.split('=')
keys.append(key)
values.append(value)
- parm = dict(zip(keys,values))
+ parm = dict(zip(keys, values))
path = "//" + path.split(';')[0]
host += ":%s" % (port)
parm["cset"] = Perforce.getcset(d, path, host, user, pswd, parm)
- return host,path,user,pswd,parm
+ return host, path, user, pswd, parm
doparse = staticmethod(doparse)
- def getcset(d, depot,host,user,pswd,parm):
+ def getcset(d, depot, host, user, pswd, parm):
p4opt = ""
if "cset" in parm:
return parm["cset"];
@@ -97,7 +97,7 @@ class Perforce(Fetch):
def localpath(self, url, ud, d):
- (host,path,user,pswd,parm) = Perforce.doparse(url,d)
+ (host, path, user, pswd, parm) = Perforce.doparse(url, d)
# If a label is specified, we use that as our filename
@@ -115,7 +115,7 @@ class Perforce(Fetch):
cset = Perforce.getcset(d, path, host, user, pswd, parm)
- ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host,base.replace('/', '.'), cset), d)
+ ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
@@ -124,7 +124,7 @@ class Perforce(Fetch):
Fetch urls
"""
- (host,depot,user,pswd,parm) = Perforce.doparse(loc, d)
+ (host, depot, user, pswd, parm) = Perforce.doparse(loc, d)
if depot.find('/...') != -1:
path = depot[:depot.find('/...')]
@@ -164,10 +164,10 @@ class Perforce(Fetch):
raise FetchError(module)
if "label" in parm:
- depot = "%s@%s" % (depot,parm["label"])
+ depot = "%s@%s" % (depot, parm["label"])
else:
cset = Perforce.getcset(d, depot, host, user, pswd, parm)
- depot = "%s@%s" % (depot,cset)
+ depot = "%s@%s" % (depot, cset)
os.chdir(tmpfile)
bb.msg.note(1, bb.msg.domain.Fetcher, "Fetch " + loc)
@@ -189,7 +189,7 @@ class Perforce(Fetch):
dest = list[0][len(path)+1:]
where = dest.find("#")
- os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module,dest[:where],list[0]))
+ os.system("%s%s print -o %s/%s %s" % (p4cmd, p4opt, module, dest[:where], list[0]))
count = count + 1
if count == 0:
diff --git a/lib/bb/fetch/wget.py b/lib/bb/fetch/wget.py
index 8b687372a..581362038 100644
--- a/lib/bb/fetch/wget.py
+++ b/lib/bb/fetch/wget.py
@@ -38,7 +38,7 @@ class Wget(Fetch):
"""
Check to see if a given url can be fetched with wget.
"""
- return ud.type in ['http','https','ftp']
+ return ud.type in ['http', 'https', 'ftp']
def localpath(self, url, ud, d):