harbor_cli.types
Attributes
T = TypeVar('T')
module-attribute
SEQUENCE_TYPES = (Sequence, abc.Sequence, list, List, tuple, Tuple, set, Set)
module-attribute
Classes
RichTableKwargs
Bases: TypedDict
Source code in harbor_cli/types.py
Attributes
caption: Optional[TextType]
instance-attribute
width: Optional[int]
instance-attribute
min_width: Optional[int]
instance-attribute
box: Optional[box.Box]
instance-attribute
safe_box: Optional[bool]
instance-attribute
padding: PaddingDimensions
instance-attribute
collapse_padding: bool
instance-attribute
pad_edge: bool
instance-attribute
expand: bool
instance-attribute
show_header: bool
instance-attribute
show_footer: bool
instance-attribute
show_edge: bool
instance-attribute
show_lines: bool
instance-attribute
leading: int
instance-attribute
style: StyleType
instance-attribute
row_styles: Optional[Iterable[StyleType]]
instance-attribute
header_style: Optional[StyleType]
instance-attribute
footer_style: Optional[StyleType]
instance-attribute
border_style: Optional[StyleType]
instance-attribute
title_style: Optional[StyleType]
instance-attribute
caption_style: Optional[StyleType]
instance-attribute
title_justify: 'JustifyMethod'
instance-attribute
caption_justify: 'JustifyMethod'
instance-attribute
highlight: bool
instance-attribute
Functions
is_sequence_func(func: Callable[[Any], Any]) -> bool
Checks if a callable takes a sequence as its first argument.
Source code in harbor_cli/types.py
is_sequence_annotation(annotation: Any) -> bool
Source code in harbor_cli/types.py
assert_type(value: Any, expect_type: Type[T]) -> T
Assert that a value is of a given type.
Not to be confused with typing.assert_type which was introcduced in 3.11! Unfortunate naming collision, but typing.assert_type has no runtime effect, while this function has.