ó
„¾^Yc           @   sö   d  Z  d d l Z y d d l m Z Wn* e k
 rR d e j f d „  ƒ  YZ n Xd d l Z e j e ƒ Z e j	 e ƒ  ƒ [ d Z
 e d „  e
 j d ƒ Dƒ ƒ Z d	 Z e j e d
 ƒ i e j d 6e j d 6e d 6Z d Z d e d „ Z d S(   sì   Top-level module for Flake8.

This module

- initializes logging for the command-line tool
- tracks the version of the package
- provides a way to configure logging for the command-line tool

.. autofunction:: flake8.configure_logging

iÿÿÿÿN(   t   NullHandlerR    c           B   s   e  Z d  Z d „  Z RS(   s!   Shim for version of Python < 2.7.c         C   s   d S(   s   Do nothing.N(    (   t   selft   record(    (    s/   /tmp/pip-build-EndXZ2/flake8/flake8/__init__.pyt   emit   s    (   t   __name__t
   __module__t   __doc__R   (    (    (    s/   /tmp/pip-build-EndXZ2/flake8/flake8/__init__.pyR       s   s   3.3.0c         c   s'   |  ] } | j  ƒ  r t | ƒ Vq d  S(   N(   t   isdigitt   int(   t   .0t   i(    (    s/   /tmp/pip-build-EndXZ2/flake8/flake8/__init__.pys	   <genexpr>   s    t   .i   t   VERBOSEi   i   i   sO   %(name)-25s %(processName)-11s %(relativeCreated)6d %(levelname)-8s %(message)sc         C   sÅ   |  d k r d S|  d k r% d }  n  t  |  } | sB | d k rc t t | pQ d ƒ } t j } n | } t j } | | ƒ } | j t j | ƒ ƒ t j	 | ƒ t j
 | ƒ t j d | t ƒ d S(   sQ  Configure logging for flake8.

    :param int verbosity:
        How verbose to be in logging information.
    :param str filename:
        Name of the file to append log information to.
        If ``None`` this will log to ``sys.stderr``.
        If the name is "stdout" or "stderr" this will log to the appropriate
        stream.
    i    Ni   t   stderrt   stdouts/   Added a %s logging handler to logger root at %s(   s   stderrs   stdout(   t   _VERBOSITY_TO_LOG_LEVELt   getattrt   syst   loggingt   StreamHandlert   FileHandlert   setFormattert	   Formattert   LOGt
   addHandlert   setLevelt   debugR   (   t	   verbosityt   filenamet	   logformatt	   log_levelt   fileobjt   handler_clst   handler(    (    s/   /tmp/pip-build-EndXZ2/flake8/flake8/__init__.pyt   configure_logging4   s     	
		(   R   R   R    t   ImportErrort   HandlerR   t	   getLoggerR   R   R   t   __version__t   tuplet   splitt   __version_info__t   _EXTRA_VERBOSEt   addLevelNamet   INFOt   DEBUGR   t
   LOG_FORMATt   NoneR"   (    (    (    s/   /tmp/pip-build-EndXZ2/flake8/flake8/__init__.pyt   <module>   s&   


