show
Functions for displaying information about the version.
Classes¶
Functions:¶
do_show
¶
do_show(*args, config: Config, format_: str = 'default', increment: Optional[str] = None, current_version: Optional[str] = None) -> None
Show current version or configuration information.
output_default
¶
output_default(value: dict) -> None
Output the value with key=value or just value if there is only one item.
resolve_name
¶
resolve_name(obj: Any, name: str, default: Any = None, err_on_missing: bool = False) -> Any
Get a key or attr name from obj or default value.
Copied and modified from Django Template variable resolutions
Resolution methods:
- Mapping key lookup
- Attribute lookup
- Sequence index
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object to access
TYPE:
|
name
|
A dotted name to the value, such as
TYPE:
|
default
|
If the name cannot be resolved from the object, return this value
TYPE:
|
err_on_missing
|
Raise a
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Any
|
The value at the resolved name or the default value. |
| RAISES | DESCRIPTION |
|---|---|
BadInputError
|
If we cannot resolve the name and |
AttributeError
|
If a @property decorator raised it |
TypeError
|
If a @property decorator raised it |