Ë
    
_ßdëE  ã            	       óÒ  — d Z ddlZddlZddlZddlZddlmZmZ dZ ej                  dez  «      Z
 ej                  dj                  ee«      «      Zej                  dd	«      Z G d
„ d«      Zd„ Zej$                  D � ci c]  }  e| «      d“Œ c} Zd„ Zd„ Z G d„ d«      Zedk(  r:dZdD ]2  Z edez  «        edj9                   eee«      «      «        e«        Œ4 yyc c} w )a6  distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
é    Né   )ÚDistutilsGetoptErrorÚDistutilsArgErrorz[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^({})=!({})$ú-Ú_c                   ón   — e Zd ZdZdd„Zd„ Zd„ Zdd„Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zdd„Zd„ Zdd„Zdd„Zy)ÚFancyGetoptaÕ  Wrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    Nc                 óÈ   — || _         i | _        | j                   r| j                  «        i | _        i | _        g | _        g | _        i | _        i | _        i | _	        g | _
        y ©N)Úoption_tableÚoption_indexÚ_build_indexÚaliasÚnegative_aliasÚ
short_optsÚ	long_optsÚ
short2longÚ	attr_nameÚ	takes_argÚoption_order©Úselfr   s     úD/usr/lib/python3/dist-packages/setuptools/_distutils/fancy_getopt.pyÚ__init__zFancyGetopt.__init__,   sm   € ð )ˆÔð ˆÔØ×ÒØ×ÑÔð ˆŒ
ð !ˆÔð ˆŒØˆŒØˆŒØˆŒØˆŒð
 ˆÕó    c                 ó~   — | j                   j                  «        | j                  D ]  }|| j                   |d   <   Œ y )Nr   )r   Úclearr   )r   Úoptions     r   r   zFancyGetopt._build_indexT   s=   € Ø×Ñ×ÑÔ!Ø×'Ñ'ò 	2ˆFØ+1ˆD×Ñ˜f Q™iÒ(ñ	2r   c                 ó2   — || _         | j                  «        y r   )r   r   r   s     r   Úset_option_tablezFancyGetopt.set_option_tableY   s   € Ø(ˆÔØ×ÑÕr   c                 óš   — || j                   v rt        d|z  «      ‚|||f}| j                  j                  |«       || j                   |<   y )Nz'option conflict: already an option '%s')r   r   r   Úappend)r   Úlong_optionÚshort_optionÚhelp_stringr   s        r   Ú
add_optionzFancyGetopt.add_option]   sW   € Ø˜$×+Ñ+Ñ+Ü&Ø9¸KÑGóð ð " <°Ð=ˆFØ×Ñ×$Ñ$ VÔ,Ø-3ˆD×Ñ˜kÒ*r   c                 ó   — || j                   v S )zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)r   ©r   r#   s     r   Ú
has_optionzFancyGetopt.has_optiong   s   € ð ˜d×/Ñ/Ð/Ð/r   c                 ó,   — |j                  t        «      S )z’Translate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.©Ú	translateÚlongopt_xlater(   s     r   Úget_attr_namezFancyGetopt.get_attr_namel   s   € ð ×$Ñ$¤]Ó3Ð3r   c           
      óä   — t        |t        «      sJ ‚|j                  «       D ]K  \  }}|| j                  vrt	        d|›d|›d|›d�«      ‚|| j                  vsŒ8t	        d|›d|›d|›d�«      ‚ y )Nzinvalid z 'z': option 'z' not definedú': aliased option ')Ú
isinstanceÚdictÚitemsr   r   )r   ÚaliasesÚwhatr   Úopts        r   Ú_check_alias_dictzFancyGetopt._check_alias_dictr   s{   € Ü˜'¤4Ô(Ð(Ð(Ø!Ÿ-™-›/ò 
	‰JˆE�3Ø˜D×-Ñ-Ñ-Ý*âšU¢Eð+óð ð ˜$×+Ñ+Ò+Ý*âšU¢Cð)óð ñ
	r   c                 ó6   — | j                  |d«       || _        y)z'Set the aliases for this option parser.r   N)r7   r   )r   r   s     r   Úset_aliaseszFancyGetopt.set_aliases€   s   € à×Ñ˜u gÔ.Øˆ�
r   c                 ó6   — | j                  |d«       || _        y)zÚSet the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table.znegative aliasN)r7   r   )r   r   s     r   Úset_negative_aliasesz FancyGetopt.set_negative_aliases…   s   € ð
 	×Ñ˜~Ð/?Ô@Ø,ˆÕr   c                 óž  — g | _         g | _        | j                  j                  «        i | _        | j
                  D �]  }t        |«      dk(  r	|\  }}}d}n0t        |«      dk(  r|\  }}}}nt        dj                  |«      «      ‚t        |t        «      rt        |«      dk  rt        d|z  «      ‚|�,t        |t        «      rt        |«      dk(  st        d	|z  «      ‚|| j                  |<   | j                   j                  |«       |d
   dk(  r|r|dz   }|dd
 }d| j                  |<   n\| j                  j                  |«      }|�0| j                  |   rt        d|›d|›d�«      ‚|| j                   d
<   d| j                  |<   | j                   j                  |«      }|�1| j                  |   | j                  |   k7  rt        d|›d|›d�«      ‚t"        j%                  |«      st        d|z  «      ‚| j'                  |«      | j(                  |<   |s�Œâ| j                  j                  |«       || j                  |d   <   �Œ y)z�Populate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        é   r   é   zinvalid option tuple: {!r}é   z9invalid long option '%s': must be a string of length >= 2Nr   z:invalid short option '%s': must a single character or Noneéÿÿÿÿú=ú:zinvalid negative alias 'r0   z' takes a valuezinvalid alias 'z%': inconsistent with aliased option 'z/' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r   r   r   r   Úrepeatr   ÚlenÚ
ValueErrorÚformatr1   Ústrr   r"   r   r   Úgetr   Ú
longopt_reÚmatchr.   r   )r   r   ÚlongÚshortÚhelprC   Úalias_tos          r   Ú_grok_option_tablezFancyGetopt._grok_option_table�   s`  € ð
 ˆŒØˆŒØ�‰×ÑÔØˆŒà×'Ñ'ó F	1ˆFÜ�6‹{˜aÒØ$*Ñ!��e˜TØ‘Ü�V“ Ò!Ø,2Ñ)��e˜T¡6ô !Ð!=×!DÑ!DÀVÓ!LÓMÐMô ˜d¤CÔ(¬C°«I¸ªMÜ*ØSØñóð ð
 �]¬
°5¼#Ô(>Ä3ÀuÃ:ÐQRÂ?Ü*ð6Ø8=ñ>óð ð
 !'ˆD�K‰K˜ÑØ�N‰N×!Ñ! $Ô'à�B‰x˜3ŠÙØ! C™K�EØ˜A˜b�z�Ø'(�—‘˜tÒ$ð  ×.Ñ.×2Ñ2°4Ó8�ØÐ'Ø—~‘~ hÒ/Ý2âCGÊðSóð ð
 *.�D—N‘N 2Ñ&Ø'(�—‘˜tÑ$ð —z‘z—~‘~ dÓ+ˆHØÐ#Ø—>‘> $Ñ'¨4¯>©>¸(Ñ+CÒCÝ.ò 04²Xð?óð ô ×#Ñ# DÔ)Ü*ð>Ø@DñEóð ð
 $(×#5Ñ#5°dÓ#;ˆD�N‰N˜4Ñ ÛØ—‘×&Ñ& uÔ-Ø,0�—‘  a¡Ó)ñMF	1r   c                 óv  — |€t         j                  dd }|€t        «       }d}nd}| j                  «        dj	                  | j
                  «      }	 t        j                  ||| j                  «      \  }}|D �]  \  }}t        |«      dk(  r|d   dk(  r| j                  |d      }nt        |«      dkD  r|dd d	k(  sJ ‚|dd }| j                  j                  |«      }	|	r|	}| j                  |   s0|d
k(  sJ d«       ‚| j                  j                  |«      }	|	r|	}d}nd}| j                   |   }
|r+| j"                  j                  |
«      �t%        ||
d«      dz   }t'        ||
|«       | j(                  j+                  ||f«       �Œ |r||fS |S # t        j                  $ r}t        |«      ‚d}~ww xY w)a  Parse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr   TFú r?   r   r   z--Ú zboolean option can't have value)ÚsysÚargvÚOptionDummyrO   Újoinr   Úgetoptr   Úerrorr   rD   r   r   rH   r   r   r   rC   ÚgetattrÚsetattrr   r"   )r   ÚargsÚobjectÚcreated_objectr   ÚoptsÚmsgr6   Úvalr   Úattrs              r   rW   zFancyGetopt.getoptß   sÁ  € ð ˆ<Ü—8‘8˜A˜B�<ˆDØˆ>Ü “]ˆFØ!‰Nà"ˆNà×ÑÔ!à—X‘X˜dŸo™oÓ.ˆ
ð	)ÜŸ™ t¨Z¸¿¹ÓH‰JˆD�$ð ó 	1‰HˆC�Ü�3‹x˜1Š}  Q¡¨3¢Ø—o‘o c¨!¡fÑ-‘ä˜3“x !’|¨¨B¨Q¨°4ªÐ7Ð7Ø˜!˜"�g�à—J‘J—N‘N 3Ó'ˆEÙØ�à—>‘> #Ò&Ø˜b’yÐCÐ"CÓC�yØ×+Ñ+×/Ñ/°Ó4�ÙØ�CØ‘Cà�Cà—>‘> #Ñ&ˆDñ �t—{‘{—‘ tÓ,Ð8Ü˜f d¨AÓ.°Ñ2�Ü�F˜D #Ô&Ø×Ñ×$Ñ$ c¨3 ZÖ0ð5	1ñ: Ø˜�<ÐàˆKøôG �|‰|ò 	)Ü# CÓ(Ð(ûð	)ús   Á$F ÆF8Æ(F3Æ3F8c                 óH   — | j                   €t        d«      ‚| j                   S )z«Returns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        z!'getopt()' hasn't been called yet)r   ÚRuntimeError)r   s    r   Úget_option_orderzFancyGetopt.get_option_order  s(   € ð
 ×ÑÐ$ÜÐBÓCÐCà×$Ñ$Ð$r   c                 ób  — d}| j                   D ]3  }|d   }|d   }t        |«      }|d   dk(  r|dz
  }|�|dz   }||kD  sŒ2|}Œ5 |dz   dz   dz   }d}||z
  }	d	|z  }
|r|g}nd
g}| j                   D ]»  }|dd \  }}}t        ||	«      }|d   dk(  r|dd }|€4|r|j                  d|||d   fz  «       nZ|j                  d||fz  «       nCdj	                  ||«      }|r|j                  d|||d   fz  «       n|j                  d|z  «       |dd D ]  }|j                  |
|z   «       Œ Œ½ |S )zŒGenerate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        r   r   r@   rA   Né   r?   éN   rQ   zOption summary:r=   z  --%-*s  %sz
  --%-*s  z{} (-{})z  --%-*s)r   rD   Ú	wrap_textr"   rF   )r   ÚheaderÚmax_optr   rK   rL   ÚellÚ	opt_widthÚ
line_widthÚ
text_widthÚ
big_indentÚlinesrM   ÚtextÚ	opt_namess                  r   Úgenerate_helpzFancyGetopt.generate_help&  s�  € ð ˆØ×'Ñ'ò 		ˆFØ˜!‘9ˆDØ˜1‘IˆEÜ�d“)ˆCØ�B‰x˜3ŠØ˜A‘g�ØÐ Ø˜A‘g�Ø�W‹}Ø‘ð		ð ˜a‘K !‘O aÑ'ˆ	ð0 ˆ
Ø )Ñ+ˆ
Ø˜9‘_ˆ
ÙØ�H‰Eà&Ð'ˆEà×'Ñ'ò 	/ˆFØ & r¨ 
ÑˆD�%˜Ü˜T :Ó.ˆDØ�B‰x˜3ŠØ˜A˜b�z�ð ˆ}ÙØ—L‘L °7¸DÀ$ÀqÁ'Ð2JÑ!JÕKà—L‘L °¸$°Ñ!?Õ@ð
 '×-Ñ-¨d°EÓ:�	ÙØ—L‘L °7¸IÀtÈAÁwÐ2OÑ!OÕPà—L‘L ¨iÑ!7Ô8à˜A˜B�xò /�Ø—‘˜Z¨#Ñ-Õ.ñ/ð-	/ð0 ˆr   c                 ó|   — |€t         j                  }| j                  |«      D ]  }|j                  |dz   «       Œ y )Nú
)rS   Ústdoutrs   Úwrite)r   ri   ÚfileÚlines       r   Ú
print_helpzFancyGetopt.print_helpt  s:   € Øˆ<Ü—:‘:ˆDØ×&Ñ& vÓ.ò 	$ˆDØ�J‰J�t˜d‘{Õ#ñ	$r   r   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r    r&   r)   r.   r7   r9   r;   rO   rW   rd   rs   rz   © r   r   r	   r	       sS   „ ñ	ó&òP2ò
ó4ò0ò
4òòò
-òP1ód;òz%óLô\$r   r	   c                 ó^   — t        | «      }|j                  |«       |j                  ||«      S r   )r	   r;   rW   )ÚoptionsÚnegative_optr\   r[   Úparsers        r   Úfancy_getoptr„   {  s+   € Ü˜Ó!€FØ
×Ñ Ô-Ø�=‰=˜˜vÓ&Ð&r   rQ   c                 ó*  — | €g S t        | «      |k  r| gS | j                  «       } | j                  t        «      } t	        j
                  d| «      }|D �cg c]  }|sŒ|‘Œ	 }}g }|r§g }d}|rGt        |d   «      }||z   |k  r|j                  |d   «       |d= ||z   }n|r|d   d   dk(  r|d= n|rŒG|r5|dk(  r"|j                  |d   d| «       |d   |d |d<   |d   d   dk(  r|d= |j                  dj                  |«      «       |rŒ§|S c c}w )z¶wrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)r   r@   rQ   rR   )rD   Ú
expandtabsr,   ÚWS_TRANSÚreÚsplitr"   rV   )rq   ÚwidthÚchunksÚchrp   Úcur_lineÚcur_lenrk   s           r   rh   rh   „  sN  € ð €|Øˆ	Ü
ˆ4ƒy�EÒØˆvˆà�?‰?Ó€DØ�>‰>œ(Ó#€DÜ�X‰X�j $Ó'€FØ!Ö(�R¢RŠbÐ(€FÐ(Ø€Eá
ØˆØˆáÜ�f˜Q‘i“.ˆCØ˜‰} Ò%Ø—‘  q¡	Ô*Ø˜1�IØ! C™-‘ñ  ¨¡¨Q¡°3Ò 6Ø  ˜Øò ñ ð ˜!Š|Ø—‘  q¡	¨!¨EÐ 2Ô3Ø" 1™I e fÐ-��q‘	ð
 �a‰y˜‰|˜sÒ"Ø˜1�Ið 	�‰�R—W‘W˜XÓ&Ô'òA ðD €LùòK )s   ÁDÁDc                 ó,   — | j                  t        «      S )zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    r+   )r6   s    r   Útranslate_longoptr�   º  s   € ð �=‰=œÓ'Ð'r   c                   ó   — e Zd ZdZg fd„Zy)rU   z_Dummy class just used as a place to hold command-line option
    values as instance attributes.c                 ó,   — |D ]  }t        | |d«       Œ y)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rZ   )r   r�   r6   s      r   r   zOptionDummy.__init__Å  s   € ð ò 	%ˆCÜ�D˜#˜tÕ$ñ	%r   N)r{   r|   r}   r~   r   r   r   r   rU   rU   Á  s   „ ñ&ð  "ô %r   rU   Ú__main__z¢Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))é
   é   é   é(   z	width: %dru   )r~   rS   Ústringrˆ   rW   Úerrorsr   r   Úlongopt_patÚcompilerI   rF   Úneg_alias_rerG   Ú	maketransr-   r	   r„   Ú
whitespaceÚordr‡   rh   r�   rU   r{   rq   ÚwÚprintrV   )Ú_wschars   0r   ú<module>r£      s  ðñó Û Û 	Û ß ;ð +€ØˆR�Z‰Z˜ +Ñ-Ó.€
ð ˆr�z‰z˜.×/Ñ/°¸[ÓIÓJ€ð —‘˜c 3Ó'€÷X$ñ X$òv
'ð .4×->Ñ->Ö? '‰C�‹L˜#ÑÒ?€ò3òl(÷%ñ %ð ˆzÒð €Dð ò ˆÙˆk˜A‰oÔÙˆd�i‰i™	 $¨Ó*Ó+Ô,Ù�ñð ùòW @s   ÂC$