swh.alter.cli module#
- class swh.alter.cli.SWHIDType[source]#
Bases:
ParamType
- convert(value, param, ctx) ExtendedSWHID [source]#
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.
- class swh.alter.cli.SwhidOrUrlParamType[source]#
Bases:
ParamType
- convert(value, param, ctx)[source]#
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.
- class swh.alter.cli.ClickLoggingHandler(level=0)[source]#
Bases:
Handler
Handler displaying logs using click.secho(), passing the style extra attribute.
Initializes the instance - basically setting the formatter to None and the filter list to empty.
- swh.alter.cli.progressbar(iterable: Iterable[V] | None = None, length: int | None = None, label: str | None = None, show_eta: bool = True, show_pos: bool = False, show_percent: bool | None = None, item_show_func: Callable[[V], str] | None = None) ProgressBar[V] [source]#
- swh.alter.cli.prompting_object_decryption_key_provider(manifest, known_mnemonics=None, identity_files=None, show_decrypted_mnemonics=False) str [source]#
- class swh.alter.cli.ContentSWHID[source]#
Bases:
ParamType
- convert(value, param, ctx)[source]#
Convert the value to the correct type. This is not called if the value is
None
(the missing value).This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.
The
param
andctx
arguments may beNone
in certain situations, such as when converting prompt input.If the value cannot be converted, call
fail()
with a descriptive message.- Parameters:
value – The value to convert.
param – The parameter that is using this type to convert its value. May be
None
.ctx – The current context that arrived at this value. May be
None
.