Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dtcli/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def clear(
is_delete = True
else:
message = (
"⚠️ Delete files and empty parent directories?"
"WARNING: Delete files and empty parent directories?"
if clear_parents
else "⚠️ Delete files?"
else "WARNING: Delete files?"
)
is_delete = Confirm.ask(message)

Expand Down
2 changes: 1 addition & 1 deletion dtcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def check_version() -> None:
current_version = package_version("datatrail-cli")
latest_version = utilities.get_latest_released_version()
terminal_stderr.print(
f"A new release of datatrail-cli is available: {current_version} {latest_version}", # noqa: E501
f"A new release of datatrail-cli is available: {current_version} -> {latest_version}", # noqa: E501
style="bold yellow",
)
terminal_stderr.print()
Expand Down
8 changes: 4 additions & 4 deletions dtcli/src/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ def find_missing_dataset_files(
existing_files = []
for f in file_paths:
if Path(root_path + f).exists():
logger.debug(f"- {f} : ")
logger.debug(f"- {f} : present")
existing_files.append(f)
else:
logger.debug(f"- {f} : ")
logger.debug(f"- {f} : missing")
missing_files.append(f)

else:
Expand Down Expand Up @@ -374,10 +374,10 @@ def clear_dataset_path(
files: List[Path] = [f for f in parent.iterdir()]
logger.debug(f"files: {files}")
if files:
logger.debug(f"{parent}: ")
logger.debug(f"{parent}: failed")
clear_parents = False
else:
logger.debug(f"{parent}: ")
logger.debug(f"{parent}: ok")
parent.rmdir()
time.sleep(0.1)
parent = parent.parent
Expand Down
4 changes: 2 additions & 2 deletions dtcli/unregistered.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def summary(
total = sum(results.values())

table = Table(
title=f"Summary of reasons {total:,} unregistered datasets",
title=f"Summary of reasons - {total:,} unregistered datasets",
header_style="magenta",
title_style="bold magenta",
row_styles=["none", "dim"],
Expand Down Expand Up @@ -94,7 +94,7 @@ def summary(
reasons.sort(key=lambda reason: reason[1], reverse=True)
for row, (detail, count) in enumerate(reasons):
if category in ("ATTACH_MISSING", "CREATE_DUPLICATE"):
detail = detail.replace(":", " ", 1)
detail = detail.replace(":", " -> ", 1)
table.add_row(
Text(category, style=style) if row == 0 else "",
Text(detail) if detail else "(no reason recorded)",
Expand Down
2 changes: 1 addition & 1 deletion dtcli/utilities/cadcclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get(
):
with attempt:
storage.cadcget(filename, destination[index]) # type: ignore
logger.debug(f"{filename} {destination[index]} ")
logger.debug(f"{filename} -> {destination[index]} ok")
except cadcutils.exceptions.NotFoundException as error: # type: ignore
logger.error(f"CADC Exception: {filename}")
not_found.append(str(error))
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,4 +725,6 @@ def test_check_version_banner_on_stderr(monkeypatch, capsys) -> None:
cli_module.check_version()
captured = capsys.readouterr()
assert "A new release of datatrail-cli is available" in captured.err
assert " -> 99.0.0" in captured.err
assert captured.err.isascii()
assert "A new release of datatrail-cli is available" not in captured.out
Loading