³ò
C3IHc           @   sm   d  d k  l Z d  d k  l Z d  d k l Z d  d k l Z d d
 d „  ƒ  YZ d e f d „  ƒ  YZ d	 S(   iÿÿÿÿ(   t   Check(   t   Warning(   t   util(   t   walkt   ModuleReferencec           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   t	   localnamet
   remotenamet   modulet   nodes(   t   selfR   R   R   R   (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt   __init__   s    			c         C   s   |  i  |  i |  i i |  i f S(   N(   R   R   R   t   __name__R   (   R	   (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt   __getstate__   s    c         C   s=   | \ |  _  |  _ } |  _ t | t ƒ  h  d g ƒ |  _ d  S(   Nt    (   R   R   R   t
   __import__t   globalsR   (   R	   t   dataR   (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt   __setstate__   s    (   R   t
   __module__R
   R   R   (    (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyR      s   		t   ImportCheckc           B   sD   e  Z d  Z e d d ƒ Z e d d ƒ Z e d d ƒ Z d „  Z RS(   sx   
Get 'from module import *' names hauled into the file and modules.
Figure out which names come from 'import name'.
    s#   Report/ignore imports that may fails   Error trying to import %s: %ss   Report/ignore duplicate importss   Import of "%s" is duplicate%ss4   Report imports which shadow names from other importss5   Import of "%s" duplicates import from module %s at %dc            se   ‡ f d †  ‰ ‡ ‡ f d †  ‰  d d ‡  ‡ f d †  ƒ  Y} ˆ i  o t ˆ i  i | ƒ  ƒ n d  S(   Nc            s‹   y t  |  t ƒ  h  d g ƒ SWng t j
 o( } ˆ  i | t i |  t | ƒ ƒ n5 t j
 o( } ˆ  i | t i |  t | ƒ ƒ n Xd  S(   NR   (	   R   R   t   ImportErrort   warningR   t   importErrort   strt	   Exceptiont   None(   t   namet   nodet   detail(   t   file(    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt
   try_import&   s    #$c      
      s  t  i ˆ i |  ƒ } xÉ | D]Á } y¥ | i | } t  i | i |  ƒ p~ | i | j oB | | d j o
 d } n d | } ˆ i |  t i	 | | ƒ qÆ ˆ i |  t i
 | | i i | i i ƒ n Wq t j
 o q Xq Wt | | | |  ƒ | d i | <ˆ  i | ƒ d  S(   Ni    s    in current scopes    of import in parent scope %s(   R   t   enclosing_scopest   scopest   importst   try_if_exclusiveR   R   R   R   t   duplicateImportt   shadowImportR   t   linenot   KeyErrorR   t   check_module(   R   t   localt   remoteR   R    t   scopet   reft   extra(   t   checkerR   (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt
   add_import/   s*     

			t   FromImportVisitorc              s,   e  Z ‡  ‡ f d  †  Z ‡  ‡ f d †  Z RS(   c            s¤   ˆ | i  | ƒ } | o‡ x„ | i D]u \ } } | d j oB xY t | ƒ D]- } | i d ƒ p ˆ  | | | | ƒ qI qI Wq# ˆ  | | p | | | ƒ q# Wn d  S(   Nt   *t   _(   t   modnamet   namest   dirt
   startswith(   R	   R   t   mt   module_namet
   local_nameR   (   R.   R   (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt	   visitFromI   s    
  c            sR   xK | i  D]@ \ } } ˆ | | ƒ } | o ˆ  | | p | d  | ƒ q
 q
 Wd  S(   N(   R3   R   (   R	   R   R   R   R6   (   R.   R   (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt   visitImportU   s
    
 (   R   R   R9   R:   (    (   R.   R   (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyR/   G   s   (    (   t
   root_scopeR   R   (   R	   R   R-   R/   (    (   R.   R   R-   R   s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyt   check%   s
    	
(   R   R   t   __doc__R   R   R#   R$   R<   (    (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pyR      s   			N(    (	   t   pychecker2.CheckR    R   t
   pychecker2R   t   compilerR   R   R   (    (    (    s-   C:\py\_spe\plugins\pychecker2\ImportChecks.pys   <module>   s
   