summaryrefslogtreecommitdiff
path: root/scripts/tiny
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-30 18:14:46 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-01 12:46:46 +0100
commit80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0 (patch)
treec21ed55e063e7c77be81bc2f433f3befabbfa8be /scripts/tiny
parent98a4c642444a524f547f5d978a28814d20c12354 (diff)
downloadopenembedded-core-80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0.tar.gz
openembedded-core-80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0.tar.bz2
openembedded-core-80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0.zip
scripts: python3: Use print function
Used print function instead of print statement to make the code work in python 3. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/tiny')
-rwxr-xr-xscripts/tiny/dirsize.py6
-rwxr-xr-xscripts/tiny/ksize.py36
2 files changed, 21 insertions, 21 deletions
diff --git a/scripts/tiny/dirsize.py b/scripts/tiny/dirsize.py
index 40ff4ab895..5329b86f75 100755
--- a/scripts/tiny/dirsize.py
+++ b/scripts/tiny/dirsize.py
@@ -71,7 +71,7 @@ class Record:
total = 0
if self.size <= minsize:
return 0
- print "%10d %s" % (self.size, self.path)
+ print("%10d %s" % (self.size, self.path))
for r in self.records:
total += r.show(minsize)
if len(self.records) == 0:
@@ -85,8 +85,8 @@ def main():
minsize = int(sys.argv[1])
rootfs = Record.create(".")
total = rootfs.show(minsize)
- print "Displayed %d/%d bytes (%.2f%%)" % \
- (total, rootfs.size, 100 * float(total) / rootfs.size)
+ print("Displayed %d/%d bytes (%.2f%%)" % \
+ (total, rootfs.size, 100 * float(total) / rootfs.size))
if __name__ == "__main__":
diff --git a/scripts/tiny/ksize.py b/scripts/tiny/ksize.py
index 4006f2f6f1..275c983b8d 100755
--- a/scripts/tiny/ksize.py
+++ b/scripts/tiny/ksize.py
@@ -33,11 +33,11 @@ from string import join
def usage():
prog = os.path.basename(sys.argv[0])
- print 'Usage: %s [OPTION]...' % (prog)
- print ' -d, display an additional level of drivers detail'
- print ' -h, --help display this help and exit'
- print ''
- print 'Run %s from the top-level Linux kernel build directory.' % (prog)
+ print('Usage: %s [OPTION]...' % prog)
+ print(' -d, display an additional level of drivers detail')
+ print(' -h, --help display this help and exit')
+ print('')
+ print('Run %s from the top-level Linux kernel build directory.' % prog)
class Sizes:
@@ -55,8 +55,8 @@ class Sizes:
self.text = self.data = self.bss = self.total = 0
def show(self, indent=""):
- print "%-32s %10d | %10d %10d %10d" % \
- (indent+self.title, self.total, self.text, self.data, self.bss)
+ print("%-32s %10d | %10d %10d %10d" % \
+ (indent+self.title, self.total, self.text, self.data, self.bss))
class Report:
@@ -101,22 +101,22 @@ class Report:
def show(self, indent=""):
rule = str.ljust(indent, 80, '-')
- print "%-32s %10s | %10s %10s %10s" % \
- (indent+self.title, "total", "text", "data", "bss")
- print rule
+ print("%-32s %10s | %10s %10s %10s" % \
+ (indent+self.title, "total", "text", "data", "bss"))
+ print(rule)
self.sizes.show(indent)
- print rule
+ print(rule)
for p in self.parts:
if p.sizes.total > 0:
p.sizes.show(indent)
- print rule
- print "%-32s %10d | %10d %10d %10d" % \
+ print(rule)
+ print("%-32s %10d | %10d %10d %10d" % \
(indent+"sum", self.totals["total"], self.totals["text"],
- self.totals["data"], self.totals["bss"])
- print "%-32s %10d | %10d %10d %10d" % \
+ self.totals["data"], self.totals["bss"]))
+ print("%-32s %10d | %10d %10d %10d" % \
(indent+"delta", self.deltas["total"], self.deltas["text"],
- self.deltas["data"], self.deltas["bss"])
- print "\n"
+ self.deltas["data"], self.deltas["bss"]))
+ print("\n")
def __cmp__(this, that):
if that is None:
@@ -134,7 +134,7 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "dh", ["help"])
except getopt.GetoptError, err:
- print '%s' % str(err)
+ print('%s' % str(err))
usage()
sys.exit(2)