ó
®â0_c           @   s9   d  d l  m Z d „  d „ Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   BaseCommandc         C   s   |  j  d ƒ S(   Nt   _(   t
   startswith(   t   k(    (    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyt   <lambda>   t    c            s   ‡  f d †  |  j  j ƒ  Dƒ S(   s3   Converts a module namespace to a Python dictionary.c            s1   i  |  ]' \ } } ˆ  | ƒ s t  | ƒ | “ q S(    (   t   repr(   t   .0R   t   v(   t	   omittable(    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pys
   <dictcomp>   s   	 (   t   __dict__t   items(   t   moduleR	   (    (   R	   sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyt   module_to_dict   s    t   Commandc           B   s&   e  Z d  Z e Z d „  Z d „  Z RS(   s   Displays differences between the current settings.py and Django's
    default settings. Settings that don't appear in the defaults are
    followed by "###".c      
   C   sN   | j  d d d d d d t d d ƒ| j  d	 d d d
 d d d  d d ƒd  S(   Ns   --allt   actiont
   store_truet   destt   allt   defaultt   helpsV   Display all settings, regardless of their value. Default values are prefixed by "###".s	   --defaultt   metavart   MODULEsv   The settings module to compare the current settings against. Leave empty to compare against Django's default settings.(   t   add_argumentt   Falset   None(   t   selft   parser(    (    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyt   add_arguments   s    c   
      K   s  d d l  m } m } m } | j ƒ  t | j ƒ } | d } t | rT | | ƒ n | ƒ } g  } x˜ t | ƒ D]Š }	 |	 | k r  | j d |	 | |	 f ƒ qp | |	 | |	 k rÒ | j d |	 | |	 f ƒ qp | d rp | j d |	 | |	 f ƒ qp qp Wd j	 | ƒ S(	   Niÿÿÿÿ(   t   settingst   Settingst   global_settingsR   s   %s = %s  ###s   %s = %sR   s   ### %s = %ss   
(
   t   django.confR   R   R   t   _setupR   t   _wrappedt   sortedt   appendt   join(
   R   t   optionsR   R   R   t   user_settingsR   t   default_settingst   outputt   key(    (    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyt   handle   s    


"(   t   __name__t
   __module__R   R   t   requires_system_checksR   R+   (    (    (    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyR   	   s   	N(   t   django.core.management.baseR    R   R   (    (    (    sN   /tmp/pip-unpacked-wheel-BAJOf3/django/core/management/commands/diffsettings.pyt   <module>   s   