py3: add () to print statements
It's a function call in 3.x and redundant parentheses around an expression on 2.x. This works fine as long as all prints have just a single argument. One print statement with two arguments was changed to use % formatting instead.
This commit is contained in:
parent
afc19f79b6
commit
0deddadf88
1 changed files with 9 additions and 9 deletions
18
smem
18
smem
|
|
@ -464,12 +464,12 @@ def showsystem():
|
|||
|
||||
def showfields(fields, f):
|
||||
if type(f) in (list, set):
|
||||
print "unknown fields:", " ".join(f)
|
||||
print("unknown fields: " + " ".join(f))
|
||||
else:
|
||||
print "unknown field", f
|
||||
print "known fields:"
|
||||
for l in sorted(fields.keys()):
|
||||
print "%-8s %s" % (l, fields[l][-1])
|
||||
print("unknown field %s" % f)
|
||||
print("known fields:")
|
||||
for l in sorted(fields):
|
||||
print("%-8s %s" % (l, fields[l][-1]))
|
||||
|
||||
def autosize(columns, fields, rows):
|
||||
colsizes = {}
|
||||
|
|
@ -559,10 +559,10 @@ def showtable(rows, fields, columns, sort):
|
|||
return
|
||||
|
||||
if not options.no_header:
|
||||
print header
|
||||
print(header)
|
||||
|
||||
for k,r in l:
|
||||
print format % tuple([f(v) for f,v in zip(formatter, r)])
|
||||
print(format % tuple([f(v) for f,v in zip(formatter, r)]))
|
||||
|
||||
if options.totals:
|
||||
# totals
|
||||
|
|
@ -574,8 +574,8 @@ def showtable(rows, fields, columns, sort):
|
|||
else:
|
||||
t.append("")
|
||||
|
||||
print "-" * len(header)
|
||||
print format % tuple([f(v) for f,v in zip(formatter, t)])
|
||||
print("-" * len(header))
|
||||
print(format % tuple([f(v) for f,v in zip(formatter, t)]))
|
||||
|
||||
def showpie(l, sort):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue