Option C Tools
Loading...
Searching...
No Matches
progress.ProgressTracker Class Reference

Public Member Functions

None __init__ (self, list[str] tasks, *, str title="", TextIO|None stream=None, bool quiet=False)
None start_task (self, str name, int total=0)
None tick (self, int n=1)
None complete_task (self, str name, *, str summary="")
None fail_task (self, str name, *, str summary="")
None skip_task (self, str name, *, str summary="")
 task (self, str name, int total=0)
None finish (self)

Protected Member Functions

None _write_line (self, str text)
None _render_status (self)
None _clear_status (self)

Protected Attributes

 _tasks = list(tasks)
 _title = title
 _stream = stream or sys.stderr
 _quiet = quiet
 _is_tty = hasattr(self._stream, "isatty") and self._stream.isatty()
 _lock = threading.Lock()
str|None _current = None
int _progress = 0
int _total = 0
float _task_start = 0.0
dict _done = {}

Detailed Description

Task checklist with optional per-task progress bar.

Definition at line 45 of file progress.py.

Constructor & Destructor Documentation

◆ __init__()

None progress.ProgressTracker.__init__ ( self,
list[str] tasks,
* ,
str title = "",
TextIO | None stream = None,
bool quiet = False )

Definition at line 48 of file progress.py.

Member Function Documentation

◆ _clear_status()

None progress.ProgressTracker._clear_status ( self)
protected

Definition at line 186 of file progress.py.

Here is the caller graph for this function:

◆ _render_status()

None progress.ProgressTracker._render_status ( self)
protected

Definition at line 163 of file progress.py.

Here is the caller graph for this function:

◆ _write_line()

None progress.ProgressTracker._write_line ( self,
str text )
protected

Definition at line 156 of file progress.py.

Here is the caller graph for this function:

◆ complete_task()

None progress.ProgressTracker.complete_task ( self,
str name,
* ,
str summary = "" )

Definition at line 93 of file progress.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fail_task()

None progress.ProgressTracker.fail_task ( self,
str name,
* ,
str summary = "" )

Definition at line 107 of file progress.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finish()

None progress.ProgressTracker.finish ( self)

Definition at line 145 of file progress.py.

Here is the call graph for this function:

◆ skip_task()

None progress.ProgressTracker.skip_task ( self,
str name,
* ,
str summary = "" )

Definition at line 121 of file progress.py.

Here is the call graph for this function:

◆ start_task()

None progress.ProgressTracker.start_task ( self,
str name,
int total = 0 )

Definition at line 72 of file progress.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ task()

progress.ProgressTracker.task ( self,
str name,
int total = 0 )

Definition at line 136 of file progress.py.

Here is the call graph for this function:

◆ tick()

None progress.ProgressTracker.tick ( self,
int n = 1 )

Definition at line 85 of file progress.py.

Here is the call graph for this function:

Member Data Documentation

◆ _current

str | None progress.ProgressTracker._current = None
protected

Definition at line 63 of file progress.py.

◆ _done

dict progress.ProgressTracker._done = {}
protected

Definition at line 67 of file progress.py.

◆ _is_tty

progress.ProgressTracker._is_tty = hasattr(self._stream, "isatty") and self._stream.isatty()
protected

Definition at line 60 of file progress.py.

◆ _lock

progress.ProgressTracker._lock = threading.Lock()
protected

Definition at line 62 of file progress.py.

◆ _progress

int progress.ProgressTracker._progress = 0
protected

Definition at line 64 of file progress.py.

◆ _quiet

progress.ProgressTracker._quiet = quiet
protected

Definition at line 59 of file progress.py.

◆ _stream

progress.ProgressTracker._stream = stream or sys.stderr
protected

Definition at line 58 of file progress.py.

◆ _task_start

float progress.ProgressTracker._task_start = 0.0
protected

Definition at line 66 of file progress.py.

◆ _tasks

progress.ProgressTracker._tasks = list(tasks)
protected

Definition at line 56 of file progress.py.

◆ _title

progress.ProgressTracker._title = title
protected

Definition at line 57 of file progress.py.

◆ _total

int progress.ProgressTracker._total = 0
protected

Definition at line 65 of file progress.py.


The documentation for this class was generated from the following file: