ó
    &ÝNjU#  ã                   óš   • S SK JrJrJrJrJrJrJr  SSKJ	r	  SSK
JrJr  SSKJrJr  SSKJr  \(       a  SSKJr  SSKJr   " S	 S
5      rg)é    )ÚTYPE_CHECKINGÚAnyÚDictÚListÚOptionalÚTupleÚUnioné   )ÚConfig)ÚParserContextÚParseResult)ÚCallÚTask)Údebug)Ú
Collection)ÚResultc            	       óü   • \ rS rSrSr  SSSS\S   S\S	   S
S4S jjrS\\\	\\
\\4   4   \4   S
\
S   4S jrS\	\\\	\\
\\4   4   \4   S4   S
\S   4S jrS\S   S
\S   4S jrS\S   S
\S   4S jrSrg)ÚExecutoré   z•
An execution strategy for Task objects.

Subclasses may override various extension points to change, add or remove
behavior.

.. versionadded:: 1.0
NÚ
collectionr   Úconfigr   Úcorer   Úreturnc                 ój   • Xl         Ub  UO	[        5       U l        Ub  X0l        g[        5       U l        g)a-  
Initialize executor with handles to necessary data structures.

:param collection:
    A `.Collection` used to look up requested tasks (and their default
    config data, if any) by name during execution.

:param config:
    An optional `.Config` holding configuration state. Defaults to an
    empty `.Config` if not given.

:param core:
    An optional `.ParseResult` holding parsed core program arguments.
    Defaults to ``None``.

.. versionchanged:: 3.0
    The ``core`` attribute now defaults to an 'empty' `.ParseResult` if
    ``None`` was given.
N)r   r   r   r   r   )Úselfr   r   r   s       ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/invoke/executor.pyÚ__init__ÚExecutor.__init__   s+   € ð2 %ŒØ &Ñ 2‘f¼»ˆŒØ Ñ,�D�	´+³-ˆ�	ó    Útasks)r   r   c                 óŠ  • [        SR                  U Vs/ s H  o"PM     sn5      5        U R                  U5      n[        SR                  U5      5        [        U5      nU R	                  U5      n U R
                  R                  R                  nU(       a  U R                  U5      OUn0 nU Hö  nX„;   =(       a    UR                  n	[        SR                  U5      5        U R
                  n
U R                  R                  UR                  5      nU
R                  U5        U
R                  5         [        S5        UR                  X R                   S9nU/UR"                  Q7nUR$                  " U0 UR&                  D6nU	(       a  [)        U5        XçUR$                  '   Mø     U$ s  snf ! [         a    Sn GN.f = f)aô  
Execute one or more ``tasks`` in sequence.

:param tasks:
    An all-purpose iterable of "tasks to execute", each member of which
    may take one of the following forms:

    **A string** naming a task from the Executor's `.Collection`. This
    name may contain dotted syntax appropriate for calling namespaced
    tasks, e.g. ``subcollection.taskname``. Such tasks are executed
    without arguments.

    **A two-tuple** whose first element is a task name string (as
    above) and whose second element is a dict suitable for use as
    ``**kwargs`` when calling the named task. E.g.::

        [
            ('task1', {}),
            ('task2', {'arg1': 'val1'}),
            ...
        ]

    is equivalent, roughly, to::

        task1()
        task2(arg1='val1')

    **A `.ParserContext`** instance, whose ``.name`` attribute is used
    as the task name and whose ``.as_kwargs`` attribute is used as the
    task kwargs (again following the above specifications).

    .. note::
        When called without any arguments at all (i.e. when ``*tasks``
        is empty), the default task from ``self.collection`` is used
        instead, if defined.

:returns:
    A dict mapping task objects to their return values.

    This dict may include pre- and post-tasks if any were executed. For
    example, in a collection with a ``build`` task depending on another
    task named ``setup``, executing ``build`` will result in a dict
    with two keys, one for ``build`` and one for ``setup``.

.. versionadded:: 1.0
zExamining top level tasks {!r}z#Tasks (now Calls) with kwargs: {!r}TzExecuting {!r}z/Finished loading collection & shell env configs)Úcore_parse_result)r   ÚformatÚ	normalizeÚlistÚexpand_callsr   r    ÚdedupeÚAttributeErrorÚ	autoprintr   ÚconfigurationÚ	called_asÚload_collectionÚload_shell_envÚmake_contextr   ÚargsÚtaskÚkwargsÚprint)r   r    ÚxÚcallsÚdirectÚexpandedr'   ÚresultsÚcallr)   r   Úcollection_configÚcontextr/   Úresults                  r   ÚexecuteÚExecutor.execute4   s‘  € ôd 	Ð.×5Ñ5Á%Ó6HÂ%¸Q²qÁ%Ñ6HÓIÔJØ—‘˜uÓ%ˆÜÐ3×:Ñ:¸5ÓAÔBô �e“ˆð ×$Ñ$ UÓ+ˆð	Ø—[‘[×&Ñ&×-Ñ-ˆFö *0�—‘˜HÔ%°Xˆàˆó ˆDØ™×9¨4¯>©>ˆIÜÐ"×)Ñ)¨$Ó/Ô0ð —[‘[ˆFð
 !%§¡× =Ñ =¸d¿n¹nÓ MÐØ×"Ñ"Ð#4Ô5Ø×!Ñ!Ô#ÜÐCÔDð ×'Ñ'¨Ç)Á)Ð'ÐLˆGØÐ(˜dŸi™iÑ(ˆDØ—Y’Y Ð4¨¯©Ñ4ˆFÞÜ�f”ð "(�D—I‘IÓñ1 ð2 ˆùò_ 7Iøô ó 	Ø‹Fð	ús   •F-Á3 F2 Æ2GÇG.r   c                 óš  • / nU Hw  n[        U[        5      (       a  Un0 nO2[        U[        5      (       a  UR                  nUR                  nOUu  pE[        U R                  U   XTS9nUR                  U5        My     U(       dD  U R                  R                  b-  [        U R                  U R                  R                     5      /nU$ )z“
Transform arbitrary task list w/ various types, into `.Call` objects.

See docstring for `~.Executor.execute` for details.

.. versionadded:: 1.0
)r1   r+   )	Ú
isinstanceÚstrr   ÚnameÚ	as_kwargsr   r   ÚappendÚdefault)r   r    r4   r0   rA   r1   Úcs          r   r$   ÚExecutor.normalize—   s©   € ð ˆÛˆDä˜$¤×$Ñ$Ø�Ø‘Ü˜D¤-×0Ñ0Ø—y‘y�ØŸ™‘à#‘�Ü�T—_‘_ TÑ*°6ÑJˆAØ�L‰L˜ŽOñ ö ˜Ÿ™×0Ñ0Ñ<Ü˜$Ÿ/™/¨$¯/©/×*AÑ*AÑBÓCÐDˆEØˆr   r4   c                 óÊ   • / n[        S5        U HO  nX2;  a-  [        SR                  U5      5        UR                  U5        M5  [        SR                  U5      5        MQ     U$ )z§
Deduplicate a list of `tasks <.Call>`.

:param calls: An iterable of `.Call` objects representing tasks.

:returns: A list of `.Call` objects.

.. versionadded:: 1.0
zDeduplicating tasks...z{!r}: no duplicates found, okz%{!r}: found in list already, skipping)r   r#   rC   )r   r4   Údedupedr8   s       r   r'   ÚExecutor.dedupeµ   s]   € ð ˆÜÐ&Ô'ÛˆDØÓ"ÜÐ5×<Ñ<¸TÓBÔCØ—‘˜tÖ$äÐ=×DÑDÀTÓJÖKñ ð ˆr   c                 óZ  • / nU H¢  n[        U[        5      (       a  [        U5      n[        SR	                  U5      5        UR                  U R                  UR                  5      5        UR                  U5        UR                  U R                  UR                  5      5        M¤     U$ )ao  
Expand a list of `.Call` objects into a near-final list of same.

The default implementation of this method simply adds a task's
pre/post-task list before/after the task itself, as necessary.

Subclasses may wish to do other things in addition (or instead of) the
above, such as multiplying the `calls <.Call>` by argument vectors or
similar.

.. versionadded:: 1.0
zExpanding task-call {!r})
r?   r   r   r   r#   Úextendr&   ÚprerC   Úpost)r   r4   Úretr8   s       r   r&   ÚExecutor.expand_callsÉ   sŠ   € ð ˆÛˆDô ˜$¤×%Ñ%Ü˜D“z�ÜÐ,×3Ñ3°DÓ9Ô:ð �J‰J�t×(Ñ(¨¯©Ó2Ô3Ø�J‰J�tÔØ�J‰J�t×(Ñ(¨¯©Ó3Ö4ñ! ð" ˆ
r   )r   r   r   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r	   r@   r   r   r   r   r<   r   r$   r'   r&   Ú__static_attributes__© r   r   r   r      s  † ñð &*Ø(,ñ	@à ð@ð ˜Ñ"ð@ð �}Ñ%ð	@ð
 
õ@ð:aØ˜C  s¨D°°c°©NÐ':Ñ!;¸]ÐJÑKðaà	ÐÑ	ôaðFàØ�#�u˜S $ s¨C x¡.Ð0Ñ1°=Ð@ÑAÀ3ÐFñ
ðð
 
ˆf‰ôð<˜D ™Lð ¨T°&©\ô ð( $ v¡,ð °4¸±<÷ r   r   N)Útypingr   r   r   r   r   r   r	   r   r   Úparserr   r   r    r   r   Úutilr   r   r   Úrunnersr   r   rV   r   r   Ú<module>r[      s/   ðß I× IÑ Iå ß .ß Ý æÝ&Ý÷[ò [r   