a
    [f                     @   s0   d dl mZ dd fddZG dd deZdS )	    )BaseCommandc                 C   s   |  dp|   S )N_)
startswithisupper)k r   ~C:\Users\91910\OneDrive\Desktop\vts_admin_rebuild-master\vts\Lib\site-packages\django/core/management/commands/diffsettings.py<lambda>       r	   c                    s    fddt  D S )z2Convert a module namespace to a Python dictionary.c                    s$   i | ]}|s|t t |qS r   )reprgetattr).0r   moduleZ	omittabler   r   
<dictcomp>   r
   z"module_to_dict.<locals>.<dictcomp>)dirr   r   r   r   module_to_dict   s    r   c                   @   s4   e Zd ZdZg Zdd Zdd Zdd Zdd	 Zd
S )CommandzWDisplays differences between the current settings.py and Django's
    default settings.c                 C   s6   |j dddd |j dddd |j d	d
ddd d S )Nz--all
store_truezfDisplay all settings, regardless of their value. In "hash" mode, default values are prefixed by "###".)actionhelpz	--defaultMODULEzvThe settings module to compare the current settings against. Leave empty to compare against Django's default settings.)metavarr   z--outputhashr   Zunifieda  Selects the output format. 'hash' mode displays each changed setting, with the settings that don't appear in the defaults followed by ###. 'unified' mode prefixes the default setting with a minus sign, followed by the changed setting prefixed with a plus sign.)defaultchoicesr   )add_argument)selfparserr   r   r   add_arguments   s     zCommand.add_argumentsc           	      K   sv   ddl m}m}m} |js"|  t|j}|d }t|rB||n|}| j| j	d|d  }d
|||fi |S )Nr   )Settingsglobal_settingssettingsr   r   output
)Zdjango.confr!   r"   r#   Z
configured_setupr   Z_wrappedoutput_hashoutput_unifiedjoin)	r   optionsr!   r"   r#   user_settingsr   default_settingsZoutput_funcr   r   r   handle-   s    
zCommand.handlec                 K   s|   g }t |D ]j}||vr0|d||| f  q|| || krX|d||| f  q|d r|d||| f  q|S )Nz%s = %s  ###z%s = %sallz### %s = %s)sortedappendr   r+   r,   r*   r$   keyr   r   r   r'   ?   s    zCommand.output_hashc              	   K   s   g }t |D ]}||vr8|| jd||| f  q|| || kr|| jd||| f  || jd||| f  q|d r|d||| f  q|S )Nz	+ %s = %sz	- %s = %sr.   z	  %s = %s)r/   r0   styleSUCCESSERRORr1   r   r   r   r(   K   s     zCommand.output_unifiedN)	__name__
__module____qualname__r   Zrequires_system_checksr    r-   r'   r(   r   r   r   r   r   	   s   r   N)Zdjango.core.management.baser   r   r   r   r   r   r   <module>   s   