CLI: Use progressbar when updating files
@@ -140,7 +140,8 @@ def upgrade(root):
# Rename regressors.tsv to timeseries.tsv
regressors = layout.get(suffix="regressors")
policy = None
- for bidsfile in regressors:
+ with click.progressbar(regressors) as bar:
+ for bidsfile in bar:
action = policy
new_path = bidsfile.path.replace("regressors.", "timeseries.")
if action is None:
@@ -153,4 +154,4 @@ def upgrade(root):
click.echo(f"Renaming {bidsfile.path} -> {new_path}")
os.rename(bidsfile.path, new_path)
else:
- print(f"Not renaming {bidsfile.path}")
+ click.echo(f"Not renaming {bidsfile.path}")
