gitea.cli.utils.convert
convert
Utility functions for converting data types.
Functions:
gitea.cli.utils.convert.list_str_to_list_int
Convert a list of strings to a list of integers if possible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
list[str]
|
A list of strings. |
required |
Returns:
| Type | Description |
|---|---|
list[int] | list[str]
|
A list of integers if all strings can be converted to integers, otherwise the original list of strings. |
Source code in src/gitea/cli/utils/convert.py
gitea.cli.utils.convert.list_str_to_list_int_or_none
Convert a list of strings to a list of integers if possible, or return None.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
list[str] | None
|
A list of strings or None. |
required |
Returns:
| Type | Description |
|---|---|
list[int] | list[str] | None
|
A list of integers if all strings can be converted to integers, otherwise the original list of strings, or None if the input is None. |