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
Parameters:
obj
-
The object to access
TYPE:
Any
name
-
A dotted name to the value, such as
mykey.0.name
TYPE:
str
default
-
If the name cannot be resolved from the object, return this value
TYPE:
Any
DEFAULT:
None
err_on_missing
-
Raise a
BadInputError
if the name cannot be resolvedTYPE:
bool
DEFAULT:
False
Returns:
-
Any
-
The value at the resolved name or the default value.
Raises:
-
BadInputError
-
If we cannot resolve the name and
err_on_missing
isTrue
-
AttributeError
-
If a @property decorator raised it
-
TypeError
-
If a @property decorator raised it