
    /h                         S r SSKrSSKrSSKJr  \R
                  S:X  a  SSKrSSKr " S S\R                  5      r	S r
S r\S	 5       rg)
zv
A utility for showing and hiding the terminal cursor on Windows and Linux, based on https://github.com/bchao1/bullet
    N)contextmanagerntc                   L    \ rS rSrS\R
                  4S\R                  4/rSrg)
CursorInfo   sizevisible N)	__name__
__module____qualname____firstlineno__ctypesc_intc_byte_fields___static_attributes__r
       Y/home/james-whalen/.local/lib/python3.13/site-packages/accelerate/commands/menu/cursor.pyr   r      s    V\\*Y,FGr   r   c                  >   [         R                  S:X  a  [        5       n [        R                  R
                  R                  S5      n[        R                  R
                  R                  U[        R                  " U 5      5        SU l	        [        R                  R
                  R                  U[        R                  " U 5      5        g [         R                  S:X  a>  [        R                  R                  S5        [        R                  R                  5         g g )Nr   Fposixz[?25losnamer   r   windllkernel32GetStdHandleGetConsoleCursorInfobyrefr	   SetConsoleCursorInfosysstdoutwriteflushcihandles     r   hide_cursorr)   "   s    	ww$\''44S933FFLL<LM
33FFLL<LM	G	

%

 
r   c                  >   [         R                  S:X  a  [        5       n [        R                  R
                  R                  S5      n[        R                  R
                  R                  U[        R                  " U 5      5        SU l	        [        R                  R
                  R                  U[        R                  " U 5      5        g [         R                  S:X  a>  [        R                  R                  S5        [        R                  R                  5         g g )Nr   r   Tr   z[?25hr   r&   s     r   show_cursorr+   .   s    	ww$\''44S933FFLL<LM
33FFLL<LM	G	

%

 
r   c               #   \   #     [        5         Sv   [        5         g! [        5         f = f7f)z+Context manager to hide the terminal cursorN)r)   r+   r
   r   r   hider-   :   s     s   , ,),)__doc__r   r"   
contextlibr   r   r   msvcrt	Structurer   r)   r+   r-   r
   r   r   <module>r2      sZ    
 
 % 77d?HV%% H
		  r   