ClickProgressHandler¶
-
class
lsst.daf.butler.cli.progress.
ClickProgressHandler
(**kwargs)¶ Bases:
lsst.daf.butler.core.progress.ProgressHandler
A
ProgressHandler
implementation that delegates toclick.progressbar
.Parameters: - **kwargs
Additional keyword arguments to pass to
click.progressbar
. May not includeiterable
,length
, orlabel
, as these are passed directly fromget_progress_bar
arguments.
Methods Summary
callback
(ctx, params, value)A click
callback that installs this handler as the global handler for progress bars.get_progress_bar
(iterable, None], desc, …)Create a new progress bar. option
(cmd)A click
command decorator that adds a--progress
option that installs a default-constructed instance of this progress handler.Methods Documentation
-
classmethod
callback
(ctx: click.core.Context, params: click.core.Parameter, value: Any) → None¶ A
click
callback that installs this handler as the global handler for progress bars.Should usually be called only by the
option
method.
-
get_progress_bar
(iterable: collections.abc.Iterable[~_T] | None[collections.abc.Iterable[_T], None], desc: str | None[str, None], total: int | None[int, None], level: int) → ContextManager[lsst.daf.butler.core.progress.ProgressBar[_T]]¶ Create a new progress bar.
Parameters: - iterable :
Iterable
orNone
An arbitrary Python iterable that will be iterated over when the returned
ProgressBar
is. IfNone
, whether the progress bar is iterable is handler-defined, but it may be updated manually.- desc: `str`
A user-friendly description for this progress bar; usually appears next to it
- total :
int
orNone
The total number of steps in this progress bar. If
None`
,len(iterable)
should be used. If that does not work, whether the progress bar works at all is handler-defined.- level :
int
A
logging
level value (defaults tologging.INFO
) associated with the process reporting progress. Handlers are not responsible for disabling progress reporting on levels, but may utilize level information to annotate them differently.
- iterable :
-
classmethod
option
(cmd: Any) → Any¶ A
click
command decorator that adds a--progress
option that installs a default-constructed instance of this progress handler.