Ë
    nûàgz-  ã                   ó<  — d dl Z d dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ ej$                  Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zd„ Zd„ Zd„ Z ed«      Zd„ Z	 ddddddœd„Zed„ «       Zy)é    N)Úcompile)Ú	signatureÚgetdocÚ	Parameter)ÚArgumentParser)Úcontextmanager)Úwraps)ÚIOBase)ÚAutocommandErrorc                   ó   — e Zd ZdZy)ÚAnnotationErrorzEAnnotation error: annotation must be a string, type, or tuple of bothN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úf/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/setuptools/_vendor/autocommand/autoparse.pyr   r      s   „ ÚOr   r   c                   ó   — e Zd ZdZy)ÚPositionalArgErrorzQ
    Postional Arg Error: autocommand can't handle postional-only parameters
    Nr   r   r   r   r   r   #   s   „ òr   r   c                   ó   — e Zd ZdZy)Ú
KWArgErrorz:kwarg Error: autocommand can't handle a **kwargs parameterNr   r   r   r   r   r   )   s   „ ÚDr   r   c                   ó   — e Zd ZdZy)ÚDocstringErrorzDocstring errorNr   r   r   r   r   r   -   s   „ Úr   r   c                   ó   — e Zd ZdZy)ÚTooManySplitsErrorz±
    The docstring had too many ---- section splits. Currently we only support
    using up to a single split, to split the docstring into description and
    epilog parts.
    Nr   r   r   r   r   r   1   s   „ òr   r   c                 óR  — | t         u ryt        | «      r| dfS t        | t        «      rd| fS t        | t        «      rD	 | \  }}t        |«      rt        |t        «      r||fS t        |t        «      rt        |«      r||fS t        | «      ‚# t
        $ r}t        | «      |‚d}~ww xY w)z¾
    Given an annotation, return the (type, description) for the parameter.
    If you provide an annotation that is somehow both a string and a callable,
    the behavior is undefined.
    )NNN)Ú_emptyÚcallableÚ
isinstanceÚstrÚtupleÚ
ValueErrorr   )Ú
annotationÚarg1Úarg2Úes       r   Ú_get_type_descriptionr)   9   s¯   € ð ”VÑØÜ	�*Ô	Ø˜4ÐÐÜ	�J¤Ô	$Ø�ZÐÐÜ	�J¤Ô	&ð	"Ø#‰JˆD�$ô ˜Œ~¤*¨T´3Ô"7Ø˜T�zÐ!Ü˜D¤#Ô&¬8°D¬>Ø˜T�zÐ!ä
˜*Ó
%Ð%øô ò 	5Ü! *Ó-°1Ð4ûð	5ús   ¾B Â	B&ÂB!Â!B&c                 óä  — | j                   | j                  u rt        | «      ‚| j                   | j                  u rt	        | «      ‚i }d}t        | j                  «      \  }}| j                  }|€|t        dhvrt        |«      }|t        ur||d<   d}|�?|t        u r|r|t        u rd|d<   nd|d<   d}nt        |t        «      r
t        |d<   n||d<   | j                   | j                  u rd	|d
<   |�||d<   g }	| j                  }
|rŠ|
d   |
d   j!                  «       fD ]9  }||vsŒ|j#                  |«       |	j%                  dj'                  |«      «        n t)        |
«      dkD  s|	s |	j%                  dj'                  |
«      «       |
|d<   n|	j%                  |
«        |j*                  |	i |¤Ž |r8|t        u r/|j+                  dj'                  |
«      d|
|t        ur|nd¬«       yyy)aš  
    Add the argument(s) to an ArgumentParser (using add_argument) for a given
    parameter. used_char_args is the set of -short options currently already in
    use, and is updated (if necessary) by this function. If add_nos is True,
    this will also add an inverse switch for all boolean options. For
    instance, for the boolean parameter "verbose", this will create --verbose
    and --no-verbose.
    FNÚdefaultTÚ
store_trueÚactionÚstore_falseÚtypeÚ*ÚnargsÚhelpr   z-{}é   z--{}Údestz--no-{}Ústore_const)r-   r4   Úconst)ÚkindÚPOSITIONAL_ONLYr   ÚVAR_KEYWORDr   r)   r%   r+   r   r/   Úboolr!   r
   r"   ÚVAR_POSITIONALÚnameÚswapcaseÚaddÚappendÚformatÚlenÚadd_argument)ÚparamÚparserÚused_char_argsÚadd_nosÚarg_specÚ	is_optionÚarg_typeÚdescriptionr+   Úflagsr<   Úletters               r   Ú_add_argumentsrM   S   s#  € ð ‡z�z�U×*Ñ*Ñ*Ü  Ó'Ð'Ø	�‰�u×(Ñ(Ñ	(Ü˜ÓÐð €HØ€Iô 2°%×2BÑ2BÓCÑ€Hˆkð �m‰m€Gð Ð˜G¬F°D¨>Ñ9Ü˜“=ˆð ”fÑØ%ˆ�ÑØˆ	ð Ðà”tÑÙ˜g¬Ñ/Ø%1�˜Ò"à%2�˜Ñ"ð ‰Iô ˜¤Ô(Ü"ˆH�VÒð  (ˆH�VÑð
 ‡z�z�U×)Ñ)Ñ)àˆ�Ñð ÐØ&ˆ�Ñð €EØ�:‰:€Dáà˜1‘g˜t A™w×/Ñ/Ó1Ð1ò 	ˆFØ˜^Ò+Ø×"Ñ" 6Ô*Ø—‘˜UŸ\™\¨&Ó1Ô2Ùð		ô ˆt‹9�qŠ=¡Ø�L‰L˜Ÿ™ tÓ,Ô-àˆ�Òà�‰�TÔà€F×Ñ˜Ð+ (Ò+ñ �8œtÑ#Ø×ÑØ×Ñ˜TÓ"Ø ØØ$¬FÑ2‘'¸ð	 	õ 	?ð $€wr   c                 óœ   — t        ||¬«      }dh}t        | j                  j                  «       d„ ¬«      }|D ]  }t	        ||||«       Œ |S )zE
    Given the signature of a function, create an ArgumentParser
    )rJ   ÚepilogÚhc                 ó2   — t        | j                  «      dkD  S ©Nr3   )rA   r<   )rC   s    r   ú<lambda>zmake_parser.<locals>.<lambda>Ì   s   € œ#˜eŸj™j›/¨AÑ-€ r   )Úkey)r   ÚsortedÚ
parametersÚvaluesrM   )Úfunc_sigrJ   rO   rF   rD   rE   ÚparamsrC   s           r   Úmake_parserrZ   ¿   s^   € ô ¨¸FÔC€Fà�U€Nô
 Ø×Ñ×"Ñ"Ó$Ù-ô/€Fð ò ?ˆÜ�u˜f n°gÕ>ð?ð €Mr   z\n\s*-{4,}\s*\nc                 óš   — | €yt         j                  | «      }t        |«      dk(  r| dfS t        |«      dk(  r
|d   |d   fS t        «       ‚)zH
    Given a docstring, parse it into a description and epilog part
    )Ú r\   r3   r\   é   r   )Ú_DOCSTRING_SPLITÚsplitrA   r   )Ú	docstringÚpartss     r   Úparse_docstringrb   ×   sY   € ð ÐØä×"Ñ" 9Ó-€Eä
ˆ5ƒz�Q‚Ø˜"ˆ}ÐÜ	ˆU‹�qŠØ�Q‰x˜˜q™Ð!Ð!ä Ó"Ð"r   F©rJ   rO   rF   rD   c                óâ   ‡ ‡‡‡‡‡— ‰ €ˆˆˆˆfd„S t        ‰ «      Št        t        ‰ «      «      \  }}‰€t        ‰‰xs |‰xs |‰«      Št	        ‰ «      dˆ ˆˆfd„	«       }‰ |_        ‰|_        |S )a  
    This decorator converts a function that takes normal arguments into a
    function which takes a single optional argument, argv, parses it using an
    argparse.ArgumentParser, and calls the underlying function with the parsed
    arguments. If it is not given, sys.argv[1:] is used. This is so that the
    function can be used as a setuptools entry point, as well as a normal main
    function. sys.argv[1:] is not evaluated until the function is called, to
    allow injecting different arguments for testing.

    It uses the argument signature of the function to create an
    ArgumentParser. Parameters without defaults become positional parameters,
    while parameters *with* defaults become --options. Use annotations to set
    the type of the parameter.

    The `desctiption` and `epilog` parameters corrospond to the same respective
    argparse parameters. If no description is given, it defaults to the
    decorated functions's docstring, if present.

    If add_nos is True, every boolean option (that is, every parameter with a
    default of True/False or a type of bool) will have a --no- version created
    as well, which inverts the option. For instance, the --verbose option will
    have a --no-verbose counterpart. These are not mutually exclusive-
    whichever one appears last in the argument list will have precedence.

    If a parser is given, it is used instead of one generated from the function
    signature. In this case, no parser is created; instead, the given parser is
    used to parse the argv argument. The parser's results' argument names must
    match up with the parameter names of the decorated function.

    The decorated function is attached to the result as the `func` attribute,
    and the parser is attached as the `parser` attribute.
    c                 ó$   •— t        | ‰‰‰‰¬«      S )Nrc   )Ú	autoparse)ÚfrF   rJ   rO   rD   s    €€€€r   rS   zautoparse.<locals>.<lambda>  s   ø€ œØ˜;ØØØô	€ r   c                 óì   •— | €t         j                  dd  } ‰j                  «       }|j                  j	                  t        ‰j                  | «      «      «        ‰|j                  i |j                  ¤ŽS rR   )	ÚsysÚargvÚbind_partialÚ	argumentsÚupdateÚvarsÚ
parse_argsÚargsÚkwargs)rj   Úparsed_argsÚfuncrX   rD   s     €€€r   Úautoparse_wrapperz$autoparse.<locals>.autoparse_wrapper"  sg   ø€ àˆ<Ü—8‘8˜A˜B�<ˆDð
 ×+Ñ+Ó-ˆØ×Ñ×$Ñ$¤T¨&×*;Ñ*;¸DÓ*AÓ%BÔCá�[×%Ñ%Ð<¨×);Ñ);Ñ<Ð<r   ©N)r   rb   r   rZ   r	   rs   rD   )	rs   rJ   rO   rF   rD   Údocstr_descriptionÚdocstr_epilogrt   rX   s	   `````   @r   rf   rf   è   sŒ   ý€ ðP €|öð 	ô ˜‹€Hä(7¼¸t»Ó(EÑ%Ð˜à€~ÜØØÒ-Ð-ØÒ#�mØó	ˆô ˆ4ƒ[ö
=ó ð
=ð "ÐÔØ%ÐÔØÐr   c              /   óœ   K  — t        | t        t        t        f«      rt	        | g|¢­i |¤Ž5 }|–— ddd«       y| –— y# 1 sw Y   yxY w­w)a]  
    This context manager allows you to open a filename, if you want to default
    some already-existing file object, like sys.stdout, which shouldn't be
    closed at the end of the context. If the filename argument is a str, bytes,
    or int, the file object is created via a call to open with the given *args
    and **kwargs, sent to the context, and closed at the end of the context,
    just like "with open(filename) as f:". If it isn't one of the openable
    types, the object simply sent to the context unchanged, and left unclosed
    at the end of the context. Example:

        def work_with_file(name=sys.stdout):
            with smart_open(name) as f:
                # Works correctly if name is a str filename or sys.stdout
                print("Some stuff", file=f)
                # If it was a filename, f is closed at the end here.
    N)r!   r"   ÚbytesÚintÚopen)Úfilename_or_filerp   rq   Úfiles       r   Ú
smart_openr~   7  sU   è ø€ ô$ Ð"¤S¬%´Ð$5Ô6ÜÐ"Ð4 TÒ4¨VÑ4ð 	¸ØŠJ÷	ð 	ð Ó÷	ð 	üs   ‚+A­A ²AÁ A	ÁAru   ) ri   Úrer   Úcompile_regexÚinspectr   r   r   Úargparser   Ú
contextlibr   Ú	functoolsr	   Úior
   Úautocommand.errorsr   Úemptyr   r   r   r   r   r   r)   rM   rZ   r^   rb   rf   r~   r   r   r   ú<module>rˆ      sÇ   ðó$ Ý 'ß 0Ñ 0Ý #Ý %Ý Ý Ý /ð 
�‰€ôPÐ&ô PôÐ)ô ôEÐ!ô EôÐ%ô ô˜ô ò&ò4i?òXñ* !Ð!3Ó4Ð ò#ð$ ðLàØØØôLð^ ñó ñr   