mirror of
https://github.com/YosysHQ/sby.git
synced 2025-08-15 09:25:31 +00:00
statuscsv: Better error handling
This commit is contained in:
parent
0fa5715909
commit
4a14207b37
1 changed files with 6 additions and 5 deletions
|
@ -381,7 +381,7 @@ class SbyStatusDb:
|
||||||
rows = self.db.execute(
|
rows = self.db.execute(
|
||||||
"""
|
"""
|
||||||
SELECT task.name as 'task_name', task.mode, task.created,
|
SELECT task.name as 'task_name', task.mode, task.created,
|
||||||
task_property.src as 'location', task_property.hdlname, task_property_status.status,
|
task_property.src as 'location', task_property.name, task_property.hdlname, task_property_status.status,
|
||||||
task_property_status.data, task_property_status.created as 'status_created',
|
task_property_status.data, task_property_status.created as 'status_created',
|
||||||
task_property_status.id
|
task_property_status.id
|
||||||
FROM task
|
FROM task
|
||||||
|
@ -392,6 +392,7 @@ class SbyStatusDb:
|
||||||
|
|
||||||
def get_result(row):
|
def get_result(row):
|
||||||
row = dict(row)
|
row = dict(row)
|
||||||
|
row["name"] = json.loads(row.get("name", "null"))
|
||||||
row["data"] = json.loads(row.get("data", "null"))
|
row["data"] = json.loads(row.get("data", "null"))
|
||||||
return row
|
return row
|
||||||
|
|
||||||
|
@ -434,7 +435,7 @@ class SbyStatusDb:
|
||||||
|
|
||||||
for prop in prop_map.values():
|
for prop in prop_map.values():
|
||||||
# ignore UNKNOWNs if there are other statuses
|
# ignore UNKNOWNs if there are other statuses
|
||||||
if len(prop) > 1:
|
if len(prop) > 1 and "UNKNOWN" in prop:
|
||||||
del prop["UNKNOWN"]
|
del prop["UNKNOWN"]
|
||||||
|
|
||||||
for status, (depth, row) in prop.items():
|
for status, (depth, row) in prop.items():
|
||||||
|
@ -449,12 +450,12 @@ class SbyStatusDb:
|
||||||
prop_status['task_name'],
|
prop_status['task_name'],
|
||||||
prop_status['mode'],
|
prop_status['mode'],
|
||||||
engine,
|
engine,
|
||||||
name,
|
name or pretty_path(prop_status['name']),
|
||||||
prop_status['location'],
|
prop_status['location'],
|
||||||
status,
|
status,
|
||||||
depth,
|
depth,
|
||||||
]
|
]
|
||||||
print(','.join(str(v) for v in csv_line))
|
print(','.join("N/A" if v is None else str(v) for v in csv_line))
|
||||||
|
|
||||||
|
|
||||||
def combine_statuses(statuses):
|
def combine_statuses(statuses):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue