fix: name the folder whose files could not be read

This commit is contained in:
Abdessamad Derraz committed 2026-10-24 04:09:01 +02:00
1 parent c3978ec467
commit 536081ffb1
2 files changed
+6 -2

No files matched your search

+4 -1
View File
@@ -11974,7 +11974,10 @@ def _scan_lines(state: TuiState) -> list[str]:
for drive in scan["other_drives"]]
if state.unreadable:
count = len(state.unreadable)
lines.append(f"{_plural(count, 'file')} on your old card could not be read.")
# Named as it was given: "your old card" was said of a folder.
where = ", ".join(_last_name(folder) for folder in
dict.fromkeys(event["folder"] for event in state.unreadable))
lines.append(f"{_plural(count, 'file')} in {where} could not be read.")
return lines
+2 -1
View File
@@ -2535,7 +2535,8 @@ class AuditRoundThree(unittest.TestCase):
text = " ".join(" ".join(install.tui_view(state, 120, 40)).split())
self.assertIn("Read the first 200,000 files of E:\\.", text)
self.assertIn("E:\\D is another drive: add it to copy from it too.", text)
self.assertIn("2 files on your old card could not be read.", text)
# The folder by its name: "your old card" was said of any folder.
self.assertIn("2 files in E:\\ could not be read.", text)
rows = install.tui_rows(state)
state.focus["plan"] = next(i for i, row in enumerate(rows) if row.action == "unreadable")
press(state, "enter")