Your IP : 18.217.241.235


Current Path : /opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/lib2to3/fixes/__pycache__/fix_import.cpython-33.pyc

�
��f�c@s}dZddlmZddlmZmZmZmZddlm	Z	m
Z
mZdd�ZGdd	�d	ej
�Zd
S(u�Fixer for import statements.
If spam is being imported from the local directory, this import:
    from spam import eggs
Becomes:
    from .spam import eggs

And this import:
    import spam
Becomes:
    from . import spam
i(u
fixer_basei(udirnameujoinuexistsusep(u
FromImportusymsutokenccs�|g}x�|r�|j�}|jtjkr;|jVq|jtjkrndjdd�|jD��Vq|jtj	kr�|j
|jd�q|jtjkr�|j|jddd��qt
d��qWdS(	uF
    Walks over all the names imported in a dotted_as_names node.
    ucSsg|]}|j�qS((uvalue(u.0uch((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu
<listcomp>s	u$traverse_imports.<locals>.<listcomp>iNiuunknown node typei����(upoputypeutokenuNAMEuvalueusymsudotted_nameujoinuchildrenudotted_as_nameuappendudotted_as_namesuextenduAssertionError(unamesupendingunode((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyutraverse_importss		! utraverse_importscsJ|EeZdZdZdZ�fdd�Zdd�Zdd�Z�S(	u	FixImportuj
    import_from< 'from' imp=any 'import' ['('] any [')'] >
    |
    import_name< 'import' imp=any >
    cs/tt|�j||�d|jk|_dS(Nuabsolute_import(usuperu	FixImportu
start_treeufuture_featuresuskip(uselfutreeuname(u	__class__(u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu
start_tree/suFixImport.start_treecCs|jr
dS|d}|jtjkr~x t|d�sK|jd}q,W|j|j�rd|j|_|j�qn�d}d}x2t
|�D]$}|j|�r�d}q�d}q�W|r�|r�|j|d�ndSt
d|g�}|j|_|SdS(Nuimpuvalueiu.u#absolute and local imports togetherFT(uskiputypeusymsuimport_fromuhasattruchildrenuprobably_a_local_importuvalueuchangeduFalseutraverse_importsuTrueuwarningu
FromImportuprefix(uselfunodeuresultsuimpu
have_localu
have_absoluteumod_nameunew((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu	transform3s,	
	
uFixImport.transformcCs�|jd�rd
S|jdd�d}t|j�}t||�}ttt|�d��sfd
Sx4dtdddd	gD]}t||�rdSqWd
S(Nu.iiu__init__.pyu.pyu.pycu.sou.slu.pydFT(	u
startswithuFalseusplitudirnameufilenameujoinuexistsusepuTrue(uselfuimp_nameu	base_pathuext((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyuprobably_a_local_importUsu!FixImport.probably_a_local_importT(	u__name__u
__module__u__qualname__uTrueu
BM_compatibleuPATTERNu
start_treeu	transformuprobably_a_local_import(u
__locals__((u	__class__u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu	FixImport&s
"u	FixImportN(u__doc__uu
fixer_baseuos.pathudirnameujoinuexistsusepu
fixer_utilu
FromImportusymsutokenutraverse_importsuBaseFixu	FixImport(((u=/opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu<module>s
"

?>