![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|

Public Member Functions | |
| __init__ (self, *Optional[Union[Color, str]] color=None, Optional[Union[Color, str]] bgcolor=None, Optional[bool] bold=None, Optional[bool] dim=None, Optional[bool] italic=None, Optional[bool] underline=None, Optional[bool] blink=None, Optional[bool] blink2=None, Optional[bool] reverse=None, Optional[bool] conceal=None, Optional[bool] strike=None, Optional[bool] underline2=None, Optional[bool] frame=None, Optional[bool] encircle=None, Optional[bool] overline=None, Optional[str] link=None, Optional[Dict[str, Any]] meta=None) | |
| "Style" | null (cls) |
| "Style" | from_color (cls, Optional[Color] color=None, Optional[Color] bgcolor=None) |
| "Style" | from_meta (cls, Optional[Dict[str, Any]] meta) |
| "Style" | on (cls, Optional[Dict[str, Any]] meta=None, **Any handlers) |
| str | link_id (self) |
| str | __str__ (self) |
| bool | __bool__ (self) |
| str | normalize (cls, str style) |
| StyleType | pick_first (cls, *Optional[StyleType] values) |
| Result | __rich_repr__ (self) |
| bool | __eq__ (self, Any other) |
| bool | __ne__ (self, Any other) |
| int | __hash__ (self) |
| Optional[Color] | color (self) |
| Optional[Color] | bgcolor (self) |
| Optional[str] | link (self) |
| bool | transparent_background (self) |
| "Style" | background_style (self) |
| Dict[str, Any] | meta (self) |
| "Style" | without_color (self) |
| "Style" | parse (cls, str style_definition) |
| str | get_html_style (self, Optional[TerminalTheme] theme=None) |
| "Style" | combine (cls, Iterable["Style"] styles) |
| "Style" | chain (cls, *"Style" styles) |
| "Style" | copy (self) |
| "Style" | clear_meta_and_links (self) |
| "Style" | update_link (self, Optional[str] link=None) |
| str | render (self, str text="", *Optional[ColorSystem] color_system=ColorSystem.TRUECOLOR, bool legacy_windows=False) |
| None | test (self, Optional[str] text=None) |
| "Style" | __add__ (self, Optional["Style"] style) |
Public Attributes | |
| color | |
| bgcolor | |
| link | |
Static Public Attributes | |
| dict | STYLE_ATTRIBUTES |
| bold = _Bit(0) | |
| dim = _Bit(1) | |
| italic = _Bit(2) | |
| underline = _Bit(3) | |
| blink = _Bit(4) | |
| blink2 = _Bit(5) | |
| reverse = _Bit(6) | |
| conceal = _Bit(7) | |
| strike = _Bit(8) | |
| underline2 = _Bit(9) | |
| frame = _Bit(10) | |
| encircle = _Bit(11) | |
| overline = _Bit(12) | |
Protected Member Functions | |
| str | _make_ansi_codes (self, ColorSystem color_system) |
| "Style" | _add (self, Optional["Style"] style) |
Protected Attributes | |
| _color | |
| _bgcolor | |
| _set_attributes | |
| _attributes | |
| _link | |
| _meta | |
| _link_id | |
| _null | |
| _style_definition | |
| _ansi | |
| _hash | |
Static Protected Attributes | |
| Optional | _color [Color] |
| Optional | _bgcolor [Color] |
| int | _attributes |
| int | _set_attributes |
| Optional | _hash [int] |
| bool | _null |
| Optional | _meta [bytes] |
| dict | _style_map |
A terminal style.
A terminal style consists of a color (`color`), a background color (`bgcolor`), and a number of attributes, such
as bold, italic etc. The attributes have 3 states: they can either be on
(``True``), off (``False``), or not set (``None``).
Args:
color (Union[Color, str], optional): Color of terminal text. Defaults to None.
bgcolor (Union[Color, str], optional): Color of terminal background. Defaults to None.
bold (bool, optional): Enable bold text. Defaults to None.
dim (bool, optional): Enable dim text. Defaults to None.
italic (bool, optional): Enable italic text. Defaults to None.
underline (bool, optional): Enable underlined text. Defaults to None.
blink (bool, optional): Enabled blinking text. Defaults to None.
blink2 (bool, optional): Enable fast blinking text. Defaults to None.
reverse (bool, optional): Enabled reverse text. Defaults to None.
conceal (bool, optional): Enable concealed text. Defaults to None.
strike (bool, optional): Enable strikethrough text. Defaults to None.
underline2 (bool, optional): Enable doubly underlined text. Defaults to None.
frame (bool, optional): Enable framed text. Defaults to None.
encircle (bool, optional): Enable encircled text. Defaults to None.
overline (bool, optional): Enable overlined text. Defaults to None.
link (str, link): Link URL. Defaults to None. | bool pip._vendor.rich.style.Style.__bool__ | ( | self | ) |
A Style is false if it has no attributes, colors, or links.
| str pip._vendor.rich.style.Style.__str__ | ( | self | ) |
Re-generate style definition from attributes.
|
protected |
Generate ANSI codes for this style.
Args:
color_system (ColorSystem): Color system.
Returns:
str: String containing codes.
| "Style" pip._vendor.rich.style.Style.background_style | ( | self | ) |
A Style with background only.
| Optional[Color] pip._vendor.rich.style.Style.bgcolor | ( | self | ) |
The background color or None if it is not set.
| "Style" pip._vendor.rich.style.Style.chain | ( | cls, | |
| *"Style" | styles | ||
| ) |
Combine styles from positional argument in to a single style.
Args:
*styles (Iterable[Style]): Styles to combine.
Returns:
Style: A new style instance.
| "Style" pip._vendor.rich.style.Style.clear_meta_and_links | ( | self | ) |
Get a copy of this style with link and meta information removed.
Returns:
Style: New style object.
| Optional[Color] pip._vendor.rich.style.Style.color | ( | self | ) |
The foreground color or None if it is not set.
| "Style" pip._vendor.rich.style.Style.combine | ( | cls, | |
| Iterable["Style"] | styles | ||
| ) |
Combine styles and get result.
Args:
styles (Iterable[Style]): Styles to combine.
Returns:
Style: A new style instance.
| "Style" pip._vendor.rich.style.Style.copy | ( | self | ) |
Get a copy of this style.
Returns:
Style: A new Style instance with identical attributes.
| "Style" pip._vendor.rich.style.Style.from_color | ( | cls, | |
| Optional[Color] | color = None, |
||
| Optional[Color] | bgcolor = None |
||
| ) |
Create a new style with colors and no attributes.
Returns:
color (Optional[Color]): A (foreground) color, or None for no color. Defaults to None.
bgcolor (Optional[Color]): A (background) color, or None for no color. Defaults to None.
| "Style" pip._vendor.rich.style.Style.from_meta | ( | cls, | |
| Optional[Dict[str, Any]] | meta | ||
| ) |
Create a new style with meta data.
Returns:
meta (Optional[Dict[str, Any]]): A dictionary of meta data. Defaults to None.
| str pip._vendor.rich.style.Style.get_html_style | ( | self, | |
| Optional[TerminalTheme] | theme = None |
||
| ) |
Get a CSS style rule.
| Optional[str] pip._vendor.rich.style.Style.link | ( | self | ) |
Link text, if set.
| str pip._vendor.rich.style.Style.link_id | ( | self | ) |
Get a link id, used in ansi code for links.
| Dict[str, Any] pip._vendor.rich.style.Style.meta | ( | self | ) |
Get meta information (can not be changed after construction).
| str pip._vendor.rich.style.Style.normalize | ( | cls, | |
| str | style | ||
| ) |
Normalize a style definition so that styles with the same effect have the same string
representation.
Args:
style (str): A style definition.
Returns:
str: Normal form of style definition.
| "Style" pip._vendor.rich.style.Style.null | ( | cls | ) |
Create an 'null' style, equivalent to Style(), but more performant.
| "Style" pip._vendor.rich.style.Style.on | ( | cls, | |
| Optional[Dict[str, Any]] | meta = None, |
||
| **Any | handlers | ||
| ) |
Create a blank style with meta information.
Example:
style = Style.on(click=self.on_click)
Args:
meta (Optional[Dict[str, Any]], optional): An optional dict of meta information.
**handlers (Any): Keyword arguments are translated in to handlers.
Returns:
Style: A Style with meta information attached.
| "Style" pip._vendor.rich.style.Style.parse | ( | cls, | |
| str | style_definition | ||
| ) |
Parse a style definition.
Args:
style_definition (str): A string containing a style.
Raises:
errors.StyleSyntaxError: If the style definition syntax is invalid.
Returns:
`Style`: A Style instance.
| StyleType pip._vendor.rich.style.Style.pick_first | ( | cls, | |
| *Optional[StyleType] | values | ||
| ) |
Pick first non-None style.
| str pip._vendor.rich.style.Style.render | ( | self, | |
| str | text = "", |
||
| *Optional[ColorSystem] | color_system = ColorSystem.TRUECOLOR, |
||
| bool | legacy_windows = False |
||
| ) |
Render the ANSI codes for the style.
Args:
text (str, optional): A string to style. Defaults to "".
color_system (Optional[ColorSystem], optional): Color system to render to. Defaults to ColorSystem.TRUECOLOR.
Returns:
str: A string containing ANSI style codes.
| None pip._vendor.rich.style.Style.test | ( | self, | |
| Optional[str] | text = None |
||
| ) |
Write text with style directly to terminal.
This method is for testing purposes only.
Args:
text (Optional[str], optional): Text to style or None for style name.
| bool pip._vendor.rich.style.Style.transparent_background | ( | self | ) |
Check if the style specified a transparent background.
| "Style" pip._vendor.rich.style.Style.update_link | ( | self, | |
| Optional[str] | link = None |
||
| ) |
Get a copy with a different value for link.
Args:
link (str, optional): New value for link. Defaults to None.
Returns:
Style: A new Style instance.
| "Style" pip._vendor.rich.style.Style.without_color | ( | self | ) |
Get a copy of the style with color removed.
|
staticprotected |
|
static |