ó
šœ~Sc           @   sz   y d  d l  m Z Wn e k
 r' n Xe j ƒ  d  d l Z d  d l Z d „  Z e ƒ  d e j j f d „  ƒ  YZ	 d S(   iÿÿÿÿ(   t   demandimportNc          C   sš   t  g  d D] }  |  j ƒ  d d d … ^ q
 ƒ } xa t t j ƒ j ƒ  D]J \ } } | d j ƒ  rH | j rH d | j | d ƒ | j f | _	 qH qH Wd S(   s%   Add error codes to Pyflakes messages.s   F401 UnusedImports   F402 ImportShadowedByLoopVars   F403 ImportStarUseds   F404 LateFutureImports   F810 Redefineds   F811 RedefinedWhileUnuseds   F812 RedefinedInListComps   F821 UndefinedNames   F822 UndefinedExports   F823 UndefinedLocals   F831 DuplicateArguments   F841 UnusedVariableNiÿÿÿÿi    s   %s %st   F999(   s   F401 UnusedImports   F402 ImportShadowedByLoopVars   F403 ImportStarUseds   F404 LateFutureImports   F810 Redefineds   F811 RedefinedWhileUnuseds   F812 RedefinedInListComps   F821 UndefinedNames   F822 UndefinedExports   F823 UndefinedLocals   F831 DuplicateArguments   F841 UnusedVariable(
   t   dictt   splitt   varst   pyflakest   messagest   itemst   isuppert   messaget   gett
   flake8_msg(   t   linet   codest   namet   obj(    (    s   flake8/_pyflakes.pyt   patch_pyflakes   s                ,"t   FlakesCheckerc           B   sM   e  Z d  Z d Z e j Z d „  Z e d „  ƒ Z	 e d „  ƒ Z
 d „  Z RS(   s=   Subclass the Pyflakes checker to conform with the flake8 API.R   c         C   s&   t  t |  ƒ j | | d |  j ƒd  S(   Nt   withDoctest(   t   superR   t   __init__R   (   t   selft   treet   filename(    (    s   flake8/_pyflakes.pyR   )   s    c         C   sL   | j  d d d ƒ| j  d d t d d d d ƒ| j j d	 d
 g ƒ d  S(   Ns
   --builtinst   helps&   define more built-ins, comma separateds
   --doctestst   defaultt   actiont
   store_trues   check syntax of the doctestst   builtinst   doctests(   t
   add_optiont   Falset   config_optionst   extend(   t   clst   parser(    (    s   flake8/_pyflakes.pyt   add_options-   s
    c         C   s=   | j  r- |  j j | j  j d ƒ ƒ |  _ n  | j |  _ d  S(   Nt   ,(   R   t   builtInst   unionR   R   R   (   R"   t   options(    (    s   flake8/_pyflakes.pyt   parse_options5   s    	$c         c   sK   xD |  j  D]9 } t | d d ƒ } | j | | j | j | j f Vq
 Wd  S(   Nt   coli    (   R   t   getattrt   linenoR   t   message_argst	   __class__(   R   t   mR*   (    (    s   flake8/_pyflakes.pyt   run;   s    (   t   __name__t
   __module__t   __doc__R   R   t   __version__t   versionR   t   classmethodR$   R)   R0   (    (    (    s   flake8/_pyflakes.pyR   $   s   		(
   t	   mercurialR    t   ImportErrort   disableR   t   pyflakes.checkerR   t   checkert   CheckerR   (    (    (    s   flake8/_pyflakes.pyt   <module>   s   
	