
'![c           @   s  d  Z  d d l Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m	 Z	 d d l
 m Z m Z d d l Z d d l m Z d d l m Z d d l m Z d d	 l m Z d d
 l m Z m Z m Z d d l m Z m Z d d l m Z m Z d   Z  d   Z! d   Z" d   Z# d   Z$ e% d  Z& d   Z' d   Z( i d d d i d d f g d 6f d 6d d d f d 6d d  d! f d" 6d# d$ d% f d& 6d' d( d) f d* 6d+ d, d- i d. d/ f d0 6f d1 6d2 d3 d4 f d5 6d6 d7 d8 f d9 6d: d; d< f d= 6d> d? d@ f dA 6dB dC dD f dE 6dF dG dH f dI 6dJ dK dL f dM 6Z) f  Z* dN f Z+ dO e f dP     YZ, dQ   Z- d S(R   s    imports checkers for Python codeiN(   t	   sysconfig(   t   are_exclusive(   t   get_module_partt   is_standard_module(   t   IAstroidChecker(   t   get_global_option(   t   EmptyReportError(   t   BaseChecker(   t   check_messagest   node_ignores_exceptiont   is_from_fallback_block(   t
   get_cyclest
   DotBackend(   t   VerbatimTextt	   Paragraphc         C   sF   |  j  d  } g  t t |   D]  } d j | d | d ! ^ q" S(   s   Split the names of the given module into subparts

    For example,
        _qualified_names('pylint.checkers.ImportsChecker')
    returns
        ['pylint', 'pylint.checkers', 'pylint.checkers.ImportsChecker']
    t   .i    i   (   t   splitt   ranget   lent   join(   t   modnamet   namest   i(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _qualified_names7   s    c         C   s^   t  |  t j  rZ |  j rZ |  j   } t  | t j  rW | j | d |  j } qW qZ n  | S(   s   Get a prepared module name from the given import node

    In the case of relative imports, this will return the
    absolute qualified module name, which might be useful
    for debugging. Otherwise, the initial module name
    is returned unchanged.
    t   level(   t
   isinstancet   astroidt
   ImportFromR   t   roott   Modulet   relative_to_absolute_name(   t
   importnodeR   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _get_import_nameC   s    	c   
         sw  | r d | | f n |   d } t } x.| j D]#} | |  k rJ q2 n  | j   |  j   k rz | j |  j k rz q2 n  t | t j  r t   f d   | j	 D  rUt
 } PqUq2 t | t j  r2 | | j k rUxi | j	 D]^ \ } }	   d | j | f k rt
 } Pn  | d k r | | k r | p3|	 r t
 } Pq q W| rRPqRqUq2 q2 W| rst | |   rs| Sd S(   sI   return the node where [base.]<name> is imported or None if not found
    s   %s.%sc         3   s   |  ] }   | d  k Vq d S(   i    N(    (   t   .0t   iname(   t   fullname(    s6   lib/python2.7/site-packages/pylint/checkers/imports.pys	   <genexpr>a   s    t   *N(   t   Nonet   Falset   bodyt   scopet
   fromlinenoR   R   t   Importt   anyR   t   TrueR   R   R   R   (
   t   nodet   contextt   namet   baseR   t   aliast   firstt   foundt   imported_namet   imported_alias(    (   R#   s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _get_first_importT   s4    *%c         C   s4   x$ t  |  D] } | | k r t Sq Wt |  t  S(   N(   R   R,   R	   t   ImportError(   R-   R   t   ignored_modulest	   submodule(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _ignore_import_failuret   s    c         C   ss   i  } xf |  D]^ \ } } | d f } x3 | j  d  D]" } | d j | i  g  g  } q5 W| d c | 7<q W| S(   s   get a list of 2-uple (module, list_of_files_which_import_this_module),
    it will return a dictionary to represent this as a tree
    R   i    i   (    (   R   t
   setdefault(   t   mod_files_listt	   tree_defst   modt   filesR-   t   prefix(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _make_tree_defs}   s     c   	      C   s  g  } |  j    } x t t | d d    D] \ } \ } \ } } | sU d } n d d j t |   } | d k r | j d | | f  d } nG | j d | | | f  | t |  d	 k r d
 | } n
 d | } | r. | j t | |   q. q. Wd j |  S(   s2   return a string which represents imports as a treet   keyc         S   s   |  d S(   Ni    (    (   t   x(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   <lambda>   s    t    s   (%s)t   ,s   %s %ss     s	   %s\-%s %si   s   %s  s   %s| s   
N(   t   itemst	   enumeratet   sortedR   R%   t   appendR   t   _repr_tree_defs(	   t   datat
   indent_strt   linest   nodesR   R>   t   subR?   t   sub_indent_str(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyRK      s     4		
c         C   s   i  } t  |  d  d d } | j d  xq t t j |   D]Z \ } } d | | <| j |  x4 | D], } | | k ri d | | <| j |  qi qi Wq? WxD t t j |   D]- \ } } x | D] } | j | |  q Wq W| j |   d S(   s0   write dependencies as a dot (graphviz) file
    it   rankdirt   LRs   URL="." node[shape="box"]i   N(   R   t   emitRI   t   sixt	   iteritemst	   emit_nodet	   emit_edget   generate(   t   filenamet   dep_infot   donet   printerR   t   dependenciest
   depmodname(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _dependencies_graph   s    "

"c         C   s.   t  |  |  | j t d | |  f   d S(   s`   generate a dependencies graph and add some information about it in the
    report's section
    s&   %simports graph has been written to %sN(   R`   RJ   R   (   RZ   R[   t   sectt   gtype(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _make_graph   s    s   Unable to import %ss   import-errors4   Used when pylint has been unable to import a module.t   F0401t	   old_namest   E0401s2   Attempted relative import beyond top-level packages   relative-beyond-top-levelsS   Used when a relative import tries to access too many levels in the current package.t   E0402s   Cyclic import (%s)s   cyclic-importsP   Used when a cyclic import between two or more modules is               detected.t   R0401s   Wildcard import %ss   wildcard-imports-   Used when `from module import *` is detected.t   W0401s   Uses of a deprecated module %rs   deprecated-modules/   Used a module marked as deprecated is imported.t   W0402s    Relative import %r, should be %rs   relative-importsB   Used when an import relative to the package directory is detected.i   i    t
   maxversiont   W0403s   Reimport %r (imported line %s)t
   reimporteds0   Used when a module is reimported multiple times.t   W0404s   Module import itselfs   import-selfs'   Used when a module is importing itself.t   W0406s:   __future__ import is not the first non docstring statements   misplaced-futuresu   Python 2.5 and greater require __future__ import to be the               first non docstring statement in the module.t   W0410s!   Multiple imports on one line (%s)s   multiple-importssB   Used when import statement importing multiple modules is detected.t   C0410s   %s should be placed before %ss   wrong-import-ordersu   Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)t   C0411s'   Imports from package %s are not groupeds   ungrouped-importss-   Used when imports are not grouped by packagest   C0412s5   Import "%s" should be placed at the top of the modules   wrong-import-positions$   Used when code and imports are mixedt   C0413t   enchantt   ImportsCheckerc           B   s  e  Z d  Z e Z d Z e Z d Z e	 j
 r6 dA Z n e j dB k  rN dC Z n dD Z d i e d 6d d 6d d 6d d 6f d i d d 6d d 6d d 6d d 6f d i d d 6d d 6d d 6d d 6f d i d d 6d d 6d d 6d d 6f d i e d 6d d 6d d 6d d 6f d i e d 6d d 6d d 6d d 6f d  i e d 6d! d 6d" d 6d# d 6f d$ i e d 6d! d 6d" d 6d% d 6f f Z dE d&  Z e d'    Z d(   Z d)   Z d*   Z e e j     d+    Z e e j     d,    Z e e j     d-    Z d.   Z e Z Z  Z! Z" Z# Z$ Z% Z& d/   Z' e' Z( Z) Z* d0   Z+ d1   Z, d2   Z- d3   Z. e d4    Z/ d5   Z0 d6   Z1 d7   Z2 d8   Z3 d9   Z4 dE dE d:  Z5 d;   Z6 d<   Z7 d=   Z8 d>   Z9 d?   Z: d@   Z; RS(F   s   checks for
    * external modules dependencies
    * relative / wildcard imports
    * cyclic imports
    * uses of deprecated modules
    t   importsit   regsubt   TERMIOSt   Bastiont   rexeci   i   t   optparses   tkinter.tixs   deprecated-modulest   defaultt   csvt   types	   <modules>t   metavarsA   Deprecated modules which should not be used, separated by a commat   helps   import-graphRE   t   strings
   <file.dot>sx   Create a graph of every (i.e. internal and external) dependencies in the given file (report RP0402 must not be disabled)s   ext-import-graphs^   Create a graph of external dependencies in the given file (report RP0402 must not be disabled)s   int-import-graphs^   Create a graph of internal dependencies in the given file (report RP0402 must not be disabled)s   known-standard-librarysY   Force import order to recognize a module as part of the standard compatibility libraries.s   known-third-partysJ   Force import order to recognize a module as part of a third party library.s   analyse-fallback-blockst   yns   <y_or_n>s   Analyse import fallback blocks. This can be used to support both Python 2 and 3 compatible code, which means that the block might have code that exists only in one or another interpreter, leading to false positives when analysed.s   allow-wildcard-with-alls8   Allow wildcard imports from modules that define __all__.c         C   s~   t  j |  |  d  |  _ d  |  _ g  |  _ d  |  _ d  |  _ |  _ d d |  j	 f d d |  j
 f f |  _ |  j   |  _ d  S(   Nt   RP0401s   External dependenciest   RP0402s   Modules dependencies graph(   R   t   __init__R%   t   statst   import_grapht   _imports_stackt   _first_non_import_nodet   _ImportsChecker__int_dep_infot   _ImportsChecker__ext_dep_infot   _report_external_dependenciest   _report_dependencies_grapht   reportst   _compute_site_packagest   _site_packages(   t   selft   linter(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR   I  s    					c          C   s   d   }  t    } t t d d   } xK t d  | t j f  D]1 } t j d |  } |  |  } | j |  q= Wt	 j
 j d  r xX t d  | t j f  D]; } t	 j
 j | d d d t j   d  } | j |  q Wn  | S(	   Nc         S   s   t  j j t  j j |    S(   N(   t   ost   patht   normcaset   abspath(   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _normalized_pathZ  s    t   real_prefixR@   s   /etc/debian_versiont   localt   libt   pythons   dist-packages(   t   sett   getattrt   sysR%   t   filterR@   R    t   get_python_libt   addR   R   t   isfileR   t   get_python_version(   R   t   pathsR   R@   R   t	   libpython(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR   X  s    			c         C   su   |  j  j d i   |  j  j d g   |  j  j |  _ t j t  |  _ t j t  |  _ t |  d d g  |  _	 d S(   s3   called before visiting project (i.e set of modules)R^   t   cycless   ignored-modulesR}   N(
   R   t	   add_statsR   t   collectionst   defaultdictR   R   t   _excluded_edgesR   t   _ignored_modules(   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   openm  s    c         C   s?   t  j |  j  } x& | D] } | | j |  j |  q W| S(   N(   t   copyt   deepcopyR   t   difference_updateR   (   R   t   filtered_graphR-   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt#   _import_graph_without_ignored_edgesw  s    c         C   sj   |  j  j d  rf |  j   } t |  } x9 t | d | D]" } |  j d d d j |  q= Wn  d S(   s3   called before visiting project (i.e set of modules)s   cyclic-importt   verticest   argss    -> N(   R   t   is_message_enabledR   t   listR   t   add_messageR   (   R   t   graphR   t   cycle(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   close}  s
    c         C   s4  |  j  |  | j   } g  | j D] \ } } | ^ q# } t |  d k rr |  j d d d j |  d | n  x | D] } |  j | |  |  j | |  } t | j	 t
 j  r |  j |  n  t | j   t
 j  r |  j | |  n  | d k rqy n  |  j | | | |  |  j | | j  qy Wd S(   s*   triggered when an import statement is seeni   s   multiple-importsR   s   , R-   N(   t   _check_reimportR   R   R   R   R   t   _check_deprecated_modulet   _get_imported_moduleR   t   parentR   R   t   _check_positionR(   t   _record_importR%   t   _check_relative_importt   _add_imported_moduleR/   (   R   R-   t   modnodeR/   t   _R   t   imported_module(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   visit_import  s     "%c         C   s=  | j  } |  j | |  } |  j |  |  j | |  |  j | |  |  j |  |  j | d | d | j t | j	 t
 j  r |  j |  n  t | j   t
 j  r |  j | |  n  | d k r d S| j   } |  j | | | |  xC | j D]8 \ } } | d k r |  j | d | j | f  q q Wd S(   s'   triggered when a from statement is seent   basenameR   NR$   s   %s.%s(   R   R   t   _check_misplaced_futureR   t   _check_wildcard_importst   _check_same_line_importsR   R   R   R   R   R   R   R(   R   R%   R   R   R   R   R/   (   R   R-   R   R   R   R/   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   visit_importfrom  s$    	c         C   s   |  j  |  \ } } } t   } d  } x | | | D] \ } } |  j j d | j  s` q6 n  | j d  \ }	 }
 }
 | r | |	 k r |	 | k r |  j d d | d |	 n  |	 } | j |	  q6 Wg  |  _	 d  |  _
 d  S(   Ns   ungrouped-importsR   R-   R   (   t   _check_imports_orderR   R%   R   R   R)   t	   partitionR   R   R   R   (   R   R-   t   std_importst   ext_importst   loc_importst   mett   current_packaget   import_nodet   import_namet   packageR   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   leave_module  s    	
	c         C   s%  |  j  j d | j  s d  S|  j r) d  St | j t j  sB d  St j t j	 g } g  | D] } t | |  r[ | ^ q[ } | r t
 | j t j t j f   r d  St | t j  rg  | j D]< } t | t j  o | j j d  o | j j d  ^ q } t |  rd  Sn  | |  _ d  S(   Ns   wrong-import-positiont   __(   R   R   R)   R   R   R   R   R   t	   TryExceptt
   TryFinallyR+   t   nodes_of_classR*   R   t   Assignt   targetst
   AssignNameR/   t
   startswitht   endswitht   all(   R   R-   t   nested_allowedt   allowedt   is_nested_allowedt   targett   valid_targets(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   compute_first_non_import_node  s"    	(!Ic         C   s   |  j  j d | j  s d  S|  j r) d  St | j j   t j  sH d  S| } x" t | j t j  sr | j } qQ Wt | t j	 t j
 t j f  r t | j t j t j f   r d  Sn  | |  _ d  S(   Ns   wrong-import-position(   R   R   R)   R   R   R   R(   R   R   t   IfR   R   R+   R   R*   R   (   R   R-   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   visit_functiondef  s    	!!c         C   si   | j  } | d k re | j   } | ra t | t j  oE | j  d k sa |  j d d | qa n  d  Sd  S(   Nt
   __future__s   misplaced-futureR-   (   R   t   previous_siblingR   R   R   R   (   R   R-   R   t   prev(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    	c         C   st   d   | j  D } t j |  } xK | j   D]= \ } } | d k r/ |  j d d | d | | j f q/ q/ Wd  S(   Nc         s   s   |  ] \ } } | Vq d  S(   N(    (   R!   R/   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pys	   <genexpr>  s    i   Rm   R-   R   (   R   R   t   CounterRG   R   R)   (   R   R-   R   t   counterR/   t   count(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    c         C   s/   |  j  r+ |  j d d | d | j   n  d S(   s   Check `node` import or importfrom node position is correct

        Send a message  if `node` comes before another instruction
        s   wrong-import-positionR-   R   N(   R   R   t	   as_string(   R   R-   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    	c         C   s   | r | j  n d } | sZ t | t j  r9 | j } qZ | j d d j d  d } n  t | t j  r | j px d d k r d | } n  |  j	 j
 | | f  d S(   s&   Record the package `node` imports fromi    R   i   N(   R/   R%   R   R   R   R   R   R   R   R   RJ   (   R   R-   t   importedmodnodet   importedname(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR   %  s    !'c            s9   g  | D] \ } } | ^ q } t    f d   | D  S(   Nc         3   s!   |  ] } t  j |    Vq d  S(   N(   R   R   (   R!   R   (   R-   (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pys	   <genexpr>;  s   (   R+   (   R-   Rw   R   R   (    (   R-   s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   _is_fallback_import8  s    c      
   C   s  g  } g  } g  } g  } g  } g  } g  } g  }	 t  j d d d |  j j d |  j j  }
 x|  j D]\ } } | j d  r d | j d  d } n | j d  d } t | j	 t
 j  } |  j j d | j  } |
 j |  } | | f } | d k r| j |  | p| p|	 } |  j | |  r9qd n  | r| r|  j d d | d d | j   d | d d j   f qqd | d k r%| j |  | j |  | r| r| j |  n  | p|	 } | r| r|  j d d | d d | j   d | d d j   f qqd | d k r| j |  | j |  | ri| ri| j |  n  |	 } | r| r|  j d d | d d | j   d | d d j   f qqd | d k rd | j | | f  | r| r|	 j | | f  qqd qd W| | | f S(   s   Checks imports of module `node` are grouped by category

        Imports must follow this order: standard, 3rd party, local
        t   file_contentsRE   t   known_third_partyt   known_standard_libraryR   i   i    s   wrong-import-ordert   FUTUREt   STDLIBR-   R   s   standard import "%s"s   "%s"t
   THIRDPARTYs   third party import "%s"t
   FIRSTPARTYs   first party import "%s"t   LOCALFOLDER(   R   R   (   t   isortt   SortImportst   configR   R   R   R   R   R   R   R   R   R   R   R)   t   place_moduleRJ   R   R   R   (   R   t   _module_nodeR   t   third_party_importst   first_party_importst   external_importst   local_importst   third_party_not_ignoredt   first_party_not_ignoredt   local_not_ignoredt	   isort_objR-   R   R   t   nestedt   ignore_for_import_ordert   import_categoryt   node_and_package_importt   wrong_import(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR   >  sn    	"""c         C   s   y | j  |  SWn t j k
 rS t | | |  j  r= d  S|  j d d | nx t j k
 r t | | |  j  r| d  S|  j j	 r t
 |  r d  St | |  } |  j d d t |  d | n Xd  S(   Ns   relative-beyond-top-levelR-   s   import-errorR   (   t   do_import_moduleR   t   TooManyLevelsErrorR:   R   R%   R   t   AstroidBuildingExceptionR   t   analyse_fallback_blocksR
   R    t   repr(   R   R   R   t   dotted_modname(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR   ~  s    c         C   s   |  j  j d  s d S| j d k r) t S| | k r9 t S| j   sW t | d d  r[ t S| j | k r |  j d d | | j f d | d Sd S(   sp   check relative import. node is either an Import or From node, modname
        the imported module name.
        s   relative-importR   R   R-   N(	   R   R   R%   t   fileR&   t   absolute_import_activatedR   R/   R   (   R   R   R   R   t   importedasname(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    c         C   sW  | j    j } | j    j } t j j t j j |   d } t | t j	  r} | j
 r} | j
 d k r} | d k r} d Sn  y t | |  } Wn t k
 r n X| | k r |  j d d | n t |  sS|  j d j | t    } | | k r
| j |  n  |  j | j |  |  j j d d | j sS|  j | j |  qSn  d S(	   s7   notify an imported module, used to analyze dependenciesi    R   Ns   import-selfR-   R^   s   cyclic-importt   line(   R   R  R/   R   R   t   splitextR   R   R   R   R   R   R7   R   R   R   R;   R   R   R   R   R   t   linenoR   (   R   R-   t   importedmodnamet   module_filet   context_nameR0   t   importedmodnames(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s*    "$c         C   sV   xO |  j  j D]A } | | k s2 | j | d  r |  j d d | d | q q Wd S(   s!   check if the module is deprecatedR   s   deprecated-moduleR-   R   N(   R   t   deprecated_modulesR   R   (   R   R-   t   mod_patht   mod_name(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    c      	   C   s   |  j  j d  s d S| j   } | j   } | | f g } | | k	 r_ | j | d f  n  xz | D]r \ } } xc | j D]X \ }	 }
 t | | |	 | | |
  } | d k	 r| |  j d d | d |	 | j	 f q| q| Wqf Wd S(   s8   check if the import is necessary (i.e. not already done)Rm   NR-   R   (
   R   R   t   frameR   RJ   R%   R   R6   R   R)   (   R   R-   R   R   R   R   t   contextst   known_contextt   known_levelR/   R1   R2   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s     c         C   sP   t  t j |  j     } | s- t    n  t |  } | j t |   d S(   s4   return a verbatim layout for displaying dependenciesN(   RA   RU   RV   t   _external_dependencies_infoR   RK   RJ   R   (   R   Ra   R   t   _dummyR[   t   tree_str(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s
    c         C   s   |  j  d } | s9 |  j j p5 |  j j p5 |  j j rE t    n  |  j j } | rm t | | | d  n  |  j j } | r t | |  j   | d  n  |  j j } | r t | |  j   | d  n  d S(   s+   write dependencies as a dot (graphviz) fileR^   RE   s	   external s	   internal N(	   R   R   R   t   ext_import_grapht   int_import_graphR   Rc   R$  t   _internal_dependencies_info(   R   Ra   R   R%  R[   RZ   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s     c         C   su   |  j  d k rn |  j j } i  |  _  } xC t j |  j d  D]( \ } } | j |  s? | | | <q? q? Wn  |  j  S(   sX   return cached external dependencies information or build and
        cache them
        R^   N(   R   R%   R   t   current_nameRU   RV   R   R   (   R   R   t   resultt   importeet	   importers(    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR$    s    #c         C   su   |  j  d k rn |  j j } i  |  _  } xC t j |  j d  D]( \ } } | j |  r? | | | <q? q? Wn  |  j  S(   sX   return cached internal dependencies information or build and
        cache them
        R^   N(   R   R%   R   R*  RU   RV   R   R   (   R   R   R+  R,  R-  (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR)    s    #c         C   s_   |  j  |  } xI | j D]> \ } } | d k r | r |  j d d | j d | q q Wd  S(   NR$   s   wildcard-importR   R-   (   t   _wildcard_import_is_allowedR   R   R   (   R   R-   R   t   wildcard_import_is_allowedR/   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR     s    c         C   s%   |  j  j o$ | d  k	 o$ d | j k S(   Nt   __all__(   R   t   allow_wildcard_with_allR%   t   locals(   R   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyR.    s    (   Rx   Ry   Rz   R{   (   i   i   (   R|   (   R|   s   tkinter.tixN(<   t   __name__t
   __module__t   __doc__R   t   __implements__R/   t   MSGSt   msgst   priorityRU   t   PY2R  R   t   version_infot   DEFAULT_STANDARD_LIBRARYt   DEFAULT_KNOWN_THIRD_PARTYR&   t   optionsR%   R   t   staticmethodR   R   R   R   R   t   keysR   R   R   R   t   visit_tryfinallyt   visit_tryexceptt   visit_assignattrt   visit_assignt   visit_ifexpt   visit_comprehensiont
   visit_exprt   visit_ifR   t   visit_classdeft	   visit_fort   visit_whileR   R   R   R   R   R   R   R   R   R   R   R   R   R$  R)  R   R.  (    (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyRv      s   			














	
			"							@			#						c         C   s   |  j  t |    d S(   s.   required method to auto register this checker N(   t   register_checkerRv   (   R   (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   register%  s    (.   R5  R   t	   distutilsR    R   R   R   RU   R   R   t   astroid.modutilsR   R   R   t   pylint.interfacesR   t   pylint.utilsR   t   pylint.exceptionsR   t   pylint.checkersR   t   pylint.checkers.utilsR   R	   R
   t   pylint.graphR   R   t   pylint.reporters.ureports.nodesR   R   R   R    R6   R:   RA   R%   RK   R`   Rc   R7  R<  R=  Rv   RM  (    (    (    s6   lib/python2.7/site-packages/pylint/checkers/imports.pyt   <module>   s   			 					









	  -