
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,a4  ã                1   @   s°   d Z ddlmZ ddlmZmZ ddddddd	d
dddddddddddddddddddddddd d!d"d"d#d$d%d&d'd(d(d(d)d*d*d+d,d-œ0Zd.d/„ Zefd0d1„ZG d2d3„ d3ej	ƒZ
d4S )5z/Fix incompatible imports and module references.é   )Ú
fixer_base)ÚNameÚ
attr_chainÚioÚpickleÚbuiltinsÚcopyregZqueueZsocketserverZconfigparserÚreprlibztkinter.filedialogztkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbaseÚwinregÚ_threadZ_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuzxmlrpc.clientzxmlrpc.serverzhttp.clientzhtml.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.serverÚ
subprocessÚcollectionszurllib.parsezurllib.robotparser)0ÚStringIOZ	cStringIOZcPickleZ__builtin__Zcopy_regZQueueZSocketServerZConfigParserÚreprZ
FileDialogZtkFileDialogZSimpleDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbaseÚ_winregÚthreadZdummy_threadZdbhashZdumbdbmZdbmZgdbmZ	xmlrpclibZDocXMLRPCServerZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerZSimpleHTTPServerZCGIHTTPServerZcommandsÚ
UserStringÚUserListZurlparseZrobotparserc                 C   s   dd  tt| ƒ¡ d S )Nú(ú|ú))ÚjoinÚmapr   )Úmembers© r   ú>/opt/alt/python38/lib64/python3.8/lib2to3/fixes/fix_imports.pyÚ
alternates=   s    r   c                 c   sT   d  dd„ | D ƒ¡}t|  ¡ ƒ}d||f V  d| V  d||f V  d| V  d S )Nz | c                 S   s   g | ]}d | ‘qS )zmodule_name='%s'r   )Ú.0Úkeyr   r   r   Ú
<listcomp>B   s     z!build_pattern.<locals>.<listcomp>zyname_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          z›import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z´import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)r   r   Úkeys)ÚmappingZmod_listZ
bare_namesr   r   r   Úbuild_patternA   s    þýýr"   c                       sT   e Zd ZdZdZeZdZdd„ Z‡ fdd„Z	‡ fdd„Z
‡ fd	d
„Zdd„ Z‡  ZS )Ú
FixImportsTé   c                 C   s   d  t| jƒ¡S )Nr   )r   r"   r!   ©Úselfr   r   r   r"   `   s    zFixImports.build_patternc                    s   |   ¡ | _tt| ƒ ¡  d S ©N)r"   ZPATTERNÚsuperr#   Úcompile_patternr%   ©Ú	__class__r   r   r)   c   s    
zFixImports.compile_patternc                    sH   t t| ƒj‰ ˆ |ƒ}|rDd|kr@t‡ fdd„t|dƒD ƒƒr@dS |S dS )NÚbare_with_attrc                 3   s   | ]}ˆ |ƒV  qd S r'   r   )r   Úobj©Úmatchr   r   Ú	<genexpr>q   s     z#FixImports.match.<locals>.<genexpr>ÚparentF)r(   r#   r/   Úanyr   )r&   ÚnodeÚresultsr*   r.   r   r/   j   s    ÿzFixImports.matchc                    s   t t| ƒ ||¡ i | _d S r'   )r(   r#   Ú
start_treeÚreplace)r&   ZtreeÚfilenamer*   r   r   r5   v   s    zFixImports.start_treec                 C   sž   |  d¡}|rh|j}| j| }| t||jd�¡ d|krD|| j|< d|krš|  |¡}|rš|  ||¡ n2|d d }| j  |j¡}|rš| t||jd�¡ d S )NZmodule_name)ÚprefixZname_importZmultiple_importsr,   é    )ÚgetÚvaluer!   r6   r   r8   r/   Ú	transform)r&   r3   r4   Z
import_modZmod_nameÚnew_nameZ	bare_namer   r   r   r<   z   s    



zFixImports.transform)Ú__name__Ú
__module__Ú__qualname__ZBM_compatibleZkeep_line_orderÚMAPPINGr!   Z	run_orderr"   r)   r/   r5   r<   Ú__classcell__r   r   r*   r   r#   U   s   r#   N)Ú__doc__Ú r   Z
fixer_utilr   r   rA   r   r"   ZBaseFixr#   r   r   r   r   Ú<module>   sl   Ï5