mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-08-25 09:27:36 +00:00
resolve tree formattting to a simplier and better visualization (#1305)
* resolve tree formattting to a simpier and easier visualization Signed-off-by: aochuba <aochuba52@gmail.com> * adding missing print statement Signed-off-by: aochuba <aochuba52@gmail.com> --------- Signed-off-by: aochuba <aochuba52@gmail.com> Co-authored-by: Paige Patton <64206430+paigerube14@users.noreply.github.com>
This commit is contained in:
co-authored by
Paige Patton
parent
64bdd3c6fb
commit
5dc79789a3
@@ -85,7 +85,9 @@ def list_rollback(run_uuid: Optional[str]=None, scenario_type: Optional[str]=Non
|
||||
files.sort()
|
||||
for j, file in enumerate(files):
|
||||
is_last_file = (j == len(files) - 1)
|
||||
file_prefix = " └── " if is_last_dir else "│ └── " if is_last_file else ("│ ├── " if not is_last_dir else " ├── ")
|
||||
dir_pad = " " if is_last_dir else "│ "
|
||||
file_pad = "└── " if is_last_file else "├── "
|
||||
file_prefix = dir_pad + file_pad
|
||||
print(f"{file_prefix}{file}")
|
||||
|
||||
except PermissionError:
|
||||
|
||||
Reference in New Issue
Block a user