swh.storage.proxies.masking.cli module#

swh.storage.proxies.masking.cli.storage_config_iter(storage_config: Dict[str, Any]) Iterator[Dict[str, Any]][source]#
exception swh.storage.proxies.masking.cli.EditAborted[source]#

Bases: BaseException

swh.storage.proxies.masking.cli.edit_message(prompt: str, extra_lines: List[str] = [])[source]#

Edit a message through click.edit() adding some extra context, filtering comments, and raising an exception on empty messages

class swh.storage.proxies.masking.cli.RequestType[source]#

Bases: ParamType

name: str = 'request slug or uuid'#

the descriptive name of this type

convert(value, param, ctx) MaskingRequest[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 and ctx arguments may be None 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.storage.proxies.masking.cli.SWHIDType[source]#

Bases: ParamType

name: str = 'swhid'#

the descriptive name of this type

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 and ctx arguments may be None 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.storage.proxies.masking.cli.MaskedStateType[source]#

Bases: Choice

swh.storage.proxies.masking.cli.parse_masked_state(str: str) MaskedState[source]#
swh.storage.proxies.masking.cli.format_masked_state(state: MaskedState) str[source]#
swh.storage.proxies.masking.cli.read_swhids(file: TextIO) List[ExtendedSWHID][source]#
swh.storage.proxies.masking.cli.output_message(message: str) Iterator[str][source]#
swh.storage.proxies.masking.cli.read_display_names(file: Iterable) List[Tuple[bytes, bytes]][source]#