Edit File: fancy_getopt.cpython-37.opt-2.pyc
B ����0��cxE������������������@���s����d�dl�Z�d�dlZd�dlZd�dlZd�dlT�dZe�de��Ze�deef��Ze � dd�ZG�dd ��d �Zd d��Z dd ��ejD��Zdd��Zdd��ZG�dd��d�Zedkr�dZx2dD�]*Zede���ed�eee����e���q�W�dS�)�����N)�*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$�-�_c���������������@���s����e�Zd�Zddd�Zdd��Zdd��Zddd �Zd d��Zdd ��Zdd��Z dd��Z dd��Zdd��Zd dd�Z dd��Zd!dd�Zd"dd�ZdS�)#�FancyGetoptNc�������������C���sN���||�_�i�|�_|�j�r|�����i�|�_i�|�_g�|�_g�|�_i�|�_i�|�_i�|�_ g�|�_ d�S�)N)�option_table�option_index�_build_index�alias�negative_alias� short_opts� long_opts� short2long� attr_name� takes_arg�option_order)�selfr�����r����;/opt/alt/python37/lib64/python3.7/distutils/fancy_getopt.py�__init__)���s���� zFancyGetopt.__init__c�������������C���s,���|�j�����x|�jD�]}||�j�|d�<�qW�d�S�)Nr���)r����clearr���)r����optionr���r���r���r���Q���s���� zFancyGetopt._build_indexc�������������C���s���||�_�|�����d�S�)N)r���r���)r���r���r���r���r����set_option_tableV���s����zFancyGetopt.set_option_tablec�������������C���s<���||�j�krtd|���n |||f}|�j�|��||�j�|<�d�S�)Nz'option conflict: already an option '%s')r����DistutilsGetoptErrorr����append)r����long_optionZshort_optionZhelp_stringr���r���r���r���� add_optionZ���s���� zFancyGetopt.add_optionc�������������C���s ���||�j�kS�)N)r���)r���r���r���r���r���� has_optionc���s����zFancyGetopt.has_optionc�������������C���s ���|��t�S�)N)� translate� longopt_xlate)r���r���r���r���r���� get_attr_nameh���s����zFancyGetopt.get_attr_namec�������������C���sR���xL|����D�]@\}}||�jkr.td|||f���||�jkr td|||f���q W�d�S�)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)�itemsr���r���)r����aliasesZwhatr ����optr���r���r����_check_alias_dictn���s���� zFancyGetopt._check_alias_dictc�������������C���s���|���|d��||�_d�S�)Nr ���)r#���r ���)r���r ���r���r���r����set_aliasesx���s����zFancyGetopt.set_aliasesc�������������C���s���|���|d��||�_d�S�)Nznegative alias)r#���r ���)r���r ���r���r���r����set_negative_aliases}���s����z FancyGetopt.set_negative_aliasesc�������������C���s���g�|�_�g�|�_|�j����i�|�_�x�|�jD��]�}t|�dkrH|\}}}d}n(t|�dkrb|\}}}}ntd|f���t|t �r�t|�dk�r�t d|���|d�ks�t|t �r�t|�dks�t d|���||�j|<�|�j��|��|d �d k�r|r�|d�}|dd ��}d|�j|<�nF|�j �|�}|d�k �r@|�j|��r6t d||f���||�j�d <�d|�j|<�|�j�|�}|d�k �r�|�j|�|�j|�k�r�t d ||f���t�|��s�t d|���|��|�|�j|<�|r&|�j�|��||�j|d�<�q&W�d�S�)N����r�������zinvalid option tuple: %r����z9invalid long option '%s': must be a string of length >= 2����z:invalid short option '%s': must a single character or None����=�:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (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� isinstance�strr���r���r���r ����getr ���� longopt_re�matchr���r���)r���r����long�short�helpr-���Zalias_tor���r���r����_grok_option_table����s^���� � zFancyGetopt._grok_option_tablec���������� ���C���sr��|d�krt�jdd���}|d�kr*t��}d}nd}|�����d�|�j�}yt�|||�j�\}}W�n,�tjk r��}�zt |��W�d�d�}~X�Y�nX�x�|D�]�\}}t |�dkr�|d�dkr�|�j|d��}n|dd���}|�j� |�} | r�| }|�j|��s |�j� |�} | �r| }d}nd}|�j|�} |�r<|�j� | �d�k �r<t|| d�d�}t|| |��|�j�||f��q�W�|�rj||fS�|S�d�S�)Nr)���TF� r(���r���r���)�sys�argv�OptionDummyr8����joinr����getoptr����errorZDistutilsArgErrorr.���r ���r ���r2���r���r ���r���r-����getattr�setattrr���r���)r����args�objectZcreated_objectr���Zopts�msgr"����valr ����attrr���r���r���r>�������sB���� zFancyGetopt.getoptc�������������C���s���|�j�d�krtd��n|�j�S�d�S�)Nz!'getopt()' hasn't been called yet)r����RuntimeError)r���r���r���r����get_option_order��s���� zFancyGetopt.get_option_orderc�������������C���sv��d}xV|�j�D�]L}|d�}|d�}t|�}|d�dkr<|d�}|d�k rL|d�}||kr|}qW�|d�d�d�}d}||�} d|�} |r�|g}nd g}x�|�j�D�]�}|d�d ��\}}}t|| �} |d�dkr�|dd��}|d�k�r| r�|�d||| d�f���n|�d||f���n:d ||f�}| �r:|�d||| d�f���n|�d|���x$| dd���D�]}|�| |����qVW�q�W�|S�)Nr���r)���r*���r+�������r(����N���r9���zOption summary:r&���z --%-*s %sz --%-*s z%s (-%s)z --%-*s)r���r.���� wrap_textr���)r����headerZmax_optr���r5���r6����lZ opt_widthZ line_width� text_widthZ big_indent�linesr7����textZ opt_namesr���r���r���� generate_help��sF���� zFancyGetopt.generate_helpc�������������C���s4���|d�krt�j}x |��|�D�]}|�|d���qW�d�S�)N� )r:����stdoutrQ����write)r���rL����file�liner���r���r���� print_helph��s����zFancyGetopt.print_help)N)NN)NN)N)NN)�__name__� __module__�__qualname__r���r���r���r���r���r���r#���r$���r%���r8���r>���rH���rQ���rW���r���r���r���r���r������s��� ( M = Or���c�������������C���s���t�|��}|�|��|�||�S�)N)r���r%���r>���)�optionsZnegative_optrC���rB����parserr���r���r����fancy_getopto��s���� r]���c�������������C���s���i�|�]}d�t�|��qS�)r9���)�ord)�.0Z_wscharr���r���r���� <dictcomp>u��s����r`���c�������������C���s"��|�d�krg�S�t�|��|kr|�gS�|����}�|��t�}�t�d|��}dd��|D��}g�}x�|�rg�}d}xZ|r�t�|d��}||�|kr�|�|d���|d=�||�}q`|r�|d�d�dkr�|d=�P�q`W�|�r |dkr�|�|d�d|����|d�|d���|d<�|d�d�dk�r |d=�|�d�|���qPW�|S�)Nz( +|-+)c�������������S���s���g�|�]}|r|�qS�r���r���)r_���Zchr���r���r���� <listcomp>���s����zwrap_text.<locals>.<listcomp>r���r*���r9�����)r.���� expandtabsr����WS_TRANS�re�splitr���r=���)rP����widthZchunksrO���Zcur_lineZcur_lenrM���r���r���r���rK���w��s:���� rK���c�������������C���s ���|���t�S�)N)r���r���)r"���r���r���r����translate_longopt���s����rh���c���������������@���s���e�Zd�Zg�fdd�ZdS�)r<���c�������������C���s���x|D�]}t�|�|d���qW�d�S�)N)rA���)r���r[���r"���r���r���r���r������s���� zOptionDummy.__init__N)rX���rY���rZ���r���r���r���r���r���r<������s���r<����__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: %drR���)r:����stringre���r>���Zdistutils.errorsZlongopt_pat�compiler3���Zneg_alias_rer1���� maketransr���r���r]���Z whitespacerd���rK���rh���r<���rX���rP����w�printr=���r���r���r���r����<module>���s(�����T6