
    Mh                     0    d dl mZmZmZmZ  G d d      Zy)    )AnyIterableOptionalTuplec                   @   e Zd ZdZddeddddddf	dee   dee   dedee   d	ee   d
edededee   ddfdZ	defdZ
edee   fd       Zedeedf   fd       Zedefd       Zedefd       Zej"                  deddfd       ZddededdfdZedefd       Zy)Argumenta\  
    A command-line argument/flag.

    :param name:
        Syntactic sugar for ``names=[<name>]``. Giving both ``name`` and
        ``names`` is invalid.
    :param names:
        List of valid identifiers for this argument. For example, a "help"
        argument may be defined with a name list of ``['-h', '--help']``.
    :param kind:
        Type factory & parser hint. E.g. ``int`` will turn the default text
        value parsed, into a Python integer; and ``bool`` will tell the
        parser not to expect an actual value but to treat the argument as a
        toggle/flag.
    :param default:
        Default value made available to the parser if no value is given on the
        command line.
    :param help:
        Help text, intended for use with ``--help``.
    :param positional:
        Whether or not this argument's value may be given positionally. When
        ``False`` (default) arguments must be explicitly named.
    :param optional:
        Whether or not this (non-``bool``) argument requires a value.
    :param incrementable:
        Whether or not this (``int``) argument is to be incremented instead of
        overwritten/assigned to.
    :param attr_name:
        A Python identifier/attribute friendly name, typically filled in with
        the underscored version when ``name``/``names`` contain dashes.

    .. versionadded:: 1.0
    N Fnamenameskinddefaulthelp
positionaloptionalincrementable	attr_namereturnc
                    |r|rt        d      |s|st        d      |rt        |      | _        n|r
|s|f| _        || _        d }
|t        u rg }
|r|}
|
x| _        | _        || _        || _        || _	        || _
        || _        |	| _        y )Nz8Cannot give both 'name' and 'names' arguments! Pick one.z(An Argument must have at least one name.)	TypeErrortupler   r   list	raw_value_valuer   r   r   r   r   r   )selfr
   r   r   r   r   r   r   r   r   initial_values              n/var/www/pru.catia.catastroantioquia-mas.com/valormasv2/lib/python3.12/site-packages/invoke/parser/argument.py__init__zArgument.__init__*   s     EJ  FGGuDJ%DJ	'+4<M#M'44	$ *"    c                    d}| j                   r*dj                  dj                  | j                               }d}| j                  s| j                  rd}| j                  r|dz  }| j                  r|dz  }d}| j
                  t        k7  r%dj                  | j
                  j                        }dj                  | j                  j                  | j                  |||      S )	N z ({})z,  *?z [{}]z<{}: {}{}{}{}>)
	nicknamesformatjoinr   r   r   str__name__	__class__r
   )r   nicksflagsr   s       r   __repr__zArgument.__repr__P   s    >>NN499T^^#<=E??dmmE??SLE==SLE 99>>$))"4"45D&&NN##TYYtU
 	
r   c                 <    | j                   xs | j                  d   S )z
        The canonical attribute-friendly name for this argument.

        Will be ``attr_name`` (if given to constructor) or the first name in
        ``names`` otherwise.

        .. versionadded:: 1.0
        r   )r   r   r   s    r   r
   zArgument.named   s     ~~.A.r   .c                      | j                   dd  S N   )r   r.   s    r   r$   zArgument.nicknamesp   s    zz!"~r   c                 D    | j                   t        u ry| j                  ryy)NFT)r   boolr   r.   s    r   takes_valuezArgument.takes_valuet   s     99r   c                 J    | j                   | j                   S | j                  S N)r   r   r.   s    r   valuezArgument.value|   s      #kk5t{{G4<<Gr   argc                 *    | j                  |d       y )NT)cast)	set_value)r   r8   s     r   r7   zArgument.value   s    s&r   r7   r:   c                      | _         d }|r j                  } j                  t        u r fd} j                  r fd} ||       _        y)a!  
        Actual explicit value-setting API call.

        Sets ``self.raw_value`` to ``value`` directly.

        Sets ``self.value`` to ``self.kind(value)``, unless:

        - ``cast=False``, in which case the raw value is also used.
        - ``self.kind==list``, in which case the value is appended to
          ``self.value`` instead of cast & overwritten.
        - ``self.incrementable==True``, in which case the value is ignored and
          the current (assumed int) value is simply incremented.

        .. versionadded:: 1.0
        c                     | S r6   r	   )xs    r   <lambda>z$Argument.set_value.<locals>.<lambda>   s     r   c                 $    j                   | gz   S r6   r7   r>   r   s    r   r?   z$Argument.set_value.<locals>.<lambda>   s    TZZ1#- r   c                 "    j                   dz   S r0   rA   rB   s    r   r?   z$Argument.set_value.<locals>.<lambda>   s    TZZ!^ r   N)r   r   r   r   r   )r   r7   r:   funcs   `   r   r;   zArgument.set_value   sI      99D99-D ,D5kr   c                 l    | j                   t        u rt        | j                        S | j                  duS )a/  
        Returns whether the argument was ever given a (non-default) value.

        For most argument kinds, this simply checks whether the internally
        stored value is non-``None``; for others, such as ``list`` kinds,
        different checks may be used.

        .. versionadded:: 1.3
        N)r   r   r3   r   r.   s    r   	got_valuezArgument.got_value   s.     99$${{$&&r   )T)r(   
__module____qualname____doc__r'   r   r   r   r3   r   r,   propertyr
   r   r$   r4   r7   setterr;   rF   r	   r   r   r   r      s    H #!!%" ##'$#sm$# }$# 	$#
 #$# sm$# $# $# $# C=$# 
$#L
# 
( 	/hsm 	/ 	/ 5c?   T   Hs H H \\' ' ' '"s "$ "$ "@ '4 ' 'r   r   N)typingr   r   r   r   r   r	   r   r   <module>rM      s    1 1k' k'r   