ó
ū^Yc           @   s   d  Z  d d l m Z d e j f d     YZ d e f d     YZ d e f d     YZ d	 e f d
     YZ d e j f d     YZ d S(   s$   Default formatting class for Flake8.iĸĸĸĸ(   t   baset   SimpleFormatterc           B   s   e  Z d  Z d Z d   Z RS(   sy  Simple abstraction for Default and Pylint formatter commonality.

    Sub-classes of this need to define an ``error_format`` attribute in order
    to succeed. The ``format`` method relies on that attribute and expects the
    ``error_format`` string to use the old-style formatting strings with named
    parameters:

    * code
    * text
    * path
    * row
    * col

    c         C   s=   |  j  i | j d 6| j d 6| j d 6| j d 6| j d 6S(   sī   Format and write error out.

        If an output filename is specified, write formatted errors to that
        file. Otherwise, print the formatted error to standard out.
        t   codet   textt   patht   rowt   col(   t   error_formatR   R   t   filenamet   line_numbert   column_number(   t   selft   error(    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyt   format   s    	



N(   t   __name__t
   __module__t   __doc__t   NoneR   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR      s   t   Defaultc           B   s   e  Z d  Z d Z d   Z RS(   s   Default formatter for Flake8.

    This also handles backwards compatibility for people specifying a custom
    format string.
    s+   %(path)s:%(row)d:%(col)d: %(code)s %(text)sc         C   s.   |  j  j j   d k r* |  j  j |  _ n  d S(   s!   Check for a custom format string.t   defaultN(   t   optionsR   t   lowerR   (   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyt
   after_init/   s    (   R   R   R   R   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   &   s   t   Pylintc           B   s   e  Z d  Z d Z RS(   s   Pylint formatter for Flake8.s%   %(path)s:%(row)d: [%(code)s] %(text)s(   R   R   R   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   5   s   t   FilenameOnlyc           B   s/   e  Z d  Z d Z d   Z d   Z d   Z RS(   s&   Only print filenames, e.g., flake8 -q.s   %(path)sc         C   s   t    |  _ d S(   s    Initialize our set of filenames.N(   t   sett   filenames_already_printed(   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   @   s    c         C   s   d S(   s   Do not include the source code.N(    (   R   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyt   show_sourceD   s    c         C   s?   | j  |  j k r; |  j j | j   t t |   j |  Sd S(   s%   Ensure we only print each error once.N(   R   R   t   addt   superR   R   (   R   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   H   s    (   R   R   R   R   R   R   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   ;   s
   		t   Nothingc           B   s    e  Z d  Z d   Z d   Z RS(   s   Print absolutely nothing.c         C   s   d S(   s   Do nothing.N(    (   R   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   R   s    c         C   s   d S(   s   Do not print the source.N(    (   R   R   (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   V   s    (   R   R   R   R   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyR   O   s   	N(	   R   t   flake8.formattingR    t   BaseFormatterR   R   R   R   R   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/formatting/default.pyt   <module>   s   !