Viewing File: /opt/alt/python35/lib64/python3.5/lib2to3/fixes/__pycache__/fix_renames.cpython-35.opt-2.pyc
й¼] ã @ ss d d l m Z d d l m Z m Z d d d i i Z i Z d d „ Z d d „ Z Gd
d „ d e j ƒ Z
d S)
é )Ú
fixer_base)ÚNameÚ
attr_chainÚsysZmaxintÚmaxsizec C s d d j t t | ƒ ƒ d S)Nú(ú|ú))ÚjoinÚmapÚrepr)Úmembers© r ú0/opt/alt/python35/lib64/python3.5/fix_renames.pyÚ
alternates s r c c s{ xt t t j ƒ ƒ D]` \ } } xQ t | j ƒ ƒ D]= \ } } | t | | f <d | | | f Vd | | f Vq2 Wq Wd S)Nz£
import_from< 'from' module_name=%r 'import'
( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
z^
power< module_name=%r trailer< '.' attr_name=%r > any* >
)ÚlistÚMAPPINGÚitemsÚLOOKUP)ÚmoduleÚreplaceZold_attrÚnew_attrr r r Ú
build_pattern s
r c sL e Z d Z d Z d j e ƒ ƒ Z d Z ‡ f d d † Z d d „ Z ‡ S)Ú
FixRenamesTr Úprec sX t t | ƒ j ‰ ˆ | ƒ } | rT t ‡ f d d † t | d ƒ Dƒ ƒ rP d S| Sd S)Nc 3 s | ] } ˆ | ƒ Vq d S)Nr )Ú.0Úobj)Úmatchr r ú <genexpr>5 s z#FixRenames.match.<locals>.<genexpr>ÚparentF)Úsuperr r Úanyr )ÚselfÚnodeÚresults)Ú __class__)r r r 1 s (zFixRenames.matchc C s` | j d ƒ } | j d ƒ } | r\ | r\ t | j | j f } | j t | d | j ƒƒ d S)NÚmodule_nameÚ attr_nameÚprefix)Úgetr Úvaluer r r( )r"