ó
„¾^Yc           @   sT   d  Z  d d l Z d d l m Z d d l m Z e j e ƒ Z d d d „ Z
 d S(   sÖ   Aggregation function for CLI specified options and config file options.

This holds the logic that uses the collected and merged config files and
applies the user-specified command-line configuration on top of it.
iÿÿÿÿN(   t   utils(   t   configc         C   s„  |  j  g  d | ƒ\ } } |  j  | ƒ \ } } t j | j ƒ } t j d |  d | d | ƒ } | j | j | j ƒ }	 |  j j	 ƒ  }
 t
 j d t |
 ƒ ƒ |
 j | j ƒ t |
 ƒ | _ t
 j d | j ƒ |  j j	 ƒ  } t
 j d t | ƒ ƒ | | _ xt |	 j ƒ  D]f \ } } | } t | | ƒ s>| j | j } n  t
 j d t | | d	 ƒ | | ƒ t | | | ƒ q
W|  j  | | ƒ S(
   s‹  Aggregate and merge CLI and config file options.

    :param flake8.option.manager.OptionManager manager:
        The instance of the OptionManager that we're presently using.
    :param list arglist:
        The list of arguments to pass to ``manager.parse_args``. In most cases
        this will be None so ``parse_args`` uses ``sys.argv``. This is mostly
        available to make testing easier.
    :param optparse.Values values:
        Previously parsed set of parsed options.
    :returns:
        Tuple of the parsed options and extra arguments returned by
        ``manager.parse_args``.
    :rtype:
        tuple(optparse.Values, list)
    t   valuest   option_managert   extra_config_filest   argss    Extended default ignore list: %ss   Merged default ignore list: %ss    Extended default select list: %ss3   Overriding default value of (%s) for "%s" with (%s)N(   t
   parse_argsR    t   normalize_pathst   append_configR   t   MergedConfigParsert   parset   isolatedt   extended_default_ignoret   copyt   LOGt   debugt   listt   updatet   ignoret   extended_default_selectt   itemst   hasattrt   config_optionst   destt   getattrt   Nonet   setattr(   t   managert   arglistR   t   default_valuest   _t   original_valuest   original_argsR   t   config_parsert   parsed_configR   R   t   config_namet   valuet	   dest_name(    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/options/aggregator.pyt   aggregate_options   s:    						(   t   __doc__t   loggingt   flake8R    t   flake8.optionsR   t	   getLoggert   __name__R   R   R&   (    (    (    s9   /tmp/pip-build-EndXZ2/flake8/flake8/options/aggregator.pyt   <module>   s
   