
    ^h@	                         S r SSKrSSKrSSKJr  SSKr\R                  R                  S5      (       a  S r	OS r	S r
g)z;Enable pyglet to be used interactively with prompt_toolkit
    N)default_timerlinuxc                 F     U R                  5         g ! [         a     g f = fN)flipAttributeErrorwindows    _/home/james-whalen/.local/lib/python3.13/site-packages/IPython/terminal/pt_inputhooks/pyglet.pyr   r      s"    	KKM 		s    
  c                 $    U R                  5         g r   )r   r	   s    r   r   r      s        c                 D    [        5       nU R                  5       (       d  [        R                   R                  5         [        R                  R
                   H?  nUR                  5         UR                  5         UR                  S5        [        U5        MA     [        5       U-
  nUS:  a  [        R                  " S5        O3US:  a  [        R                  " S5        O[        R                  " S5        U R                  5       (       d  M  gg! [         a     gf = f)a1  Run the pyglet event loop by processing pending events only.

This keeps processing pending events until stdin is ready.  After
processing all pending events, a call to time.sleep is inserted.  This is
needed, otherwise, CPU usage is at 100%.  This sleep time should be tuned
though for best performance.
on_drawg      $@g      ?g?g?gMbP?N)clockinput_is_readypyglettickappwindows	switch_todispatch_eventsdispatch_eventr   timesleepKeyboardInterrupt)contexttr
   	used_times       r   	inputhookr      s     G((**LL **,,  "&&(%%i0V	 -  !I4

3S 

4  

5!9 ((**:  s   DD 
DD)__doc__sysr   timeitr   r   r   platform
startswithr   r    r   r   <module>r&      s>      )  <<7##*r   