clap_python.style
clap_python.style contains all classes to style arg-parser stdout.
- class clap_python.style.AnsiColor(value)[source]
Bases:
IntEnumEnum for ANSI color codes.
- Black = 30
- Blue = 34
- BrightBlack = 90
- BrightBlue = 94
- BrightCyan = 96
- BrightGreen = 92
- BrightMagenta = 95
- BrightRed = 91
- BrightWhite = 97
- BrightYellow = 93
- Cyan = 36
- Green = 32
- Magenta = 35
- Red = 31
- White = 37
- Yellow = 33
- class clap_python.style.AnsiStyle(value)[source]
Bases:
IntEnumEnum for ANSI text styles.
- Blink = 5
- Bold = 1
- Dim = 2
- Hidden = 8
- Inverse = 7
- Italic = 3
- Normal = 0
- Strikethrough = 9
- Underline = 4
- class clap_python.style.Style[source]
Bases:
objectClass for managing text styles.
This class allows you to set and retrieve styles for different text elements in a terminal application. You can customize styles for usage information, headers, error messages, flags, and tips.
- error(style)[source]
Sets the style for error messages.
- Return type:
- Args:
style (TextStyle): The text style to be set for error messages.
- Returns:
Style: The current Style instance for method chaining.
- flags(style)[source]
Sets the style for flags.
- Return type:
- Args:
style (TextStyle): The text style to be set for flags.
- Returns:
Style: The current Style instance for method chaining.
- headers(style)[source]
Sets the style for headers.
- Return type:
- Args:
style (TextStyle): The text style to be set for headers.
- Returns:
Style: The current Style instance for method chaining.
- tip(style)[source]
Sets the style for tips.
- Return type:
- Args:
style (TextStyle): The text style to be set for tips.
- Returns:
Style: The current Style instance for method chaining.
- class clap_python.style.TextStyle(color, style=AnsiStyle.Normal)[source]
Bases:
objectClass representing how to format and style text.
- Attributes:
color: The color of the text. style: The style of the text (default is Normal).
- __eq__(other)
Return self==value.
- __hash__ = None
- __repr__()
Return repr(self).