Your IP : 18.217.241.235
�
��f� c @ s} d Z d d l m Z d d l m Z m Z m Z m Z d d l m Z m
Z
m Z d d � Z Gd d � d e j
� Z d
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 ( u dirnameu joinu existsu sep( u
FromImportu symsu tokenc c s� | g } x� | r� | j � } | j t j k r; | j Vq | j t j k rn d j d d � | j D� � Vq | j t j k r� | j
| j d � q | j t j k r� | j | j d d d � � q t
d � � q Wd S( uF
Walks over all the names imported in a dotted_as_names node.
u c S s g | ] } | j � q S( ( u value( u .0u ch( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu
<listcomp> s u$ traverse_imports.<locals>.<listcomp>i Ni u unknown node typei����( u popu typeu tokenu NAMEu valueu symsu dotted_nameu joinu childrenu dotted_as_nameu appendu dotted_as_namesu extendu AssertionError( u namesu pendingu node( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu traverse_imports s ! u traverse_importsc sJ | Ee Z d Z d Z d Z � f d d � Z d d � Z d d � Z � S( u FixImportuj
import_from< 'from' imp=any 'import' ['('] any [')'] >
|
import_name< 'import' imp=any >
c s/ t t | � j | | � d | j k | _ d S( Nu absolute_import( u superu FixImportu
start_treeu future_featuresu skip( u selfu treeu name( u __class__( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu
start_tree/ s u FixImport.start_treec C s | j r
d S| d } | j t j k r~ x t | d � sK | j d } q, W| j | j � rd | j | _ | j � qn� d } d } x2 t
| � D]$ } | j | � r� d } q� d } q� W| r� | r� | j | d � n d St
d | g � } | j | _ | Sd S( Nu impu valuei u .u# absolute and local imports togetherFT( u skipu typeu symsu import_fromu hasattru childrenu probably_a_local_importu valueu changedu Falseu traverse_importsu Trueu warningu
FromImportu prefix( u selfu nodeu resultsu impu
have_localu
have_absoluteu mod_nameu new( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu transform3 s,
u FixImport.transformc C s� | j d � r d
S| j d d � d } t | j � } t | | � } t t t | � d � � sf d
Sx4 d t d d d d g D] } t | | � r d Sq Wd
S( Nu .i i u __init__.pyu .pyu .pycu .sou .slu .pydFT( u
startswithu Falseu splitu dirnameu filenameu joinu existsu sepu True( u selfu imp_nameu base_pathu ext( ( u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu probably_a_local_importU s u! FixImport.probably_a_local_importT( u __name__u
__module__u __qualname__u Trueu
BM_compatibleu PATTERNu
start_treeu transformu probably_a_local_import( u
__locals__( ( u __class__u= /opt/alt/python33/lib64/python3.3/lib2to3/fixes/fix_import.pyu FixImport&