def _row_for_print_run(run, flags, labels, status): from guild.commands import runs_impl fmt_run = runs_impl.format_run(run) row = {"opspec": fmt_run["op_desc"]} if flags: flag_vals = run.get("flags") or {} row["flags"] = op_util.flags_desc(flag_vals, delim=" ") if labels: row["label"] = run.get("label", "") if status: row["status"] = run.status return row
def _run_data(self, run): formatted = runs_impl.format_run(run) return { "id": run.id, "shortId": run.short_id, "path": run.path, "operation": formatted["operation"], "opModel": run.opref.model_name, "opName": run.opref.op_name, "started": formatted["started"], "stopped": formatted["stopped"], "time": self._run_duration(run), "label": formatted["label"], "status": run.status, "exitStatus": formatted["exit_status"] or None, "command": formatted["command"], "otherAttrs": self._other_attrs(run), "flags": run.get("flags", {}), "env": run.get("env", {}), "deps": self._format_deps(run.get("deps", {})), "files": self._format_files(run.iter_files(), run.path), }