summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-03-06 19:45:35 -0700
committerSimon Glass <sjg@chromium.org>2016-03-14 15:34:50 -0600
commitad24ebace118f4145b1a3f782ddf9b9ce5f8dcf3 (patch)
treeb8d51aaba05ac6839de43a8fb5304d69c66a6dc0 /tools
parent2bdeade0eac66e7b12db847ffbbcbe2e63a17fd4 (diff)
downloadu-boot-ad24ebace118f4145b1a3f782ddf9b9ce5f8dcf3.tar.gz
u-boot-ad24ebace118f4145b1a3f782ddf9b9ce5f8dcf3.tar.bz2
u-boot-ad24ebace118f4145b1a3f782ddf9b9ce5f8dcf3.zip
buildman: Fix up a few code inconsistencies in toolchain.py
Normally we use a single quote for strings unless there is a reason not to (such as an embedded single quote). Fix a few counter-examples in this file. Also add a missing function-argument comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/toolchain.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index e33e10532e..5e77fed583 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -57,6 +57,7 @@ class Toolchain:
Args:
fname: Filename of the gcc component
test: True to run the toolchain to test it
+ verbose: True to print out the information
"""
self.gcc = fname
self.path = os.path.dirname(fname)
@@ -155,8 +156,8 @@ class Toolchains:
"""
toolchains = bsettings.GetItems('toolchain')
if not toolchains:
- print ("Warning: No tool chains - please add a [toolchain] section"
- " to your buildman config file %s. See README for details" %
+ print ('Warning: No tool chains - please add a [toolchain] section'
+ ' to your buildman config file %s. See README for details' %
bsettings.config_fname)
paths = []
@@ -367,14 +368,14 @@ class Toolchains:
Full path to the downloaded archive file in that directory,
or None if there was an error while downloading
"""
- print "Downloading: %s" % url
+ print 'Downloading: %s' % url
leaf = url.split('/')[-1]
tmpdir = tempfile.mkdtemp('.buildman')
response = urllib2.urlopen(url)
fname = os.path.join(tmpdir, leaf)
fd = open(fname, 'wb')
meta = response.info()
- size = int(meta.getheaders("Content-Length")[0])
+ size = int(meta.getheaders('Content-Length')[0])
done = 0
block_size = 1 << 16
status = ''
@@ -388,7 +389,7 @@ class Toolchains:
done += len(buffer)
fd.write(buffer)
- status = r"%10d MiB [%3d%%]" % (done / 1024 / 1024,
+ status = r'%10d MiB [%3d%%]' % (done / 1024 / 1024,
done * 100 / size)
status = status + chr(8) * (len(status) + 1)
print status,