Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
chongshenng committed Dec 4, 2024
1 parent 09d1647 commit b5952ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/py/flwr/cli/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,11 @@ def _list_runs(
res: ListRunsResponse = stub.ListRuns(ListRunsRequest())
run_dict = {run_id: run_from_proto(proto) for run_id, proto in res.run_dict.items()}

formatted_runs = _format_runs(run_dict, res.now)
if output_format == CliOutputFormat.JSON:
Console().print_json(_to_json(_format_runs(run_dict, res.now)))
Console().print_json(_to_json(formatted_runs))
else:
Console().print(_to_table(_format_runs(run_dict, res.now)))
Console().print(_to_table(formatted_runs))


def _display_one_run(
Expand All @@ -305,10 +306,11 @@ def _display_one_run(

run_dict = {run_id: run_from_proto(proto) for run_id, proto in res.run_dict.items()}

formatted_runs = _format_runs(run_dict, res.now)
if output_format == CliOutputFormat.JSON:
Console().print_json(_to_json(_format_runs(run_dict, res.now)))
Console().print_json(_to_json(formatted_runs))
else:
Console().print(_to_table(_format_runs(run_dict, res.now)))
Console().print(_to_table(formatted_runs))


def _print_json_error() -> None:
Expand Down

0 comments on commit b5952ca

Please sign in to comment.