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\ R"SD5 \KR5 \KR5 \Q"SU5 gg)VzLight 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 N)Anywindllwin32z can only be imported on Windows) Structurebyrefwintypes)IO NamedTupleTypecast) ColorSystem)Styleic\rSrSrSrg)LegacyWindowsErrorN)__name__ __module__ __qualname____firstlineno____static_attributes__rڑ/builddir/build/BUILDROOT/alt-python313-pip-23.3.1-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/pip/_vendor/rich/_win32_console.pyrrsrrcJ\rSrSr%Sr\\S'\\S'\SSS\4Sj5r Sr g ) WindowsCoordinates zCoordinates in the Windows Console API are (y, x), not (x, y). This class is intended to prevent that confusion. Rows and columns are indexed from 0. This class can be used in place of wintypes._COORD in arguments and argtypes. rowcolvaluereturncB[URUR5$)aConverts a WindowsCoordinates into a wintypes _COORD structure. This classmethod is internally called by ctypes to perform the conversion. Args: value (WindowsCoordinates): The input coordinates to convert. Returns: wintypes._COORD: The converted coordinates struct. )COORDrr)clsr s r from_paramWindowsCoordinates.from_param*sUYY **rrN) rrrr__doc__int__annotations__ classmethodr#r%rrrrrr s4 H H +3 + + +rrc^\rSrSrS\4S\4S\R 4S\R4S\4/rSr g) CONSOLE_SCREEN_BUFFER_INFO8dwSizedwCursorPosition wAttributessrWindowdwMaximumWindowSizerN) rrrrr#rWORD SMALL_RECT_fields_rrrrr,r,8s; 5 U#  & X(() & Hrr,cL\rSrSrS\R 4S\R 4/rSrg)CONSOLE_CURSOR_INFOBr.bVisiblerN) rrrrrDWORDBOOLr5rrrrr7r7Bs8>>*Z,GHHrr7handler!cH[[R[U55$)zRetrieves 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 )r rHANDLE _GetStdHandle)r<s r GetStdHandler@Ms v!6 77r std_handlec[R"5n[[X55nU(d [ S5eUR $)aRetrieves 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 z)Unable to get legacy Windows Console Mode)rr:bool_GetConsoleModerr )rA console_modesuccesss rGetConsoleModerG^s:>>#L?:<=G  !LMM   rcharlengthstartc [R"UR55n[R"U5n[R"S5n[ UUUU[ U55 UR$)aWrites 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. r)ctypesc_charencoderr:_FillConsoleOutputCharacterWrr )rArHrIrJ characternum_characters num_writtens rFillConsoleOutputCharacterrSs^" dkkm,I^^F+N..#K   k    r attributesc [R"U5n[R"U5n[R"S5n[XXC[ U55 UR $)aHSets 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. r)rr:r3_FillConsoleOutputAttributerr )rArTrIrJ num_cells style_attrsrRs rFillConsoleOutputAttributerYsP$v&I-- +K..#K53E   rc*[[X55$)adSet 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. )rC_SetConsoleTextAttribute)rArTs rSetConsoleTextAttributer\s (@ AArcD[5n[U[U55 U$)a]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.)r,_GetConsoleScreenBufferInfor)rAconsole_screen_buffer_infos rGetConsoleScreenBufferInfor`s#">r cursor_infoc>[[U[U555$)avGet 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. )rC_GetConsoleCursorInforrAres rGetConsoleCursorInforis %j% 2DE FFrc>[[U[U555$)a_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. )rC_SetConsoleCursorInforrhs rSetConsoleCursorInforl*s %j% 2DE FFrtitlec*[[U55$)zSets 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. )rC_SetConsoleTitle)rms rSetConsoleTitlerp>s  ' ((rc$\rSrSrSrSr/SQrSSjr\S\ 4Sj5r \S\ 4S j5r S \ SS4S jr S \ S \SS4S jrS\ SS4SjrS SjrS SjrS SjrS SjrS SjrS SjrS\SS4SjrS SjrS SjrS SjrS\ SS4SjrS\4SjrSrg)!LegacyWindowsTermiJanThis class allows interaction with the legacy Windows Console API. It should only be used in the context of environments where virtual terminal processing is not available. However, if it is used in a Windows environment, the entire API should work. Args: file (IO[str]): The file which the Windows Console API HANDLE is retrieved from, defaults to sys.stdout. )rrrs  r!Nc$[[5nX l[U5RnX0lUS-UlUS- S-UlUR URS--UlXl URUl URUl g)Nryr) r@STDOUT_handler`r0 _default_text _default_fore _default_back_default_attrs_filewriteflush)selffiler< default_texts r__init__LegacyWindowsTerm.__init__isf% 1&9EE ))A-*a/14"00D4F4F!4KL ZZ ZZ rc[UR5Rn[[ [ UR 5[ [ UR5S9$)ztReturns the current position of the cursor (0-based) Returns: WindowsCoordinates: The current cursor position. rr)r`rr/rr r(YX)rcoords rcursor_position!LegacyWindowsTerm.cursor_positionws;2$,,?PP!d3&8d3>PQQrc[UR5Rn[[ [ UR 5[ [ UR5S9$)zReturns the current size of the console screen buffer, in character columns and rows Returns: WindowsCoordinates: The width and height of the screen as WindowsCoordinates. r)r`rr.rr r(rr)r screen_sizes rrLegacyWindowsTerm.screen_sizes@8 ELL !S+--(d3 .F  rtextcFURU5 UR5 g)zWrite text directly to the terminal without any modification of styles Args: text (str): The text to write to the console N)rr)rrs r write_textLegacyWindowsTerm.write_texts 4 rstylecURnURnUR(aXCpCU(aUR[R 5R nUbUOSnUR(aXPR-nUR(aXPR)-nURUnO URnU(a@UR[R 5R nUbUOSnURUnO URnUceUce[UR[R "XVS--5S9 UR#U5 [URUR$S9 g)zuWrite styled text to the terminal. Args: text (str): The text to write style (Style): The style of the text Nryrr)rT)colorbgcolorreverse downgrader WINDOWSnumberbold BRIGHT_BITdimANSI_TO_WINDOWSrrr\rrLc_ushortrr)rrrrrforebacks r write_styledLegacyWindowsTerm.write_styleds0 -- ==$7 ??;#6#67>>D+4Dzzoo-yy..''-D%%D $$[%8%89@@D+4D''-D%%D LLV__TQY5G%H   9K9KLr new_positioncnURS:dURS:ag[URUS9 g)zSet the position of the cursor Args: new_position (WindowsCoordinates): The WindowsCoordinates representing the new position of the cursor. rNra)rrrdr)rrs rmove_cursor_to LegacyWindowsTerm.move_cursor_tos0   a <#3#3a#7  lCrcURnURnURn[URSS9n[ UR SX4S9 [UR URUUS9 g)z@Erase all content on the line the cursor is currently located atrr rIrJN) rrrrrrSrrYr)rrrcells_to_erasestart_coordinatess r erase_lineLegacyWindowsTerm.erase_linesg&& ..$.?3F3FAN" LL#n  # LL   !#  rcURnURRUR- n[URSX!S9 [ URUR UUS9 g)zBErase all content from the cursor position to the end of that linerrN)rrrrSrrYr)rrrs rerase_end_of_line#LegacyWindowsTerm.erase_end_of_lines\..))--0C0CC" LL#n  # LL   !!  rcURup[US5n[URSX#S9 [ URUR X#S9 g)zDErase all content from the cursor position to the start of that linerrrN)rrrSrrYr)rrrrJs rerase_start_of_line%LegacyWindowsTerm.erase_start_of_linesD''"3*"4<<SN" LL$--c rcURn[UR[URS- UR S9S9 g)z Move the cursor up a single cellrvrrNrrdrrrrrrs rmove_cursor_up LegacyWindowsTerm.move_cursor_ups:.. LL%#''!+1D1D rcURn[UR[URS-UR S9S9 g)z"Move the cursor down a single cellrvrrNrrs rmove_cursor_down"LegacyWindowsTerm.move_cursor_downs;.. LL%#''!+#'' rcURupX RRS- :XaUS- nSnOUS- n[UR[ XS9S9 g)zIMove the cursor forward a single cell. Wrap to the next line if required.rvrrrNrrrrdrrrrrs rmove_cursor_forward%LegacyWindowsTerm.move_cursor_forwardsT'' ""&&* * 1HCC 1HC LL!3!E rcolumncZURup#[UR[X!5S9 g)zMove cursor to the column specified by the zero-based column index, staying on the same row Args: column (int): The zero-based column index to move the cursor to. rN)rrdrr)rrr_s rmove_cursor_to_column'LegacyWindowsTerm.move_cursor_to_columns% %% 6H6UVrcURupUS:XaUS-nURRS- nOUS-n[UR[ XS9S9 g)zNMove the cursor backward a single cell. Wrap to the previous line if required.rrvrrNrrs rmove_cursor_backward&LegacyWindowsTerm.move_cursor_backwardsU'' !8 1HC""&&*C 1HC LL!3!E rc`UR5n[USS9n[URUS9 g)zHide the cursorrr.r9reN_get_cursor_sizer7rlr)rcurrent_cursor_sizeinvisible_cursors r hide_cursorLegacyWindowsTerm.hide_cursor$s/"335.6ITUVT\\7GHrc`UR5n[USS9n[URUS9 g)zShow the cursorrvrrNr)rrvisible_cursors r show_cursorLegacyWindowsTerm.show_cursor*s-"335,4GRSTT\\~FrrmcF[U5S:dS5e[U5 g)zaSet the title of the terminal window Args: title (str): The new title of the console window z.Console title must be less than 255 charactersN)lenrp)rrms r set_titleLegacyWindowsTerm.set_title0s$ 5zCQ!QQrch[5n[URUS9 [UR5$)zEGet the percentage of the character cell that is filled by the cursorr)r7rirr(r.)rres rr"LegacyWindowsTerm._get_cursor_size9s))+ T\\{C;%%&&r)rrrrrrrr)rzIO[str]r!N)r!N)rrrrr'rrrpropertyrrrstrrrrrrrrrrrr(rrrrrrrrrrrrrrJsJO&  R!3RR  /    st%M%MU%Mt%MND+=D$D        WCWDW  I G st'#'rrr__main__)ConsolezWin32 Console Examplesblackred)rrzblack on greenzChecking colour outputz[on red]on red!z [blue]blue!z[yellow]yellow!z[bold yellow]bold yellow!z[bright_yellow]bright_yellow!z%[dim bright_yellow]dim bright_yellow!z[italic cyan]italic cyan!z'[bold white on blue]bold white on blue!z7[reverse bold white on blue]reverse bold white on blue!z'[bold black on cyan]bold black on cyan!z[black on green]black on green!z[blue on green]blue on green!z[white on black]white on black!z[black on white]black on white!z'[#1BB152 on #DA812D]#1BB152 on #DA812D!zChecking cursor movementz"went back and wrapped to prev linervzwe go upzand downzwe went up and back 2zwe went down and back 2zChecking line erasingz( ...Deleting to the start of the line...z?The red arrow shows the cursor location, and direction of erasez) ...Now the whole line will be erased...zI'm going to disappear!z black on cyan)r )^r'rLsystypingrrr)platform LibraryLoaderWinDLL ImportErrorrtimerrrr r r r pip._vendor.rich.colorr pip._vendor.rich.stylerr"ENABLE_VIRTUAL_TERMINAL_PROCESSING_COORDr# Exceptionrrr,r7kernel32r@r?r:argtypesr>restyper(rGrDLPDWORDr;FillConsoleOutputCharacterWrOrMPOINTERrrSrYrVr3r\r[rCr`r^rdrcrirgrlrkSetConsoleTitleWroLPCWSTRrprrr<pip._vendor.rich.consolerconsolestdouttermrrparseheadingruleprintrrsleeprrrrrrrrrrrrrs> <<7  ! !&-- 0F  "BC DD ----.( %&"  ++0I&**I,,  NN !  & 8 8(// 8//00$OOX-=-=>"--x3, &JJ OO MM NNe() NN8>>" )%(0}}$      <%ooHH OO MM NNe() NN8>>" ($'/mm#     6"??BB OO MM%!$,==  B B-5]] B  B %ooHH OO NN-.($'/mm# & & & #OODD OOe()&"%-MM! ? ?); ?  ?<< OO NN&'"!)  G G.A G  G << OO NN&'"!)  G G.A G  G??33%--.#== )3 )4 )s's'l z ^F0iG SZZ (DNN+,  /Ekk*+G LL)* MM#$ MM-  MM#$ MM-. MM12 MM9: MM-. MM;< MMKL MM;< MM34 MM12 MM34 MM34 MM;< LL+, MMOOO89JJqMOOJJJqMOOJJJqMOO+,JJqMOO-.JJqM  MMO LL() MM=>OOUVJJqMr"c5;;~67JJqMJJqM MM89OOUVJJqMr"c5;;~67JJqMJJqM MM?@/u{{?7STJJqMOO $Kmr