synology_apm_repo.sdk.presentation.export_report module¶
How an export is described to the user, shared by the CLI’s export
command and the Browser’s export worker: its byte counts, what a failed sink
left on disk, and which failures mean “no room left”.
- synology_apm_repo.sdk.presentation.export_report.NO_SPACE_ERRNOS = frozenset({28, 122})¶
errnovalues that mean the destination has no room left, from a full filesystem or the user’s quota on it.
- class synology_apm_repo.sdk.presentation.export_report.LeftoverOutcome(*args, **kwargs)¶
Bases:
ProtocolWhat
ExportSink.abortreports (AbortOutcomesatisfies this).
- class synology_apm_repo.sdk.presentation.export_report.AbortableSink(*args, **kwargs)¶
Bases:
ProtocolA sink an unfinished export can abort (
LocalFileSinksatisfies this).- async abort()¶
- class synology_apm_repo.sdk.presentation.export_report.ExportSizes(*args, **kwargs)¶
Bases:
ProtocolAn export’s byte counts (
ExportResultsatisfies this).
- synology_apm_repo.sdk.presentation.export_report.size_summary(sizes)¶
"<written> written, <logical> logical, <holes> holes, <zeros> zero-fill".
- synology_apm_repo.sdk.presentation.export_report.is_out_of_space(exc)¶
Whether
excis anOSErrorfor a full filesystem or an exceeded quota.
- synology_apm_repo.sdk.presentation.export_report.leftover_note(outcome, part_name, *, keep_partial_hint=False)¶
What an unfinished export left on disk, phrased from the sink’s
abort()outcome.keep_partial_hintadds the--keep-partialadvice where the surface has that option.
- synology_apm_repo.sdk.presentation.export_report.out_of_space_message(output, exc, outcome, part_name, *, keep_partial_hint=False)¶
The message for an export that ran out of room writing
output, with what it left behind.excsatisfiesis_out_of_space.
- class synology_apm_repo.sdk.presentation.export_report.ExportTracker(destination, sink=None, label='', done=0, total=None)¶
Bases:
objectWhat an export in flight is writing — the current item’s sink, destination and label, and for a folder how many files are done — so a cancel or a full disk reports on the right file. Updated as the export runs, hence not frozen.
- Variables:
destination (pathlib.Path) – Where the current item is written.
sink (synology_apm_repo.sdk.presentation.export_report.AbortableSink | None) – The current item’s sink;
Nonebefore it starts and once it is committed, when a cancel has nothing of it to report.label (str) – The current item’s name within a folder export (
""for one item).done (int) – Folder files exported so far.
total (int | None) – The folder’s file count;
Nonefor a single item.
- sink: AbortableSink | None = None¶
- item_started(sink, destination, label)¶
A folder export moved on to the item
label, written throughsinktodestination.
- item_finished()¶
The current folder item was committed.
- files_note()¶
"<done> of <total> files had been exported"for a folder export, elseNone.
- async leftover(*, keep_partial_hint=False)¶
Aborts the current item’s sink (idempotent) and says what it left on disk (
leftover_note);Nonewhen no item is in flight.
- async out_of_space(exc, *, keep_partial_hint=False)¶
out_of_space_messagefor the current item, aborting its sink; without an item in flight, just the reason.excsatisfiesis_out_of_space.