3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-16 01:45:30 +00:00

Use tabs in csv output

Also add a `.replace` to escape any tabs in the output just to be safe.
This commit is contained in:
Krystine Sherwin 2025-07-22 11:58:52 +12:00
parent ac120cee92
commit 0d06b377db
No known key found for this signature in database

View file

@ -520,7 +520,7 @@ def format_status_data_csvline(row: dict|None) -> str:
"trace",
"depth",
]
return ','.join(csv_header)
return '\t'.join(csv_header)
else:
engine = row['data'].get('engine', row['data'].get('source'))
try:
@ -546,7 +546,13 @@ def format_status_data_csvline(row: dict|None) -> str:
trace_path,
depth,
]
return ','.join("" if v is None else str(v) for v in csv_line)
def escape_str(v):
if v is None:
return ""
v_str = str(v)
# this shouldn't ever happen, but just in case
return v_str.replace('\t', "\\t")
return '\t'.join(escape_str(v) for v in csv_line)
def filter_latest_task_ids(all_tasks: dict[int, dict[str]]):
latest: dict[str, int] = {}