Skip to content

Commit

Permalink
replace if-statement with conditional expression
Browse files Browse the repository at this point in the history
  • Loading branch information
kwatch committed May 26, 2016
1 parent c77372c commit 7c827b1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/PsqlWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,9 @@ def print_result(self, rs):
buf = []
for c, w in zip(r, widths):
s = str(c)
if header:
s = s.center(w)
elif is_number(s):
s = s.rjust(w)
else:
s = s.ljust(w)
s = (s.center(w) if header else
s.rjust(w) if is_number(s) else
s.ljust(w))
buf.append(s)
out = '| %s |' % (' | '.join(buf))

Expand Down

0 comments on commit 7c827b1

Please sign in to comment.