
    daf4                     T   d Z ddlmZ ddlmZmZ i 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"i d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdDdEdFdGdHdIdJdJdJdKdLdLdMdNdOZdP ZefdQZ G dR dSej                        Z
yT)Uz/Fix incompatible imports and module references.   )
fixer_base)Name
attr_chainStringIOio	cStringIOcPicklepickle__builtin__builtinscopy_regcopyregQueuequeueSocketServersocketserverConfigParserconfigparserreprreprlib
FileDialogztkinter.filedialogtkFileDialogSimpleDialogztkinter.simpledialogtkSimpleDialogtkColorChooserztkinter.colorchoosertkCommonDialogztkinter.commondialogDialogztkinter.dialogTkdndztkinter.dndtkFontztkinter.fonttkMessageBoxztkinter.messageboxScrolledTextztkinter.scrolledtextTkconstantsztkinter.constantsTixztkinter.tixttkztkinter.ttkTkintertkinter
markupbase_markupbase_winregwinregthread_threaddummy_thread_dummy_threaddbhashzdbm.bsddumbdbmzdbm.dumbdbmzdbm.ndbmgdbmzdbm.gnu	xmlrpclibzxmlrpc.clientDocXMLRPCServerzxmlrpc.serverzhttp.clientzhtml.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.server
subprocesscollectionszurllib.parsezurllib.robotparser)SimpleXMLRPCServerhttplibhtmlentitydefs
HTMLParserCookie	cookielibBaseHTTPServerSimpleHTTPServerCGIHTTPServercommands
UserStringUserListurlparserobotparserc                 L    ddj                  t        t        |             z   dz   S )N(|))joinmapr   )memberss    4/root/Python-3.12.4/Lib/lib2to3/fixes/fix_imports.py
alternatesrM   =   s"    #dG,--33    c              #      K   dj                  | D cg c]  }d|z  	 c}      }t        | j                               }d|d|d d|z   d|d|d	 d
|z   y c c}w w)Nz | zmodule_name='%s'z$name_import=import_name< 'import' ((z;) |
               multiple_imports=dotted_as_names< any* (z) any* >) >
          zimport_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z(import_name< 'import' (dotted_as_name< (zg) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (z!) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rI   rM   keys)mappingkeymod_list
bare_namess       rL   build_patternrU   A   s     zzwG-3GHHGLLN+J 8% %   8% % @*
LL! Hs   A(A#A
A(c                   N     e Zd ZdZdZeZdZd Z fdZ	 fdZ
 fdZd Z xZS )
FixImportsT   c                 J    dj                  t        | j                              S )NrG   )rI   rU   rQ   )selfs    rL   rU   zFixImports.build_pattern`   s    xxdll344rN   c                 T    | j                         | _        t        t        |           y N)rU   PATTERNsuperrW   compile_pattern)rZ   	__class__s    rL   r_   zFixImports.compile_patternc   s"     ))+j$/1rN   c                     t         t        | 
   |      }|r%d|vrt        fdt	        |d      D              ry|S y)Nbare_with_attrc              3   .   K   | ]  } |        y wr\    ).0objmatchs     rL   	<genexpr>z#FixImports.match.<locals>.<genexpr>q   s     Isc
Is   parentF)r^   rW   rg   anyr   )rZ   noderesultsrg   r`   s      @rL   rg   zFixImports.matchj   sE    j$-+  w.Ijx.HIINrN   c                 <    t         t        |   ||       i | _        y r\   )r^   rW   
start_treereplace)rZ   treefilenamer`   s      rL   rn   zFixImports.start_treev   s    j$*4:rN   c                    |j                  d      }|r|j                  }| j                  |   }|j                  t	        ||j
                               d|v r|| j                  |<   d|v r'| j                  |      }|r| j                  ||       y y y |d   d   }| j                  j                  |j                        }|r'|j                  t	        ||j
                               y y )Nmodule_name)prefixname_importmultiple_importsrb       )getvaluerQ   ro   r   rt   rg   	transform)rZ   rk   rl   
import_modmod_namenew_name	bare_names          rL   rz   zFixImports.transformz   s    [[/
!''H||H-HtHZ5F5FGH' *2X&!W,
 **T*NN41  -   01!4I||''	8H!!$x	8H8H"IJ rN   )__name__
__module____qualname__BM_compatiblekeep_line_orderMAPPINGrQ   	run_orderrU   r_   rg   rn   rz   __classcell__)r`   s   @rL   rW   rW   U   s3    MOG I52
KrN   rW   N)__doc__ r   
fixer_utilr   r   r   rM   rU   BaseFixrW   rd   rN   rL   <module>r      s   5  )2: 22h2 :2 y	2
 G2 >2 >2 92 -2 /2 12 32 32 32 %2  M!2" ^#2$ /%2& 1'2( -)2* -+2, --2. i/20 122 h324 Y526 ?72: Y;2< j=2> *?2@ 9A2B C2D oE2F "1#-'#(*,)#'%&/c2j4 " M(<K## <KrN   