|
|
None | __init__ (self, float|None min=None, float|None max=None, bool min_open=False, bool max_open=False, bool clamp=False) |
| |
| dict[str, t.Any] | to_info_dict (self) |
| |
| t.Any | convert (self, t.Any value, Parameter|None param, Context|None ctx) |
| |
|
str | __repr__ (self) |
| |
|
t.Any | __call__ (self, t.Any value, Parameter|None param=None, Context|None ctx=None) |
| |
| str|None | get_metavar (self, Parameter param, Context ctx) |
| |
| str|None | get_missing_message (self, Parameter param, Context|None ctx) |
| |
| cabc.Sequence[str] | split_envvar_value (self, str rv) |
| |
| t.NoReturn | fail (self, str message, Parameter|None param=None, Context|None ctx=None) |
| |
| list[CompletionItem] | shell_complete (self, Context ctx, Parameter param, str incomplete) |
| |
|
|
| min |
| |
|
| max |
| |
|
| min_open |
| |
|
| max_open |
| |
|
| clamp |
| |
|
| envvar_list_splitter |
| |
|
|
t | is_composite = False |
| |
|
t | arity = 1 |
| |
|
str | name |
| |
|
t | envvar_list_splitter = None |
| |
|
t | _number_class .ClassVar[type[t.Any]] |
| |
◆ _clamp()
| float click.types._NumberRangeBase._clamp |
( |
|
self, |
|
|
float |
bound, |
|
|
t.Literal[1, -1] |
dir, |
|
|
bool |
open |
|
) |
| |
|
protected |
Find the valid value to clamp to bound in the given
direction.
:param bound: The boundary value.
:param dir: 1 or -1 indicating the direction to move.
:param open: If true, the range does not include the bound.
Reimplemented in click.types.FloatRange, and click.types.IntRange.
◆ _describe_range()
| str click.types._NumberRangeBase._describe_range |
( |
|
self | ) |
|
|
protected |
Describe the range for use in help text.
◆ convert()
| t.Any click.types._NumberRangeBase.convert |
( |
|
self, |
|
|
t.Any |
value, |
|
|
Parameter | None |
param, |
|
|
Context | None
|
ctx |
|
) |
| |
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 :meth:`fail` with a
descriptive message.
:param value: The value to convert.
:param param: The parameter that is using this type to convert
its value. May be ``None``.
:param ctx: The current context that arrived at this value. May
be ``None``.
Reimplemented from click.types._NumberParamTypeBase.
◆ to_info_dict()
| dict[str, t.Any] click.types._NumberRangeBase.to_info_dict |
( |
|
self | ) |
|
Gather information that could be useful for a tool generating
user-facing documentation.
Use :meth:`click.Context.to_info_dict` to traverse the entire
CLI structure.
.. versionadded:: 8.0
Reimplemented from click.types.ParamType.
The documentation for this class was generated from the following file:
- docs/help/help-venv/lib/python3.12/site-packages/click/types.py