ó
è¾bc           @   s´  d  Z  d d l m Z d d l m Z m Z i0 d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d  6d! d" 6d# d$ 6d% d& 6d' d( 6d) d* 6d+ d, 6d- d. 6d/ d0 6d1 d2 6d3 d4 6d5 d6 6d7 d8 6d9 d: 6d; d< 6d= d> 6d? d@ 6dA dB 6dC dD 6dC dE 6dF dG 6dH dI 6dJ dK 6dL dM 6dN dO 6dP dQ 6dP dR 6dP dS 6dT dU 6dV dW 6dV dX 6dY dZ 6d[ d\ 6Z d] „  Z e d^ „ Z d_ e j	 f d` „  ƒ  YZ
 da S(b   s/   Fix incompatible imports and module references.i   (   t
   fixer_base(   t   Namet
   attr_chaint   iot   StringIOt	   cStringIOt   picklet   cPicklet   builtinst   __builtin__t   copyregt   copy_regt   queuet   Queuet   socketservert   SocketServert   configparsert   ConfigParsert   reprlibt   reprs   tkinter.filedialogt
   FileDialogt   tkFileDialogs   tkinter.simpledialogt   SimpleDialogt   tkSimpleDialogs   tkinter.colorchoosert   tkColorChoosers   tkinter.commondialogt   tkCommonDialogs   tkinter.dialogt   Dialogs   tkinter.dndt   Tkdnds   tkinter.fontt   tkFonts   tkinter.messageboxt   tkMessageBoxs   tkinter.scrolledtextt   ScrolledTexts   tkinter.constantst   Tkconstantss   tkinter.tixt   Tixs   tkinter.ttkt   ttkt   tkintert   Tkintert   _markupbaset
   markupbaset   winregt   _winregt   _threadt   threadt   _dummy_threadt   dummy_threads   dbm.bsdt   dbhashs   dbm.dumbt   dumbdbms   dbm.ndbmt   dbms   dbm.gnut   gdbms   xmlrpc.clientt	   xmlrpclibs   xmlrpc.servert   DocXMLRPCServert   SimpleXMLRPCServers   http.clientt   httplibs   html.entitiest   htmlentitydefss   html.parsert
   HTMLParsers   http.cookiest   Cookies   http.cookiejart	   cookielibs   http.servert   BaseHTTPServert   SimpleHTTPServert   CGIHTTPServert
   subprocesst   commandst   collectionst
   UserStringt   UserLists   urllib.parset   urlparses   urllib.robotparsert   robotparserc         C   s   d d j  t t |  ƒ ƒ d S(   Nt   (t   |t   )(   t   joint   mapR   (   t   members(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyt
   alternates=   s    c         c   sl   d j  g  |  D] } d | ^ q ƒ } t |  j ƒ  ƒ } d | | f Vd | Vd | | f Vd | Vd  S(   Ns    | s   module_name='%s'sy   name_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          s›   import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          s´   import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          s3   power< bare_with_attr=(%s) trailer<'.' any > any* >(   RE   RH   t   keys(   t   mappingt   keyt   mod_listt
   bare_names(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyt   build_patternA   s    &	t
   FixImportsc           B   sM   e  Z e Z e Z e Z d  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z RS(   i   c         C   s   d j  t |  j ƒ ƒ S(   NRC   (   RE   RN   RJ   (   t   self(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyRN   `   s    c         C   s&   |  j  ƒ  |  _ t t |  ƒ j ƒ  d  S(   N(   RN   t   PATTERNt   superRO   t   compile_pattern(   RP   (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyRS   c   s    c            sa   t  t |  ƒ j ‰  ˆ  | ƒ } | r] d | k rY t ‡  f d †  t | d ƒ Dƒ ƒ rY t S| St S(   Nt   bare_with_attrc         3   s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   t   .0t   obj(   t   match(    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pys	   <genexpr>q   s    t   parent(   RR   RO   RW   t   anyR   t   False(   RP   t   nodet   results(    (   RW   s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyRW   j   s    %c         C   s&   t  t |  ƒ j | | ƒ i  |  _ d  S(   N(   RR   RO   t
   start_treet   replace(   RP   t   treet   filename(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyR]   v   s    c         C   sï   | j  d ƒ } | r£ | j } t |  j | ƒ } | j t | d | j ƒƒ d | k ri | |  j | <n  d | k rë |  j | ƒ } | r  |  j | | ƒ q  që nH | d d } |  j j  | j ƒ } | rë | j t | d | j ƒƒ n  d  S(   Nt   module_namet   prefixt   name_importt   multiple_importsRT   i    (	   t   gett   valuet   unicodeRJ   R^   R   Rb   RW   t	   transform(   RP   R[   R\   t
   import_modt   mod_namet   new_namet	   bare_name(    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyRh   z   s    	(   t   __name__t
   __module__t   Truet   BM_compatiblet   keep_line_ordert   MAPPINGRJ   t	   run_orderRN   RS   RW   R]   Rh   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyRO   U   s   				N(   t   __doc__t    R    t
   fixer_utilR   R   Rr   RH   RN   t   BaseFixRO   (    (    (    s/   /usr/lib/python2.7/lib2to3/fixes/fix_imports.pyt   <module>   sj   

	