Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Classes | Functions | Variables
pip._vendor.rich._win32_console Namespace Reference

Classes

class  CONSOLE_CURSOR_INFO
 
class  CONSOLE_SCREEN_BUFFER_INFO
 
class  LegacyWindowsError
 
class  LegacyWindowsTerm
 
class  WindowsCoordinates
 

Functions

wintypes.HANDLE GetStdHandle (int handle=STDOUT)
 
int GetConsoleMode (wintypes.HANDLE std_handle)
 
int FillConsoleOutputCharacter (wintypes.HANDLE std_handle, str char, int length, WindowsCoordinates start)
 
int FillConsoleOutputAttribute (wintypes.HANDLE std_handle, int attributes, int length, WindowsCoordinates start)
 
bool SetConsoleTextAttribute (wintypes.HANDLE std_handle, wintypes.WORD attributes)
 
CONSOLE_SCREEN_BUFFER_INFO GetConsoleScreenBufferInfo (wintypes.HANDLE std_handle)
 
bool SetConsoleCursorPosition (wintypes.HANDLE std_handle, WindowsCoordinates coords)
 
bool GetConsoleCursorInfo (wintypes.HANDLE std_handle, CONSOLE_CURSOR_INFO cursor_info)
 
bool SetConsoleCursorInfo (wintypes.HANDLE std_handle, CONSOLE_CURSOR_INFO cursor_info)
 
bool SetConsoleTitle (str title)
 

Variables

Any windll = None
 
int STDOUT = -11
 
int ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
 
 COORD = wintypes._COORD
 
Any _GetStdHandle = windll.kernel32.GetStdHandle
 
 argtypes
 
 restype
 
Any _GetConsoleMode = windll.kernel32.GetConsoleMode
 
Any _FillConsoleOutputCharacterW = windll.kernel32.FillConsoleOutputCharacterW
 
Any _FillConsoleOutputAttribute = windll.kernel32.FillConsoleOutputAttribute
 
Any _SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute
 
Any _GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo
 
Any _SetConsoleCursorPosition = windll.kernel32.SetConsoleCursorPosition
 
Any _GetConsoleCursorInfo = windll.kernel32.GetConsoleCursorInfo
 
Any _SetConsoleCursorInfo = windll.kernel32.SetConsoleCursorInfo
 
Any _SetConsoleTitle = windll.kernel32.SetConsoleTitleW
 
wintypes.HANDLE handle = GetStdHandle()
 
 console = Console()
 
 term = LegacyWindowsTerm(sys.stdout)
 
 style = Style(color="black", bgcolor="red")
 
 heading = Style.parse("black on green")
 

Detailed Description

Light wrapper around the Win32 Console API - this module should only be imported on Windows

The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions

Function Documentation

◆ FillConsoleOutputAttribute()

int pip._vendor.rich._win32_console.FillConsoleOutputAttribute ( wintypes.HANDLE  std_handle,
int  attributes,
int  length,
WindowsCoordinates  start 
)
Sets the character attributes for a specified number of character cells,
beginning at the specified coordinates in a screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    attributes (int): Integer value representing the foreground and background colours of the cells.
    length (int): The number of cells to set the output attribute of.
    start (WindowsCoordinates): The coordinates of the first cell whose attributes are to be set.

Returns:
    int: The number of cells whose attributes were actually set.

◆ FillConsoleOutputCharacter()

int pip._vendor.rich._win32_console.FillConsoleOutputCharacter ( wintypes.HANDLE  std_handle,
str  char,
int  length,
WindowsCoordinates  start 
)
Writes a character to the console screen buffer a specified number of times, beginning at the specified coordinates.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    char (str): The character to write. Must be a string of length 1.
    length (int): The number of times to write the character.
    start (WindowsCoordinates): The coordinates to start writing at.

Returns:
    int: The number of characters written.

◆ GetConsoleCursorInfo()

bool pip._vendor.rich._win32_console.GetConsoleCursorInfo ( wintypes.HANDLE  std_handle,
CONSOLE_CURSOR_INFO   cursor_info 
)
Get the cursor info - used to get cursor visibility and width

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct that receives information
        about the console's cursor.

Returns:
      bool: True if the function succeeds, otherwise False.

◆ GetConsoleMode()

int pip._vendor.rich._win32_console.GetConsoleMode ( wintypes.HANDLE  std_handle)
Retrieves the current input mode of a console's input buffer
or the current output mode of a console screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.

Raises:
    LegacyWindowsError: If any error occurs while calling the Windows console API.

Returns:
    int: Value representing the current console mode as documented at
        https://docs.microsoft.com/en-us/windows/console/getconsolemode#parameters

◆ GetConsoleScreenBufferInfo()

CONSOLE_SCREEN_BUFFER_INFO pip._vendor.rich._win32_console.GetConsoleScreenBufferInfo ( wintypes.HANDLE  std_handle)
Retrieves information about the specified console screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.

Returns:
    CONSOLE_SCREEN_BUFFER_INFO: A CONSOLE_SCREEN_BUFFER_INFO ctype struct contain information about
        screen size, cursor position, colour attributes, and more.

◆ GetStdHandle()

wintypes.HANDLE pip._vendor.rich._win32_console.GetStdHandle ( int   handle = STDOUT)
Retrieves a handle to the specified standard device (standard input, standard output, or standard error).

Args:
    handle (int): Integer identifier for the handle. Defaults to -11 (stdout).

Returns:
    wintypes.HANDLE: The handle

◆ SetConsoleCursorInfo()

bool pip._vendor.rich._win32_console.SetConsoleCursorInfo ( wintypes.HANDLE  std_handle,
CONSOLE_CURSOR_INFO   cursor_info 
)
Set the cursor info - used for adjusting cursor visibility and width

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct containing the new cursor info.

Returns:
      bool: True if the function succeeds, otherwise False.

◆ SetConsoleCursorPosition()

bool pip._vendor.rich._win32_console.SetConsoleCursorPosition ( wintypes.HANDLE  std_handle,
WindowsCoordinates   coords 
)
Set the position of the cursor in the console screen

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    coords (WindowsCoordinates): The coordinates to move the cursor to.

Returns:
    bool: True if the function succeeds, otherwise False.

◆ SetConsoleTextAttribute()

bool pip._vendor.rich._win32_console.SetConsoleTextAttribute ( wintypes.HANDLE  std_handle,
wintypes.WORD   attributes 
)
Set the colour attributes for all text written after this function is called.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    attributes (int): Integer value representing the foreground and background colours.


Returns:
    bool: True if the attribute was set successfully, otherwise False.

◆ SetConsoleTitle()

bool pip._vendor.rich._win32_console.SetConsoleTitle ( str  title)
Sets the title of the current console window

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

Returns:
    bool: True if the function succeeds, otherwise False.