o
    0ÿ¿cP  ã                   @   sp  d Z ddlmZ ddlmZmZmZmZ ddlm	Z
 ddlmZ ddlmZmZ ddl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/“d0d1“d2d3“d4d5“d6d7“d8d9“d:d;“d<d=“d>d?“d@dA“dBdC“dDdE“dFdG“dHdI“¥ZdJZdKZdLZdMZdNZdOZdPZdQZdRZdSZdTdU„ ZG dVdW„ dWejƒZdXS )Yz8
Fixer for standard library imports renamed in Python 3
é    )Ú
fixer_base)ÚNameÚis_probably_builtinÚNewlineÚdoes_tree_import)Úpython_symbols)Útoken)ÚNodeÚLeaf©Útouch_import_topÚreprlibÚreprÚwinregÚ_winregÚconfigparserÚConfigParserÚcopyregZcopy_regÚqueueÚQueueÚsocketserverZSocketServerÚ_markupbaseZ
markupbaseztest.supportztest.test_supportzdbm.bsdZdbhashzdbm.ndbmZdbmzdbm.dumbZdumbdbmzdbm.gnuZgdbmzhtml.parserZ
HTMLParserzhtml.entitiesZhtmlentitydefszhttp.clientZhttplibzhttp.cookiesZCookiezhttp.cookiejarZ	cookielibztkinter.dialogZDialogztkinter._fixZFixTkztkinter.scrolledtextZScrolledTextztkinter.tixZTixztkinter.constantsZTkconstantsztkinter.dndZTkdndztkinter.__init__ZTkinterztkinter.colorchooserZtkColorChooserztkinter.commondialogZtkCommonDialogztkinter.fontZtkFontztkinter.ttkZttkztkinter.messageboxZtkMessageBoxztkinter.turtleZturtlezurllib.robotparserZrobotparserzxmlrpc.clientZ	xmlrpclibÚbuiltinsZ__builtin__z	name='%s'z	attr='%s'z$dotted_name=dotted_name< %s '.' %s >z%sz"power< %s trailer< '.' %s > any* >zpower< %s any* >z:from_import=import_from< 'from' %s 'import' imported=any >z®from_import_submod=import_from< 'from' %s 'import' (%s | import_as_name< %s 'as' renamed=any > | import_as_names< any* (%s | import_as_name< %s 'as' renamed=any >) any* > ) >zrname_import=import_name< 'import' %s > | name_import=import_name< 'import' dotted_as_name< %s 'as' renamed=any > >zAname_import=import_name< 'import' dotted_as_names< names=any* > >c           
      C   s¶   d| v rA|   dd¡\} }t|  }t| }t||f }t| }t|||||f }t||f }t||f }t| }	d 	|||||	f¡S t|  }t||f }t| }t
| }d 	|||f¡S )z«
    Accepts a string and returns a pattern of possible patterns involving that name
    Called by simple_mapping_to_pattern for each name in the mapping it receives.
    Ú.é   ú | 
)ÚsplitÚsimple_name_matchÚsubname_matchÚdotted_name_matchÚfrom_import_matchÚfrom_import_submod_matchÚname_import_matchÚpower_twoname_matchÚpower_subname_matchÚjoinÚpower_onename_match)
ÚnameÚattrZsimple_nameZsimple_attrZdotted_nameZi_fromZi_from_submodZi_nameZu_nameZ	u_subname© r)   úOD:\Projects\ConvertPro\env\Lib\site-packages\libpasteurize\fixes\fix_imports.pyÚall_patternsO   s    r+   c                   @   s6   e Zd Zd dd„ eD ƒ¡Zd eef¡Zdd„ ZdS )Ú
FixImportsr   c                 C   s   g | ]}t |ƒ‘qS r)   )r+   )Ú.0r'   r)   r)   r*   Ú
<listcomp>l   s    zFixImports.<listcomp>c                 C   s   t dd|ƒ d S )NÚfutureZstandard_libraryr   )ÚselfÚnodeÚresultsr)   r)   r*   Ú	transformo   s   zFixImports.transformN)Ú__name__Ú
__module__Ú__qualname__r%   ÚMAPPINGZPATTERNÚmultiple_name_import_matchr3   r)   r)   r)   r*   r,   j   s    r,   N) Ú__doc__Zlib2to3r   Zlib2to3.fixer_utilr   r   r   r   Zlib2to3.pygramr   ZsymsZlib2to3.pgen2r   Zlib2to3.pytreer	   r
   Zlibfuturize.fixer_utilr   r7   r   r   r   r&   r#   r$   r    r!   r"   r8   r+   ZBaseFixr,   r)   r)   r)   r*   Ú<module>   s¨    ÿþýüûúùø	÷
öõôóòñðîíìëêéèçæåäãâá à!ß,