protonfs.usage.model module¶
Value types the du engine returns: Entry, Breakdown and their enums.
UsageEngine produces these; the terminal report and the web
UI read them. Every figure carries the Unix time it was measured (at).
Added in version 3.4.0.
- class protonfs.usage.model.Breakdown(path, size, descendants, at, state, entries, gap, gap_kind, oldest_at, newest_at, error=None, invalid=False)[source]¶
Bases:
objectA folder’s size split into its listed children plus a labelled remainder.
size == Σ entry sizes + Σ hidden-row sizes + gapwhenever every counted child has a figure. Hidden (-X) children are not inentriesbut still count towardgapandgap_kind.- Variables:
path – escaped Drive path of the folder (
"/"for the account view).size – the folder total in bytes, or
Nonewhen unknown.descendants – node count beneath the folder, or
Nonewhen unknown.at – Unix time
sizewas measured (for/, the oldest entry’s time).state –
LISTEDwith entries;SIZEDwhen only the total is cached;UNMEASUREDwhen nothing is known;EXCLUDEDwhen the folder itself matches an exclusion rule;ERRORwhen itssizeorlistcall failed;PARTIAL(/and/devicesonly) whensizeleaves out an unmeasured or hidden section or device.entries – the visible children in listing order; empty when no listing is cached or the folder’s own call failed.
gap –
sizeminus the known child sizes, orNonewithout a listing.gap_kind – the label of
gap, seeGapKind.oldest_at – the oldest measurement time among all inputs, or
None.newest_at – the newest measurement time among all inputs, or
None.error – the failure text when
stateisERROR, elseNone.invalid –
Truewhen the cached listing was invalidated by a newer measurement of one of its children (soentriesmay no longer add up tosize); a fresh pass replaces it.Falseotherwise, including when nothing is cached.
Added in version 3.4.0.
- class protonfs.usage.model.Entry(name, path, kind, uid, size, descendants, at, state, exclusion, mtime, decrypted, error=None)[source]¶
Bases:
objectOne child of a breakdown: a file, a folder or (in the
/view) an account section.- Variables:
name – plain (unescaped) name; the node uid when the name could not be decrypted.
path – escaped Drive path of the node.
kind –
"file","folder"or"section"(entries of the/view).uid – Drive node uid, if known.
size – bytes (encrypted
totalStorageSize, trashed descendants included for folders), orNonewhen unknown.descendants – node count beneath a folder,
Nonefor files or when unknown.at – Unix time the size was measured, or
Nonewhen unknown.state – what is known, see
NodeState.exclusion – the freeze/hide rule that matched, or
Exclusion.NONE.mtime –
modificationTimefrom the listing, if any.decrypted – whether
nameis the decrypted name.error – the failure text when
stateisERROR, elseNone.
Added in version 3.4.0.
- class protonfs.usage.model.GapKind(*values)[source]¶
Bases:
EnumHow the remainder of a folder’s size, beyond its listed children, is labelled.
NONE: there is no remainder (or no breakdown to compute one from).TRASH("in_trash"): every input comes from one pass and every counted child has a figure, so the remainder is trashed items whose original parent is this folder.UNATTRIBUTED: some child (excluded, failed or unmeasured) has no figure, so the remainder includes its bytes.UNRECONCILED: the remainder is negative, or the inputs come from different passes, so it cannot be attributed.
Added in version 3.4.0.
- NONE = 'none'¶
- TRASH = 'in_trash'¶
- UNATTRIBUTED = 'unattributed'¶
- UNRECONCILED = 'unreconciled'¶
- class protonfs.usage.model.NodeState(*values)[source]¶
Bases:
EnumWhat is known about a node.
LISTED: a folder whose own listing is cached (it can be broken down).SIZED: a size figure is known but no listing (always the case for files).EXCLUDED: a folder matched by a freeze rule; its cached figure, if any, is shown without being refreshed.UNMEASURED: no figure is known (nothing cached, or the node cannot be sized).ERROR: the Drive call for this node failed; see theerrortext.PARTIAL: only for the/and/devicesviews: the total leaves out a section or device that counts toward “used” (/my-files,/devicesor a device) but has no figure or is hidden. The entries show which.
Added in version 3.4.0.
- ERROR = 'error'¶
- EXCLUDED = 'excluded'¶
- LISTED = 'listed'¶
- PARTIAL = 'partial'¶
- SIZED = 'sized'¶
- UNMEASURED = 'unmeasured'¶