class documentation

class CurrentStep: (source)

Constructor: CurrentStep(step)

View In Hierarchy

Wrapper describing a step of an operation progress tracker.

This class wraps a ProgressTracker.Step instance and exposes convenient accessors that normalize missing fields as None.

When a step includes work estimates (work_done), the work_fraction helper converts them into a usable fraction. The method returns None when the fraction cannot be computed.

Example

Inspecting steps and progress:

tracker = operation.progress_tracker()
if tracker:
    for step in tracker.steps():
        fraction = step.work_fraction()
        if fraction is None:
            print(step.description())
        else:
            print(f"{step.description()}: {fraction:.0%}")
Method __init__ Undocumented
Method __repr__ Undocumented
Method description Return a human-readable description of the step.
Method finished_at Return the step finished timestamp or None if unfinished.
Method started_at Return the step start timestamp or None if unknown.
Method work_done Return work progress details for the step when available.
Method work_fraction Return the completed work fraction or None when unavailable.
Instance Variable _step Undocumented
def __init__(self, step: object): (source)

Undocumented

def __repr__(self) -> str: (source)

Undocumented

def description(self) -> str: (source)

Return a human-readable description of the step.

def finished_at(self) -> datetime | None: (source)

Return the step finished timestamp or None if unfinished.

def started_at(self) -> datetime | None: (source)

Return the step start timestamp or None if unknown.

Return work progress details for the step when available.

def work_fraction(self) -> float | None: (source)

Return the completed work fraction or None when unavailable.

Undocumented