Commit 705f8cfd authored by Jerome Touvier's avatar Jerome Touvier
Browse files

Merge branch 'fix2' into 'master'

datetime not JSON serializable

See merge request !36
parents e2b1f0ea 7439f1e2
...@@ -175,6 +175,7 @@ def format_results(params, data): ...@@ -175,6 +175,7 @@ def format_results(params, data):
for row in data: for row in data:
if row[2]: if row[2]:
row[2] = format(row[2], ",") + f" ({humanize_size(row[2])})" row[2] = format(row[2], ",") + f" ({humanize_size(row[2])})"
data = [[str(val) for val in row] for row in data]
return data return data
...@@ -205,7 +206,6 @@ def get_column_widths(data, header=None): ...@@ -205,7 +206,6 @@ def get_column_widths(data, header=None):
def records_to_text(params, data, sep=" "): def records_to_text(params, data, sep=" "):
text = "" text = ""
header = get_header(params) header = get_header(params)
data = [[str(val) for val in row] for row in data]
if params["format"] == "text": if params["format"] == "text":
sizes = get_column_widths(data, header) sizes = get_column_widths(data, header)
# pad header and rows according to the maximum column width # pad header and rows according to the maximum column width
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment