1
0
Fork 0

Fix the double printing of output.

This commit is contained in:
Amjith Ramanujam 2015-01-09 01:03:09 -08:00
parent 01847b5706
commit 9a6292170b
1 changed files with 4 additions and 8 deletions

View File

@ -153,13 +153,6 @@ def cli(database, user, host, port, prompt_passwd, never_prompt):
for rows, headers, status in res:
_logger.debug("headers: %r", headers)
_logger.debug("rows: %r", rows)
if rows:
if is_expanded_output():
output.append(expanded_table(rows, headers))
else:
output.append(tabulate(rows, headers, tablefmt='psql'))
if status: # Only print the status if it's not None.
output.append(status)
_logger.debug("status: %r", status)
output.extend(format_output(rows, headers, status))
click.echo_via_pager('\n'.join(output))
@ -181,7 +174,10 @@ def cli(database, user, host, port, prompt_passwd, never_prompt):
def format_output(rows, headers, status):
output = []
if rows:
output.append(tabulate(rows, headers, tablefmt='psql'))
if is_expanded_output():
output.append(expanded_table(rows, headers))
else:
output.append(tabulate(rows, headers, tablefmt='psql'))
if status: # Only print the status if it's not None.
output.append(status)
return output