ó
    EñiÐ	  ã                   óV   • S r SSKJrJr  S\4S jrS\\   4S jr " S S\5      r	S	 r
g
)zž
This file contains utilities for handling input from the user and registering specific keys to specific functions,
based on https://github.com/bchao1/bullet
é   )ÚKEYMAPÚget_characterÚkeyc                 ó   ^ • U 4S jnU$ )zJ
Mark the function with the key code so it can be handled in the register
c                 ó:   >• [        U S/ 5      nUT/-  nXl        U $ ©NÚ
handle_key©Úgetattrr	   )ÚfuncÚhandler   s     €Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/accelerate/commands/menu/input.pyÚ	decoratorÚmark.<locals>.decorator   s&   ø€ Ü˜˜|¨RÓ0ˆØ�3�%‰ˆØ ŒØˆó    © )r   r   s   ` r   Úmarkr      ó   ø€ õ
ð Ðr   Úkeysc                  ó   ^ • U 4S jnU$ )zK
Mark the function with the key codes so it can be handled in the register
c                 ó8   >• [        U S/ 5      nUT-  nXl        U $ r   r
   )r   r   r   s     €r   r   Ú mark_multiple.<locals>.decorator*   s$   ø€ Ü˜˜|¨RÓ0ˆØ�$‰ˆØ ŒØˆr   r   )r   r   s   ` r   Úmark_multipler   %   r   r   c                   ó<   ^ • \ rS rSrSrU 4S jr\S 5       rSrU =r	$ )Ú
KeyHandleré3   z3
Metaclass that adds the key handlers to the class
c                 óø   >• [         TU ]  XX#5      n[        US5      (       d  0 Ul        [        R
                  Ul        UR                  5        H'  n[        US/ 5      nU H  nXTR                  U'   M     M)     U$ )NÚkey_handlerr	   )ÚsuperÚ__new__Úhasattrr   r   Úhandle_inputÚvaluesr   )	ÚclsÚnameÚbasesÚattrsÚnew_clsÚvalueÚhandled_keysr   Ú	__class__s	           €r   r    ÚKeyHandler.__new__8   ss   ø€ Ü‘'‘/ #¨UÓ:ˆÜ�w ×.Ñ.Ø"$ˆGÔÜ)×6Ñ6ˆÔà—\‘\–^ˆEÜ" 5¨,¸Ó;ˆLÛ#�Ø+0×#Ñ# CÓ(ó $ñ $ð ˆr   c                 ó¨   • [        5       nU[        S   :w  a  [        U5      nU R                  R	                  U5      nU(       a  Xl        U" U 5      $ g)zDFinds and returns the selected character if it exists in the handlerÚ	undefinedN)r   r   Úordr   ÚgetÚcurrent_selection)r$   ÚcharÚhandlers      r   r"   ÚKeyHandler.handle_inputD   sK   € ô ‹ˆØ”6˜+Ñ&Ó&Ü�t“9ˆDØ—/‘/×%Ñ% dÓ+ˆÞØ$(Ô!Ù˜3“<Ðàr   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r    Ústaticmethodr"   Ú__static_attributes__Ú__classcell__)r+   s   @r   r   r   3   s!   ø† ñõ
ð ñ
ó ö
r   r   c                 ót   • [        U R                  U R                  U R                  R	                  5       5      $ )z&Adds KeyHandler metaclass to the class)r   r5   Ú	__bases__Ú__dict__Úcopy)r$   s    r   ÚregisterrA   R   s&   € ä�c—l‘l C§M¡M°3·<±<×3DÑ3DÓ3FÓGÐGr   N)r9   Úkeymapr   r   Ústrr   Úlistr   Útyper   rA   r   r   r   Ú<module>rF      s=   ðñ÷
 *ðˆcô ð˜˜c™ô ô�ô ó>Hr   