ó
'![c           @   sē   d  Z  d d l Z d d l 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   Z d e f d	     YZ d
 e f d     YZ d   Z d Z d S(   s@  utilities methods and classes for checkers

Base id of standard checkers (used in msg and report ids):
01: base
02: classes
03: format
04: import
05: misc
06: variables
07: exceptions
08: similar
09: design_analysis
10: newstyle
11: typecheck
12: logging
13: string_format
14: string_constant
15: stdlib
16: python3
17: refactoring
18-50: not yet used: reserved for future internal checkers.
51-99: perhaps used: reserved for external checkers

The raw_metrics checker has no number associated since it doesn't emit any
messages nor reports. XXX not true, emit a 07 report !

iĸĸĸĸN(   t   OptionsProviderMixIn(   t   diff_string(   t   register_plugins(   t	   UNDEFINEDc   	      C   sģ   g  } xĶ | D] } |  | } t  } t | t  r> d   } n  | j |  } | d k	 rw t | |  } | |  } n d \ } } | | j d d  | |  | | f 7} q W| S(   s   get values listed in <columns> from <stats> and <old_stats>,
    and return a formated list of values, designed to be given to a
    ureport.Table object
    c         S   s   d |  S(   Ns   %.3f(    (   t   num(    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   <lambda>=   s    t   NCt   _t    N(   R   R   (   t   strt
   isinstancet   floatt   gett   NoneR   t   replace(	   t   statst	   old_statst   columnst   linest   m_typet   newt   formatt   oldt   diff_str(    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   table_lines_from_stats3   s    
,t   BaseCheckerc           B   se   e  Z d  Z d Z d Z d Z i  Z d Z e	 Z
 d d  Z d d d e d  Z d   Z d   Z RS(	   s   base class for checkersi   c         C   s,   |  j  j   |  _  t j |   | |  _ d S(   so   checker instances should have the linter as argument

        linter is an object implementing ILinter
        N(   t   namet   lowerR    t   __init__t   linter(   t   selfR   (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyR   W   s    c         C   s    |  j  j | | | | |  d S(   s   add a message of a given typeN(   R   t   add_message(   R   t   msg_idt   linet   nodet   argst
   confidence(    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyR   `   s    c         C   s   d S(   s3   called before visiting project (i.e set of modules)N(    (   R   (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   openf   s    c         C   s   d S(   s2   called after visiting project (i.e set of modules)N(    (   R   (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   closei   s    N(    (    (   t   __name__t
   __module__t   __doc__R   R   t   levelt   optionst   msgst   reportst   Truet   enabledR   R   R   R%   R&   (    (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyR   H   s   		t   BaseTokenCheckerc           B   s   e  Z d  Z d   Z RS(   sE   Base class for checkers that want to have access to the token stream.c         C   s   t     d S(   s#   Should be overridden by subclasses.N(   t   NotImplementedError(   R   t   tokens(    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   process_tokensp   s    (   R'   R(   R)   R3   (    (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyR0   m   s   c         C   s   t  |  t d  d S(   s0   initialize linter with checkers in this package i    N(   R   t   __path__(   R   (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt
   initializeu   s    R5   (   R   R5   (   R)   t   syst   tokenizet   warningst   pylint.configR    t   pylint.reportersR   t   pylint.utilsR   t   pylint.interfacesR   R   R   R0   R5   t   __all__(    (    (    s7   lib/python2.7/site-packages/pylint/checkers/__init__.pyt   <module>'   s   	%	