ó
    &ÝNj"'  ã                   ó  • S SK Jr  S SKJr  S SKJr  S SKJrJrJ	r	J
r
JrJrJrJr  S SKrS SKrS SKrS SKrS SKr SSKJr  SSKJr  S	rSS jr\R8                  R;                  S5      (       a  \" 5         \R<                  " S5      r\R@                  r S\!S
\\	\!   \!4   4S jr"\S\!S
\S   4S j5       r#S\
S
\$4S jr%S\
S
\\$\4   4S jr&S\'S
\\!   4S jr( " S S\RR                  5      r*\" SS5      r+g! \ a    S SKJr  S SKr NÂf = f)é    )Ú
namedtuple)Úcontextmanager)ÚTracebackType)ÚAnyÚ	GeneratorÚListÚIOÚOptionalÚTupleÚTypeÚUnionNé   )ÚLexicon)Úyamlz-%(name)s.%(module)s.%(funcName)s: %(message)sÚreturnc                  óR   • [         R                  " [         R                  [        S9  g )N)ÚlevelÚformat)ÚloggingÚbasicConfigÚDEBUGÚ
LOG_FORMAT© ó    ÚH/home/mande/repo/quber/.venv/lib/python3.13/site-packages/invoke/util.pyÚenable_loggingr      s   € Ü×ÒœgŸm™m´JÓ?r   ÚINVOKE_DEBUGÚinvokeÚnamec                 ó8   • U R                  S5      nUSS US   4$ )z_
Return key tuple for use sorting dotted task names, via e.g. `sorted`.

.. versionadded:: 1.0
Ú.Néÿÿÿÿ)Úsplit)r   Úpartss     r   Útask_name_sort_keyr%   -   s-   € ð �J‰J�s‹O€Eð
 	ˆcˆrˆ
àˆb‰	ðð r   Úwhere)NNNc              #   óÎ   #   • [         R                  " 5       n[         R                  " U 5         S v •  [         R                  " U5        g ! [         R                  " U5        f = f7f)N)ÚosÚgetcwdÚchdir)r&   Úcwds     r   Úcdr,   ?   s9   é € ä
�)Š)‹+€CÜ‡H‚HˆU„OðÛä
�Š��øŒ�Š��üs   ‚,A%¯A
 ³A%Á
A"Á"A%Ústreamc                 ó€   •  [        U R                  5       [        5      $ ! [        [        R
                  4 a     gf = f)aA  
Cleanly determine whether ``stream`` has a useful ``.fileno()``.

.. note::
    This function helps determine if a given file-like object can be used
    with various terminal-oriented modules and functions such as `select`,
    `termios`, and `tty`. For most of those, a fileno is all that is
    required; they'll function even if ``stream.isatty()`` is ``False``.

:param stream: A file-like object.

:returns:
    ``True`` if ``stream.fileno()`` returns an integer, ``False`` otherwise
    (this includes when ``stream`` lacks a ``fileno`` method).

.. versionadded:: 1.0
F)Ú
isinstanceÚfilenoÚintÚAttributeErrorÚioÚUnsupportedOperation©r-   s    r   Ú
has_filenor6   I   s7   € ð$Ü˜&Ÿ-™-›/¬3Ó/Ð/øÜœB×3Ñ3Ð4ó Ùðús   ‚   =¼=c                 óâ   • [        U S5      (       a*  [        U R                  5      (       a  U R                  5       $ [        U 5      (       a$  [        R                  " U R                  5       5      $ g)aÉ  
Cleanly determine whether ``stream`` is a TTY.

Specifically, first try calling ``stream.isatty()``, and if that fails
(e.g. due to lacking the method entirely) fallback to `os.isatty`.

.. note::
    Most of the time, we don't actually care about true TTY-ness, but
    merely whether the stream seems to have a fileno (per `has_fileno`).
    However, in some cases (notably the use of `pty.fork` to present a
    local pseudoterminal) we need to tell if a given stream has a valid
    fileno but *isn't* tied to an actual terminal. Thus, this function.

:param stream: A file-like object.

:returns:
    A boolean depending on the result of calling ``.isatty()`` and/or
    `os.isatty`.

.. versionadded:: 1.0
ÚisattyF)ÚhasattrÚcallabler8   r6   r(   r0   r5   s    r   r8   r8   a   sP   € ô. ˆv�x× Ñ ¤X¨f¯m©m×%<Ñ%<Ø�}‰}‹Ðä	�F×	Ñ	Ü�yŠy˜Ÿ™›Ó)Ð)ð r   Úobjc                 óÈ   • U R                   nU(       a.  UR                  5       (       a  U[        U 5      R                   :X  a  gUR                  5       R	                  5       S   $ )zc
Yield an object's first docstring line, or None if there was no docstring.

.. versionadded:: 1.0
Nr   )Ú__doc__ÚstripÚtypeÚlstripÚ
splitlines)r;   Ú	docstrings     r   ÚhelplinerC   ‚   sO   € ð —‘€IæØ�‰× Ñ Øœ˜S›	×)Ñ)Ó)àØ×ÑÓ×(Ñ(Ó*¨1Ñ-Ð-r   c                   ó‚   ^ • \ rS rSrSrS\SS4U 4S jjrSU 4S jjrS\S   4S	 jr	\
S\4S
 j5       rS\4S jrSrU =r$ )ÚExceptionHandlingThreadé’   a  
Thread handler making it easier for parent to handle thread exceptions.

Based in part on Fabric 1's ThreadHandler. See also Fabric GH issue #204.

When used directly, can be used in place of a regular ``threading.Thread``.
If subclassed, the subclass must do one of:

- supply ``target`` to ``__init__``
- define ``_run()`` instead of ``run()``

This is because this thread's entire point is to wrap behavior around the
thread's execution; subclasses could not redefine ``run()`` without
breaking that functionality.

.. versionadded:: 1.0
Úkwargsr   Nc                 óN   >• [         TU ]  " S0 UD6  SU l        Xl        SU l        g)zÄ
Create a new exception-handling thread instance.

Takes all regular `threading.Thread` keyword arguments, via
``**kwargs`` for easier display of thread identity when raising
captured exceptions.
TNr   )ÚsuperÚ__init__ÚdaemonrG   Úexc_info)ÚselfrG   Ú	__class__s     €r   rJ   Ú ExceptionHandlingThread.__init__¥   s/   ø€ ô 	‰ÒÑ"˜6Ò"ð ˆŒàŒð ð 	�r   c                 óš  >•  [        U S5      (       a+  [        U R                  5      (       a  U R                  5         g [        TU ]  5         g ! [
         ar    [        R                  " 5       U l        SnSnSU R                  ;   a  U R                  S   R                  n[        UR                  U R                  S   U5      5         g f = f)NÚ_runz-Encountered exception {!r} in thread for {!r}Útargetr   )r9   r:   rQ   rI   ÚrunÚBaseExceptionÚsysrL   rG   Ú__name__Údebugr   )rM   Úmsgr   rN   s      €r   rS   ÚExceptionHandlingThread.run»   s    ø€ ð#	6ô �t˜V×$Ñ$¬°$·)±)×)<Ñ)<ð —	‘	•ä‘‘•øÜó 	6äŸLšL›NˆDŒMð BˆCð ˆDØ˜4Ÿ;™;Ó&Ø—{‘{ 8Ñ,×5Ñ5�Ü�#—*‘*˜TŸ]™]¨1Ñ-¨tÓ4Ö5ð	6ús   ƒ;A ¿A ÁA9C
Ã	C
ÚExceptionWrapperc                 ó^   • U R                   c  g[        U R                  /U R                   Q76 $ )a  
If an exception occurred, return an `.ExceptionWrapper` around it.

:returns:
    An `.ExceptionWrapper` managing the result of `sys.exc_info`, if an
    exception was raised during thread execution. If no exception
    occurred, returns ``None`` instead.

.. versionadded:: 1.0
N)rL   rZ   rG   ©rM   s    r   Ú	exceptionÚ!ExceptionHandlingThread.exceptioná   s)   € ð �=‰=Ñ ØÜ §¡Ð<¨d¯m©mÒ<Ð<r   c                 óV   • U R                  5       (       + =(       a    U R                  SL$ )zŠ
Returns ``True`` if not alive and has a stored exception.

Used to detect threads that have excepted & shut down.

.. versionadded:: 1.0
N)Úis_aliverL   r\   s    r   Úis_deadÚExceptionHandlingThread.is_deadð   s!   € ð —M‘M“OÔ#×B¨¯©¸dÐ)BÐBr   c                 óF   • [        U R                  S   R                  5      $ )NrR   )ÚstrrG   rV   r\   s    r   Ú__repr__Ú ExceptionHandlingThread.__repr__þ   s   € ä�4—;‘;˜xÑ(×1Ñ1Ó2Ð2r   )rK   rL   rG   ©r   N)rV   Ú
__module__Ú__qualname__Ú__firstlineno__r=   r   rJ   rS   r
   r]   ÚpropertyÚboolra   rd   re   Ú__static_attributes__Ú__classcell__)rN   s   @r   rE   rE   ’   sb   ø† ñð$ ð ¨÷ ÷,$6ðL=˜8Ð$6Ñ7ô =ð ðC˜ó Có ðCð3˜#÷ 3ò 3r   rE   rZ   zkwargs type value tracebackrg   ),Úcollectionsr   Ú
contextlibr   Útypesr   Útypingr   r   r   r	   r
   r   r   r   r3   r   r(   Ú	threadingrU   Úvendor.lexiconr   Úvendorr   ÚImportErrorÚlexiconr   r   ÚenvironÚgetÚ	getLoggerÚlogrW   rd   r%   r,   rl   r6   r8   ÚobjectrC   ÚThreadrE   rZ   r   r   r   Ú<module>r~      sC  ðÝ "Ý %Ý ß I× IÓ IÛ 	Û Û 	Û Û 
ðÝ'Ýð =€
ô@ð ‡:�:‡>�>�.×!Ñ!ÙÔð ×Ò˜Ó!€Ø�	‰	€ð˜Sð  U¨4°©9°c¨>Ñ%:ô ð$ ðˆcð �iÐ 0Ñ1ó ó ðð�rð ˜dô ð0�2ð ˜%  c 	Ñ*ô ðB.�&ð .˜X c™]ô .ô n3˜i×.Ñ.ô n3ñp ØÐ5óÑ øðg ó ÝÝðús   ¼C8 Ã8DÄ
D