Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
pip._vendor.rich.console.Console Class Reference
Collaboration diagram for pip._vendor.rich.console.Console:
Collaboration graph
[legend]

Public Member Functions

 __init__ (self, *Optional[Literal["auto", "standard", "256", "truecolor", "windows"]] color_system="auto", Optional[bool] force_terminal=None, Optional[bool] force_jupyter=None, Optional[bool] force_interactive=None, bool soft_wrap=False, Optional[Theme] theme=None, bool stderr=False, Optional[IO[str]] file=None, bool quiet=False, Optional[int] width=None, Optional[int] height=None, Optional[StyleType] style=None, Optional[bool] no_color=None, int tab_size=8, bool record=False, bool markup=True, bool emoji=True, Optional[EmojiVariant] emoji_variant=None, bool highlight=True, bool log_time=True, bool log_path=True, Union[str, FormatTimeCallable] log_time_format="[%X]", Optional["HighlighterType"] highlighter=ReprHighlighter(), Optional[bool] legacy_windows=None, bool safe_box=True, Optional[Callable[[], datetime]] get_datetime=None, Optional[Callable[[], float]] get_time=None, Optional[Mapping[str, str]] _environ=None)
 
str __repr__ (self)
 
IO[str] file (self)
 
None file (self, IO[str] new_file)
 
None set_live (self, "Live" live)
 
None clear_live (self)
 
None push_render_hook (self, RenderHook hook)
 
None pop_render_hook (self)
 
"Console" __enter__ (self)
 
None __exit__ (self, Any exc_type, Any exc_value, Any traceback)
 
None begin_capture (self)
 
str end_capture (self)
 
None push_theme (self, Theme theme, *bool inherit=True)
 
None pop_theme (self)
 
ThemeContext use_theme (self, Theme theme, *bool inherit=True)
 
Optional[str] color_system (self)
 
str encoding (self)
 
bool is_terminal (self)
 
bool is_dumb_terminal (self)
 
ConsoleOptions options (self)
 
ConsoleDimensions size (self)
 
None size (self, Tuple[int, int] new_size)
 
int width (self)
 
None width (self, int width)
 
int height (self)
 
None height (self, int height)
 
None bell (self)
 
Capture capture (self)
 
PagerContext pager (self, Optional[Pager] pager=None, bool styles=False, bool links=False)
 
None line (self, int count=1)
 
None clear (self, bool home=True)
 
"Status" status (self, RenderableType status, *str spinner="dots", StyleType spinner_style="status.spinner", float speed=1.0, float refresh_per_second=12.5)
 
bool show_cursor (self, bool show=True)
 
bool set_alt_screen (self, bool enable=True)
 
bool is_alt_screen (self)
 
bool set_window_title (self, str title)
 
"ScreenContext" screen (self, bool hide_cursor=True, Optional[StyleType] style=None)
 
Measurement measure (self, RenderableType renderable, *Optional[ConsoleOptions] options=None)
 
Iterable[Segmentrender (self, RenderableType renderable, Optional[ConsoleOptions] options=None)
 
List[List[Segment]] render_lines (self, RenderableType renderable, Optional[ConsoleOptions] options=None, *Optional[Style] style=None, bool pad=True, bool new_lines=False)
 
"Text" render_str (self, str text, *Union[str, Style] style="", Optional[JustifyMethod] justify=None, Optional[OverflowMethod] overflow=None, Optional[bool] emoji=None, Optional[bool] markup=None, Optional[bool] highlight=None, Optional[HighlighterType] highlighter=None)
 
Style get_style (self, Union[str, Style] name, *Optional[Union[Style, str]] default=None)
 
None rule (self, TextType title="", *str characters="─", Union[str, Style] style="rule.line", AlignMethod align="center")
 
None control (self, *Control control)
 
None out (self, *Any objects, str sep=" ", str end="\n", Optional[Union[str, Style]] style=None, Optional[bool] highlight=None)
 
None print (self, *Any objects, str sep=" ", str end="\n", Optional[Union[str, Style]] style=None, Optional[JustifyMethod] justify=None, Optional[OverflowMethod] overflow=None, Optional[bool] no_wrap=None, Optional[bool] emoji=None, Optional[bool] markup=None, Optional[bool] highlight=None, Optional[int] width=None, Optional[int] height=None, bool crop=True, Optional[bool] soft_wrap=None, bool new_line_start=False)
 
None print_json (self, Optional[str] json=None, *Any data=None, Union[None, int, str] indent=2, bool highlight=True, bool skip_keys=False, bool ensure_ascii=False, bool check_circular=True, bool allow_nan=True, Optional[Callable[[Any], Any]] default=None, bool sort_keys=False)
 
None update_screen (self, RenderableType renderable, *Optional[Region] region=None, Optional[ConsoleOptions] options=None)
 
None update_screen_lines (self, List[List[Segment]] lines, int x=0, int y=0)
 
None print_exception (self, *Optional[int] width=100, int extra_lines=3, Optional[str] theme=None, bool word_wrap=False, bool show_locals=False, Iterable[Union[str, ModuleType]] suppress=(), int max_frames=100)
 
None log (self, *Any objects, str sep=" ", str end="\n", Optional[Union[str, Style]] style=None, Optional[JustifyMethod] justify=None, Optional[bool] emoji=None, Optional[bool] markup=None, Optional[bool] highlight=None, bool log_locals=False, int _stack_offset=1)
 
str input (self, TextType prompt="", *bool markup=True, bool emoji=True, bool password=False, Optional[TextIO] stream=None)
 
str export_text (self, *bool clear=True, bool styles=False)
 
None save_text (self, str path, *bool clear=True, bool styles=False)
 
str export_html (self, *Optional[TerminalTheme] theme=None, bool clear=True, Optional[str] code_format=None, bool inline_styles=False)
 
None save_html (self, str path, *Optional[TerminalTheme] theme=None, bool clear=True, str code_format=CONSOLE_HTML_FORMAT, bool inline_styles=False)
 
str export_svg (self, *str title="Rich", Optional[TerminalTheme] theme=None, bool clear=True, str code_format=CONSOLE_SVG_FORMAT, float font_aspect_ratio=0.61, Optional[str] unique_id=None)
 
None save_svg (self, str path, *str title="Rich", Optional[TerminalTheme] theme=None, bool clear=True, str code_format=CONSOLE_SVG_FORMAT, float font_aspect_ratio=0.61, Optional[str] unique_id=None)
 

Public Attributes

 is_jupyter
 
 tab_size
 
 record
 
 soft_wrap
 
 quiet
 
 stderr
 
 safe_box
 
 get_datetime
 
 get_time
 
 style
 
 no_color
 
 is_interactive
 
 is_dumb_terminal
 
 file
 
 legacy_windows
 
 width
 

Protected Member Functions

List[Segment_buffer (self)
 
int _buffer_index (self)
 
None _buffer_index (self, int value)
 
ThemeStack _theme_stack (self)
 
Optional[ColorSystem_detect_color_system (self)
 
None _enter_buffer (self)
 
None _exit_buffer (self)
 
List[ConsoleRenderable_collect_renderables (self, Iterable[Any] objects, str sep, str end, *Optional[JustifyMethod] justify=None, Optional[bool] emoji=None, Optional[bool] markup=None, Optional[bool] highlight=None)
 
None _check_buffer (self)
 
str _render_buffer (self, Iterable[Segment] buffer)
 

Static Protected Member Functions

Tuple[str, int, Dict[str, Any]] _caller_frame_info (int offset, Callable[[], Optional[FrameType]] currentframe=inspect.currentframe)
 

Protected Attributes

 _environ
 
 _markup
 
 _emoji
 
 _highlight
 
 _width
 
 _height
 
 _force_terminal
 
 _file
 
 _color_system
 
 _lock
 
 _log_render
 
 _record_buffer_lock
 
 _thread_locals
 
 _is_alt_screen
 
 _live
 
 _buffer_index
 
 _buffer
 
 _record_buffer
 

Static Protected Attributes

Mapping _environ = os.environ
 

Detailed Description

A high level console interface.

Args:
    color_system (str, optional): The color system supported by your terminal,
        either ``"standard"``, ``"256"`` or ``"truecolor"``. Leave as ``"auto"`` to autodetect.
    force_terminal (Optional[bool], optional): Enable/disable terminal control codes, or None to auto-detect terminal. Defaults to None.
    force_jupyter (Optional[bool], optional): Enable/disable Jupyter rendering, or None to auto-detect Jupyter. Defaults to None.
    force_interactive (Optional[bool], optional): Enable/disable interactive mode, or None to auto detect. Defaults to None.
    soft_wrap (Optional[bool], optional): Set soft wrap default on print method. Defaults to False.
    theme (Theme, optional): An optional style theme object, or ``None`` for default theme.
    stderr (bool, optional): Use stderr rather than stdout if ``file`` is not specified. Defaults to False.
    file (IO, optional): A file object where the console should write to. Defaults to stdout.
    quiet (bool, Optional): Boolean to suppress all output. Defaults to False.
    width (int, optional): The width of the terminal. Leave as default to auto-detect width.
    height (int, optional): The height of the terminal. Leave as default to auto-detect height.
    style (StyleType, optional): Style to apply to all output, or None for no style. Defaults to None.
    no_color (Optional[bool], optional): Enabled no color mode, or None to auto detect. Defaults to None.
    tab_size (int, optional): Number of spaces used to replace a tab character. Defaults to 8.
    record (bool, optional): Boolean to enable recording of terminal output,
        required to call :meth:`export_html`, :meth:`export_svg`, and :meth:`export_text`. Defaults to False.
    markup (bool, optional): Boolean to enable :ref:`console_markup`. Defaults to True.
    emoji (bool, optional): Enable emoji code. Defaults to True.
    emoji_variant (str, optional): Optional emoji variant, either "text" or "emoji". Defaults to None.
    highlight (bool, optional): Enable automatic highlighting. Defaults to True.
    log_time (bool, optional): Boolean to enable logging of time by :meth:`log` methods. Defaults to True.
    log_path (bool, optional): Boolean to enable the logging of the caller by :meth:`log`. Defaults to True.
    log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%X] ".
    highlighter (HighlighterType, optional): Default highlighter.
    legacy_windows (bool, optional): Enable legacy Windows mode, or ``None`` to auto detect. Defaults to ``None``.
    safe_box (bool, optional): Restrict box options that don't render on legacy Windows.
    get_datetime (Callable[[], datetime], optional): Callable that gets the current time as a datetime.datetime object (used by Console.log),
        or None for datetime.now.
    get_time (Callable[[], time], optional): Callable that gets the current time in seconds, default uses time.monotonic.

Member Function Documentation

◆ __enter__()

"Console" pip._vendor.rich.console.Console.__enter__ (   self)
Own context manager to enter buffer context.

◆ __exit__()

None pip._vendor.rich.console.Console.__exit__ (   self,
Any  exc_type,
Any  exc_value,
Any  traceback 
)
Exit buffer context.

◆ _buffer()

List[Segment] pip._vendor.rich.console.Console._buffer (   self)
protected
Get a thread local buffer.

◆ _buffer_index()

int pip._vendor.rich.console.Console._buffer_index (   self)
protected
Get a thread local buffer.

◆ _caller_frame_info()

Tuple[str, int, Dict[str, Any]] pip._vendor.rich.console.Console._caller_frame_info ( int  offset,
Callable[[], Optional[FrameType]]   currentframe = inspect.currentframe 
)
staticprotected
Get caller frame information.

Args:
    offset (int): the caller offset within the current frame stack.
    currentframe (Callable[[], Optional[FrameType]], optional): the callable to use to
        retrieve the current frame. Defaults to ``inspect.currentframe``.

Returns:
    Tuple[str, int, Dict[str, Any]]: A tuple containing the filename, the line number and
        the dictionary of local variables associated with the caller frame.

Raises:
    RuntimeError: If the stack offset is invalid.

◆ _check_buffer()

None pip._vendor.rich.console.Console._check_buffer (   self)
protected
Check if the buffer may be rendered. Render it if it can (e.g. Console.quiet is False)
Rendering is supported on Windows, Unix and Jupyter environments. For
legacy Windows consoles, the win32 API is called directly.
This method will also record what it renders if recording is enabled via Console.record.

◆ _collect_renderables()

List[ConsoleRenderable] pip._vendor.rich.console.Console._collect_renderables (   self,
Iterable[Any]  objects,
str  sep,
str  end,
*Optional[JustifyMethod]   justify = None,
Optional[bool]   emoji = None,
Optional[bool]   markup = None,
Optional[bool]   highlight = None 
)
protected
Combine a number of renderables and text into one renderable.

Args:
    objects (Iterable[Any]): Anything that Rich can render.
    sep (str): String to write between print data.
    end (str): String to write at end of print data.
    justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
    emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default.
    markup (Optional[bool], optional): Enable markup, or ``None`` to use console default.
    highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default.

Returns:
    List[ConsoleRenderable]: A list of things to render.

◆ _detect_color_system()

Optional[ColorSystem] pip._vendor.rich.console.Console._detect_color_system (   self)
protected
Detect color system from env vars.

◆ _enter_buffer()

None pip._vendor.rich.console.Console._enter_buffer (   self)
protected
Enter in to a buffer context, and buffer all output.

◆ _exit_buffer()

None pip._vendor.rich.console.Console._exit_buffer (   self)
protected
Leave buffer context, and render content if required.

◆ _render_buffer()

str pip._vendor.rich.console.Console._render_buffer (   self,
Iterable[Segment buffer 
)
protected
Render buffered output, and clear buffer.

◆ _theme_stack()

ThemeStack pip._vendor.rich.console.Console._theme_stack (   self)
protected
Get the thread local theme stack.

◆ begin_capture()

None pip._vendor.rich.console.Console.begin_capture (   self)
Begin capturing console output. Call :meth:`end_capture` to exit capture mode and return output.

◆ bell()

None pip._vendor.rich.console.Console.bell (   self)
Play a 'bell' sound (if supported by the terminal).

◆ capture()

Capture pip._vendor.rich.console.Console.capture (   self)
A context manager to *capture* the result of print() or log() in a string,
rather than writing it to the console.

Example:
    >>> from rich.console import Console
    >>> console = Console()
    >>> with console.capture() as capture:
    ...     console.print("[bold magenta]Hello World[/]")
    >>> print(capture.get())

Returns:
    Capture: Context manager with disables writing to the terminal.

◆ clear()

None pip._vendor.rich.console.Console.clear (   self,
bool   home = True 
)
Clear the screen.

Args:
    home (bool, optional): Also move the cursor to 'home' position. Defaults to True.

◆ clear_live()

None pip._vendor.rich.console.Console.clear_live (   self)
Clear the Live instance.

◆ color_system()

Optional[str] pip._vendor.rich.console.Console.color_system (   self)
Get color system string.

Returns:
    Optional[str]: "standard", "256" or "truecolor".

◆ control()

None pip._vendor.rich.console.Console.control (   self,
*Control  control 
)
Insert non-printing control codes.

Args:
    control_codes (str): Control codes, such as those that may move the cursor.

◆ encoding()

str pip._vendor.rich.console.Console.encoding (   self)
Get the encoding of the console file, e.g. ``"utf-8"``.

Returns:
    str: A standard encoding string.

◆ end_capture()

str pip._vendor.rich.console.Console.end_capture (   self)
End capture mode and return captured string.

Returns:
    str: Console output.

◆ export_html()

str pip._vendor.rich.console.Console.export_html (   self,
*Optional[TerminalTheme]   theme = None,
bool   clear = True,
Optional[str]   code_format = None,
bool   inline_styles = False 
)
Generate HTML from console contents (requires record=True argument in constructor).

Args:
    theme (TerminalTheme, optional): TerminalTheme object containing console colors.
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
    code_format (str, optional): Format string to render HTML. In addition to '{foreground}',
        '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``.
    inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
        larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
        Defaults to False.

Returns:
    str: String containing console contents as HTML.

◆ export_svg()

str pip._vendor.rich.console.Console.export_svg (   self,
*str   title = "Rich",
Optional[TerminalTheme]   theme = None,
bool   clear = True,
str   code_format = CONSOLE_SVG_FORMAT,
float   font_aspect_ratio = 0.61,
Optional[str]   unique_id = None 
)
Generate an SVG from the console contents (requires record=True in Console constructor).

Args:
    title (str, optional): The title of the tab in the output image
    theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``
    code_format (str, optional): Format string used to generate the SVG. Rich will inject a number of variables
        into the string in order to form the final SVG output. The default template used and the variables
        injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable.
    font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format``
        string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font).
        If you aren't specifying a different font inside ``code_format``, you probably don't need this.
    unique_id (str, optional): unique id that is used as the prefix for various elements (CSS styles, node
        ids). If not set, this defaults to a computed value based on the recorded content.

◆ export_text()

str pip._vendor.rich.console.Console.export_text (   self,
*bool   clear = True,
bool   styles = False 
)
Generate text from console contents (requires record=True argument in constructor).

Args:
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
    styles (bool, optional): If ``True``, ansi escape codes will be included. ``False`` for plain text.
        Defaults to ``False``.

Returns:
    str: String containing console contents.

◆ file() [1/2]

IO[str] pip._vendor.rich.console.Console.file (   self)
Get the file object to write to.

◆ file() [2/2]

None pip._vendor.rich.console.Console.file (   self,
IO[str]  new_file 
)
Set a new file object.

◆ get_style()

Style pip._vendor.rich.console.Console.get_style (   self,
Union[str, Style name,
*Optional[Union[Style, str]]   default = None 
)
Get a Style instance by its theme name or parse a definition.

Args:
    name (str): The name of a style or a style definition.

Returns:
    Style: A Style object.

Raises:
    MissingStyle: If no style could be parsed from name.

◆ height() [1/2]

int pip._vendor.rich.console.Console.height (   self)
Get the height of the console.

Returns:
    int: The height (in lines) of the console.

◆ height() [2/2]

None pip._vendor.rich.console.Console.height (   self,
int  height 
)
Set height.

Args:
    height (int): new height.

◆ input()

str pip._vendor.rich.console.Console.input (   self,
TextType   prompt = "",
*bool   markup = True,
bool   emoji = True,
bool   password = False,
Optional[TextIO]   stream = None 
)
Displays a prompt and waits for input from the user. The prompt may contain color / style.

It works in the same way as Python's builtin :func:`input` function and provides elaborate line editing and history features if Python's builtin :mod:`readline` module is previously loaded.

Args:
    prompt (Union[str, Text]): Text to render in the prompt.
    markup (bool, optional): Enable console markup (requires a str prompt). Defaults to True.
    emoji (bool, optional): Enable emoji (requires a str prompt). Defaults to True.
    password: (bool, optional): Hide typed text. Defaults to False.
    stream: (TextIO, optional): Optional file to read input from (rather than stdin). Defaults to None.

Returns:
    str: Text read from stdin.

◆ is_alt_screen()

bool pip._vendor.rich.console.Console.is_alt_screen (   self)
Check if the alt screen was enabled.

Returns:
    bool: True if the alt screen was enabled, otherwise False.

◆ is_dumb_terminal()

bool pip._vendor.rich.console.Console.is_dumb_terminal (   self)
Detect dumb terminal.

Returns:
    bool: True if writing to a dumb terminal, otherwise False.

◆ is_terminal()

bool pip._vendor.rich.console.Console.is_terminal (   self)
Check if the console is writing to a terminal.

Returns:
    bool: True if the console writing to a device capable of
    understanding terminal codes, otherwise False.

◆ line()

None pip._vendor.rich.console.Console.line (   self,
int   count = 1 
)
Write new line(s).

Args:
    count (int, optional): Number of new lines. Defaults to 1.

◆ log()

None pip._vendor.rich.console.Console.log (   self,
*Any  objects,
str   sep = " ",
str   end = "\n",
Optional[Union[str, Style]]   style = None,
Optional[JustifyMethod]   justify = None,
Optional[bool]   emoji = None,
Optional[bool]   markup = None,
Optional[bool]   highlight = None,
bool   log_locals = False,
int   _stack_offset = 1 
)
Log rich content to the terminal.

Args:
    objects (positional args): Objects to log to the terminal.
    sep (str, optional): String to write between print data. Defaults to " ".
    end (str, optional): String to write at end of print data. Defaults to "\\\\n".
    style (Union[str, Style], optional): A style to apply to output. Defaults to None.
    justify (str, optional): One of "left", "right", "center", or "full". Defaults to ``None``.
    overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to None.
    emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to None.
    markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to None.
    highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to None.
    log_locals (bool, optional): Boolean to enable logging of locals where ``log()``
        was called. Defaults to False.
    _stack_offset (int, optional): Offset of caller from end of call stack. Defaults to 1.

◆ measure()

Measurement pip._vendor.rich.console.Console.measure (   self,
RenderableType  renderable,
*Optional[ConsoleOptions]   options = None 
)
Measure a renderable. Returns a :class:`~rich.measure.Measurement` object which contains
information regarding the number of characters required to print the renderable.

Args:
    renderable (RenderableType): Any renderable or string.
    options (Optional[ConsoleOptions], optional): Options to use when measuring, or None
        to use default options. Defaults to None.

Returns:
    Measurement: A measurement of the renderable.

◆ options()

ConsoleOptions pip._vendor.rich.console.Console.options (   self)
Get default console options.

◆ out()

None pip._vendor.rich.console.Console.out (   self,
*Any  objects,
str   sep = " ",
str   end = "\n",
Optional[Union[str, Style]]   style = None,
Optional[bool]   highlight = None 
)
Output to the terminal. This is a low-level way of writing to the terminal which unlike
:meth:`~rich.console.Console.print` won't pretty print, wrap text, or apply markup, but will
optionally apply highlighting and a basic style.

Args:
    sep (str, optional): String to write between print data. Defaults to " ".
    end (str, optional): String to write at end of print data. Defaults to "\\\\n".
    style (Union[str, Style], optional): A style to apply to output. Defaults to None.
    highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use
        console default. Defaults to ``None``.

◆ pager()

PagerContext pip._vendor.rich.console.Console.pager (   self,
Optional[Pager]   pager = None,
bool   styles = False,
bool   links = False 
)
A context manager to display anything printed within a "pager". The pager application
is defined by the system and will typically support at least pressing a key to scroll.

Args:
    pager (Pager, optional): A pager object, or None to use :class:`~rich.pager.SystemPager`. Defaults to None.
    styles (bool, optional): Show styles in pager. Defaults to False.
    links (bool, optional): Show links in pager. Defaults to False.

Example:
    >>> from rich.console import Console
    >>> from rich.__main__ import make_test_card
    >>> console = Console()
    >>> with console.pager():
            console.print(make_test_card())

Returns:
    PagerContext: A context manager.

◆ pop_render_hook()

None pip._vendor.rich.console.Console.pop_render_hook (   self)
Pop the last renderhook from the stack.

◆ pop_theme()

None pip._vendor.rich.console.Console.pop_theme (   self)
Remove theme from top of stack, restoring previous theme.

◆ print()

None pip._vendor.rich.console.Console.print (   self,
*Any  objects,
str   sep = " ",
str   end = "\n",
Optional[Union[str, Style]]   style = None,
Optional[JustifyMethod]   justify = None,
Optional[OverflowMethod]   overflow = None,
Optional[bool]   no_wrap = None,
Optional[bool]   emoji = None,
Optional[bool]   markup = None,
Optional[bool]   highlight = None,
Optional[int]   width = None,
Optional[int]   height = None,
bool   crop = True,
Optional[bool]   soft_wrap = None,
bool   new_line_start = False 
)
Print to the console.

Args:
    objects (positional args): Objects to log to the terminal.
    sep (str, optional): String to write between print data. Defaults to " ".
    end (str, optional): String to write at end of print data. Defaults to "\\\\n".
    style (Union[str, Style], optional): A style to apply to output. Defaults to None.
    justify (str, optional): Justify method: "default", "left", "right", "center", or "full". Defaults to ``None``.
    overflow (str, optional): Overflow method: "ignore", "crop", "fold", or "ellipsis". Defaults to None.
    no_wrap (Optional[bool], optional): Disable word wrapping. Defaults to None.
    emoji (Optional[bool], optional): Enable emoji code, or ``None`` to use console default. Defaults to ``None``.
    markup (Optional[bool], optional): Enable markup, or ``None`` to use console default. Defaults to ``None``.
    highlight (Optional[bool], optional): Enable automatic highlighting, or ``None`` to use console default. Defaults to ``None``.
    width (Optional[int], optional): Width of output, or ``None`` to auto-detect. Defaults to ``None``.
    crop (Optional[bool], optional): Crop output to width of terminal. Defaults to True.
    soft_wrap (bool, optional): Enable soft wrap mode which disables word wrapping and cropping of text or ``None`` for
        Console default. Defaults to ``None``.
    new_line_start (bool, False): Insert a new line at the start if the output contains more than one line. Defaults to ``False``.

◆ print_exception()

None pip._vendor.rich.console.Console.print_exception (   self,
*Optional[int]   width = 100,
int   extra_lines = 3,
Optional[str]   theme = None,
bool   word_wrap = False,
bool   show_locals = False,
Iterable[Union[str, ModuleType]]   suppress = (),
int   max_frames = 100 
)
Prints a rich render of the last exception and traceback.

Args:
    width (Optional[int], optional): Number of characters used to render code. Defaults to 100.
    extra_lines (int, optional): Additional lines of code to render. Defaults to 3.
    theme (str, optional): Override pygments theme used in traceback
    word_wrap (bool, optional): Enable word wrapping of long lines. Defaults to False.
    show_locals (bool, optional): Enable display of local variables. Defaults to False.
    suppress (Iterable[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback.
    max_frames (int): Maximum number of frames to show in a traceback, 0 for no maximum. Defaults to 100.

◆ print_json()

None pip._vendor.rich.console.Console.print_json (   self,
Optional[str]   json = None,
*Any   data = None,
Union[None, int, str]   indent = 2,
bool   highlight = True,
bool   skip_keys = False,
bool   ensure_ascii = False,
bool   check_circular = True,
bool   allow_nan = True,
Optional[Callable[[Any], Any]]   default = None,
bool   sort_keys = False 
)
Pretty prints JSON. Output will be valid JSON.

Args:
    json (Optional[str]): A string containing JSON.
    data (Any): If json is not supplied, then encode this data.
    indent (Union[None, int, str], optional): Number of spaces to indent. Defaults to 2.
    highlight (bool, optional): Enable highlighting of output: Defaults to True.
    skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
    ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
    check_circular (bool, optional): Check for circular references. Defaults to True.
    allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
    default (Callable, optional): A callable that converts values that can not be encoded
        in to something that can be JSON encoded. Defaults to None.
    sort_keys (bool, optional): Sort dictionary keys. Defaults to False.

◆ push_render_hook()

None pip._vendor.rich.console.Console.push_render_hook (   self,
RenderHook  hook 
)
Add a new render hook to the stack.

Args:
    hook (RenderHook): Render hook instance.

◆ push_theme()

None pip._vendor.rich.console.Console.push_theme (   self,
Theme  theme,
*bool   inherit = True 
)
Push a new theme on to the top of the stack, replacing the styles from the previous theme.
Generally speaking, you should call :meth:`~rich.console.Console.use_theme` to get a context manager, rather
than calling this method directly.

Args:
    theme (Theme): A theme instance.
    inherit (bool, optional): Inherit existing styles. Defaults to True.

◆ render()

Iterable[Segment] pip._vendor.rich.console.Console.render (   self,
RenderableType  renderable,
Optional[ConsoleOptions]   options = None 
)
Render an object in to an iterable of `Segment` instances.

This method contains the logic for rendering objects with the console protocol.
You are unlikely to need to use it directly, unless you are extending the library.

Args:
    renderable (RenderableType): An object supporting the console protocol, or
        an object that may be converted to a string.
    options (ConsoleOptions, optional): An options object, or None to use self.options. Defaults to None.

Returns:
    Iterable[Segment]: An iterable of segments that may be rendered.

◆ render_lines()

List[List[Segment]] pip._vendor.rich.console.Console.render_lines (   self,
RenderableType  renderable,
Optional[ConsoleOptions]   options = None,
*Optional[Style]   style = None,
bool   pad = True,
bool   new_lines = False 
)
Render objects in to a list of lines.

The output of render_lines is useful when further formatting of rendered console text
is required, such as the Panel class which draws a border around any renderable object.

Args:
    renderable (RenderableType): Any object renderable in the console.
    options (Optional[ConsoleOptions], optional): Console options, or None to use self.options. Default to ``None``.
    style (Style, optional): Optional style to apply to renderables. Defaults to ``None``.
    pad (bool, optional): Pad lines shorter than render width. Defaults to ``True``.
    new_lines (bool, optional): Include "\n" characters at end of lines.

Returns:
    List[List[Segment]]: A list of lines, where a line is a list of Segment objects.

◆ render_str()

"Text" pip._vendor.rich.console.Console.render_str (   self,
str  text,
*Union[str, Style]   style = "",
Optional[JustifyMethod]   justify = None,
Optional[OverflowMethod]   overflow = None,
Optional[bool]   emoji = None,
Optional[bool]   markup = None,
Optional[bool]   highlight = None,
Optional[HighlighterType]   highlighter = None 
)
Convert a string to a Text instance. This is called automatically if
you print or log a string.

Args:
    text (str): Text to render.
    style (Union[str, Style], optional): Style to apply to rendered text.
    justify (str, optional): Justify method: "default", "left", "center", "full", or "right". Defaults to ``None``.
    overflow (str, optional): Overflow method: "crop", "fold", or "ellipsis". Defaults to ``None``.
    emoji (Optional[bool], optional): Enable emoji, or ``None`` to use Console default.
    markup (Optional[bool], optional): Enable markup, or ``None`` to use Console default.
    highlight (Optional[bool], optional): Enable highlighting, or ``None`` to use Console default.
    highlighter (HighlighterType, optional): Optional highlighter to apply.
Returns:
    ConsoleRenderable: Renderable object.

◆ rule()

None pip._vendor.rich.console.Console.rule (   self,
TextType   title = "",
*str   characters = "─",
Union[str, Style]   style = "rule.line",
AlignMethod   align = "center" 
)
Draw a line with optional centered title.

Args:
    title (str, optional): Text to render over the rule. Defaults to "".
    characters (str, optional): Character(s) to form the line. Defaults to "─".
    style (str, optional): Style of line. Defaults to "rule.line".
    align (str, optional): How to align the title, one of "left", "center", or "right". Defaults to "center".

◆ save_html()

None pip._vendor.rich.console.Console.save_html (   self,
str  path,
*Optional[TerminalTheme]   theme = None,
bool   clear = True,
str   code_format = CONSOLE_HTML_FORMAT,
bool   inline_styles = False 
)
Generate HTML from console contents and write to a file (requires record=True argument in constructor).

Args:
    path (str): Path to write html file.
    theme (TerminalTheme, optional): TerminalTheme object containing console colors.
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
    code_format (str, optional): Format string to render HTML. In addition to '{foreground}',
        '{background}', and '{code}', should contain '{stylesheet}' if inline_styles is ``False``.
    inline_styles (bool, optional): If ``True`` styles will be inlined in to spans, which makes files
        larger but easier to cut and paste markup. If ``False``, styles will be embedded in a style tag.
        Defaults to False.

◆ save_svg()

None pip._vendor.rich.console.Console.save_svg (   self,
str  path,
*str   title = "Rich",
Optional[TerminalTheme]   theme = None,
bool   clear = True,
str   code_format = CONSOLE_SVG_FORMAT,
float   font_aspect_ratio = 0.61,
Optional[str]   unique_id = None 
)
Generate an SVG file from the console contents (requires record=True in Console constructor).

Args:
    path (str): The path to write the SVG to.
    title (str, optional): The title of the tab in the output image
    theme (TerminalTheme, optional): The ``TerminalTheme`` object to use to style the terminal
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``
    code_format (str, optional): Format string used to generate the SVG. Rich will inject a number of variables
        into the string in order to form the final SVG output. The default template used and the variables
        injected by Rich can be found by inspecting the ``console.CONSOLE_SVG_FORMAT`` variable.
    font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format``
        string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font).
        If you aren't specifying a different font inside ``code_format``, you probably don't need this.
    unique_id (str, optional): unique id that is used as the prefix for various elements (CSS styles, node
        ids). If not set, this defaults to a computed value based on the recorded content.

◆ save_text()

None pip._vendor.rich.console.Console.save_text (   self,
str  path,
*bool   clear = True,
bool   styles = False 
)
Generate text from console and save to a given location (requires record=True argument in constructor).

Args:
    path (str): Path to write text files.
    clear (bool, optional): Clear record buffer after exporting. Defaults to ``True``.
    styles (bool, optional): If ``True``, ansi style codes will be included. ``False`` for plain text.
        Defaults to ``False``.

◆ screen()

"ScreenContext" pip._vendor.rich.console.Console.screen (   self,
bool   hide_cursor = True,
Optional[StyleType]   style = None 
)
Context manager to enable and disable 'alternative screen' mode.

Args:
    hide_cursor (bool, optional): Also hide the cursor. Defaults to False.
    style (Style, optional): Optional style for screen. Defaults to None.

Returns:
    ~ScreenContext: Context which enables alternate screen on enter, and disables it on exit.

◆ set_alt_screen()

bool pip._vendor.rich.console.Console.set_alt_screen (   self,
bool   enable = True 
)
Enables alternative screen mode.

Note, if you enable this mode, you should ensure that is disabled before
the application exits. See :meth:`~rich.Console.screen` for a context manager
that handles this for you.

Args:
    enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True.

Returns:
    bool: True if the control codes were written.

◆ set_live()

None pip._vendor.rich.console.Console.set_live (   self,
"Live"  live 
)
Set Live instance. Used by Live context manager.

Args:
    live (Live): Live instance using this Console.

Raises:
    errors.LiveError: If this Console has a Live context currently active.

◆ set_window_title()

bool pip._vendor.rich.console.Console.set_window_title (   self,
str  title 
)
Set the title of the console terminal window.

Warning: There is no means within Rich of "resetting" the window title to its
previous value, meaning the title you set will persist even after your application
exits.

``fish`` shell resets the window title before and after each command by default,
negating this issue. Windows Terminal and command prompt will also reset the title for you.
Most other shells and terminals, however, do not do this.

Some terminals may require configuration changes before you can set the title.
Some terminals may not support setting the title at all.

Other software (including the terminal itself, the shell, custom prompts, plugins, etc.)
may also set the terminal window title. This could result in whatever value you write
using this method being overwritten.

Args:
    title (str): The new title of the terminal window.

Returns:
    bool: True if the control code to change the terminal title was
        written, otherwise False. Note that a return value of True
        does not guarantee that the window title has actually changed,
        since the feature may be unsupported/disabled in some terminals.

◆ show_cursor()

bool pip._vendor.rich.console.Console.show_cursor (   self,
bool   show = True 
)
Show or hide the cursor.

Args:
    show (bool, optional): Set visibility of the cursor.

◆ size() [1/2]

ConsoleDimensions pip._vendor.rich.console.Console.size (   self)
Get the size of the console.

Returns:
    ConsoleDimensions: A named tuple containing the dimensions.

◆ size() [2/2]

None pip._vendor.rich.console.Console.size (   self,
Tuple[int, int]  new_size 
)
Set a new size for the terminal.

Args:
    new_size (Tuple[int, int]): New width and height.

◆ status()

"Status" pip._vendor.rich.console.Console.status (   self,
RenderableType  status,
*str   spinner = "dots",
StyleType   spinner_style = "status.spinner",
float   speed = 1.0,
float   refresh_per_second = 12.5 
)
Display a status and spinner.

Args:
    status (RenderableType): A status renderable (str or Text typically).
    spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots".
    spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner".
    speed (float, optional): Speed factor for spinner animation. Defaults to 1.0.
    refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5.

Returns:
    Status: A Status object that may be used as a context manager.

◆ update_screen()

None pip._vendor.rich.console.Console.update_screen (   self,
RenderableType  renderable,
*Optional[Region]   region = None,
Optional[ConsoleOptions]   options = None 
)
Update the screen at a given offset.

Args:
    renderable (RenderableType): A Rich renderable.
    region (Region, optional): Region of screen to update, or None for entire screen. Defaults to None.
    x (int, optional): x offset. Defaults to 0.
    y (int, optional): y offset. Defaults to 0.

Raises:
    errors.NoAltScreen: If the Console isn't in alt screen mode.

◆ update_screen_lines()

None pip._vendor.rich.console.Console.update_screen_lines (   self,
List[List[Segment]]  lines,
int   x = 0,
int   y = 0 
)
Update lines of the screen at a given offset.

Args:
    lines (List[List[Segment]]): Rendered lines (as produced by :meth:`~rich.Console.render_lines`).
    x (int, optional): x offset (column no). Defaults to 0.
    y (int, optional): y offset (column no). Defaults to 0.

Raises:
    errors.NoAltScreen: If the Console isn't in alt screen mode.

◆ use_theme()

ThemeContext pip._vendor.rich.console.Console.use_theme (   self,
Theme  theme,
*bool   inherit = True 
)
Use a different theme for the duration of the context manager.

Args:
    theme (Theme): Theme instance to user.
    inherit (bool, optional): Inherit existing console styles. Defaults to True.

Returns:
    ThemeContext: [description]

◆ width() [1/2]

int pip._vendor.rich.console.Console.width (   self)
Get the width of the console.

Returns:
    int: The width (in characters) of the console.

◆ width() [2/2]

None pip._vendor.rich.console.Console.width (   self,
int  width 
)
Set width.

Args:
    width (int): New width.

The documentation for this class was generated from the following file: