| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/lib2to3/fixes/ |
Upload File : |
ó
|_c @ sz 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 Z d e j
f d YZ d S(
sŢ 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 ( t
fixer_basei˙˙˙˙( t dirnamet joint existst sep( t
FromImportt symst tokenc c sć | g } xÖ | rá | j } | j t j k r; | j Vq | j t j k rw d j g | j D] } | j ^ q] 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( sF
Walks over all the names imported in a dotted_as_names node.
t i Niţ˙˙˙s unkown node type( t popt typeR t NAMEt valueR t dotted_nameR t childrent dotted_as_namet appendt dotted_as_namest extendt AssertionError( t namest pendingt nodet ch( ( s. /usr/lib/python2.7/lib2to3/fixes/fix_import.pyt traverse_imports s * t FixImportc B s/ e Z e Z d Z d Z d Z d Z RS( sj
import_from< 'from' imp=any 'import' ['('] any [')'] >
|
import_name< 'import' imp=any >
c C s/ t t | j | | d | j k | _ d S( Nt absolute_import( t superR t
start_treet future_featurest skip( t selft treet name( ( s. /usr/lib/python2.7/lib2to3/fixes/fix_import.pyR / s c 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 t } t } x2 t
| D]$ } | j | rľ t } q t } q W| râ | rŢ | j | d n d St
d | g } | j | _ | Sd S( Nt impR i u .s# absolute and local imports together( R R
R t import_fromt hasattrR t probably_a_local_importR t changedt FalseR t Truet warningR t prefix( R R t resultsR"