protonfs.commands.trash module¶
Inspect and empty Proton Drive’s trash (#70, M6.2).
rm puts things INTO trash and restore pulls them back out, but neither lets a user see what is in trash or empty it – and proton-drive >= 0.5.0 resolves /trash paths by name with first-match-wins (#56), so stale same-named entries can silently make restore refuse to act. trash list surfaces that ambiguity directly (same-name duplicate counts); trash empty wraps the account-global, irreversible filesystem empty-trash behind an explicit typed confirmation.
Deliberately out of scope: selective/per-item permanent deletion from trash by UID – proton-drive does not accept UIDs for /trash paths (see #56’s analysis and the duplicate-basename guard in commands/rm.py), so there is no safe way to target a single item there yet.
Added in version 1.0.0.
- protonfs.commands.trash.empty_trash(ctx, confirmed, reporter=None)[source]¶
Permanently empty /trash for the whole account. Irreversible, and NOT scoped to this repo’s remote_root – it empties every trashed item on the account, not just ones protonfs put there. Requires the user to type an exact confirmation phrase unless confirmed (–yes) is set.
- Parameters:
ctx (
RepoContext) – the loaded repo context.confirmed (
bool) – skip the interactive typed confirmation (the--yesflag).reporter –
Reporterto narrate progress through; defaults to the process reporter (get_reporter()).
- Return type:
- protonfs.commands.trash.list_trash(ctx, console)[source]¶
Render every item in /trash: name, original parent (best-effort – “?” when proton-drive can’t resolve it), and how many OTHER trashed items share the same name. A nonzero duplicate count is exactly the ambiguity restore warns about (#56): proton-drive would act on the first name-match, not necessarily this one.
- Return type: