o
    Yhk                     @  sX   d dl mZ d dlZd dlmZ d dlmZ dd
dZdddZdddZ	dddZ
dS )    )annotationsN)cli_util)ConfigOptionold_optionsdict[str, ConfigOption]new_optionsreturnboolc                 C  s@   |   D ]\}}|dsq|j}|| j}||kr dS qdS )zpReturn True if and only if an option in the server section differs
    between old_options and new_options.
    serverTF)items
startswithvalue)r   r   opt_nameopt_valold_valnew_val r   V/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/streamlit/config_util.pyserver_option_changed   s   

r   section_descriptionsdict[str, str]config_optionsNonec                   s  g    td d% fdd}d% fdd	}d% fd
d}d% fdd}| D ]dkr/q'fdd| D }t|dkrAq'  d |d d   d | D ]}|jdd }t|jpfd}	t|	d }
t	|	D ]4\}}|
 d}|r|d  s|dd }|dkr|n|}|D ]}||  q||
kr|d qr|jrڈ d dkr|d |tjddd |d t|jD ]}|| q|d |d|j d ddl}|d|ji}|d d  }t|dkr d dkr|d |d!|  n	 |jtjk}|r$ d d"kr|d |d#|j  |||ji}t|dkr:d"| d$}n|sBd"| }|| qWq'td  dS )&z8Print the given config sections/options to the terminal.zh
        # Below are all the sections and options you can have in
        ~/.streamlit/config.toml.
    textstrr   r   c                   s     dtj| dd  d S )N# T)boldappendr   style_for_clir   outr   r   append_desc9   s   z show_config.<locals>.append_descc                   s     dt|   d S )Nr   r   r    r!   r   r   append_comment<      z#show_config.<locals>.append_commentc                   s     tj| ddd d S )NTgreen)r   fgr   r    r!   r   r   append_section?   s   z#show_config.<locals>.append_sectionc                   s     tj| dd d S )Nr&   r'   r   r    r!   r   r   append_settingB   r%   z#show_config.<locals>.append_setting_testc                   s2   i | ]\}}|j  kr|jd kr| s||qS )visible)section
visibility
is_expired).0kv)r-   r   r   
<dictcomp>L   s
    zshow_config.<locals>.<dictcomp>r    [].   
N#zTHIS IS DEPRECATED.yellowr)   z(This option will be removed on or after default
   z	Default: r   zThe value below was set in z =
)r   r   r   r   )r   _cleanr   lenvalueskeysplit_clean_paragraphsdescription	enumeraterstripstriplstrip
deprecatedr   r   deprecation_textexpiration_datetomldumpsdefault_valwhere_definedr   DEFAULT_DEFINITIONr   print_to_clijoin)r   r   r#   r$   r(   r*   section_optionsoptionrB   description_paragraphslast_paragraph_idxi	paragraphlinesappend_funclinerM   toml_defaultoption_is_manually_settoml_settingr   )r"   r-   r   show_config)   s   	







Jr`   txtr   c                 C  s   t dd| S )zReplace sequences of multiple spaces with a single space, excluding newlines.

    Preserves leading and trailing spaces, and does not modify spaces in between lines.
    z + )resub)ra   r   r   r   r?      s   r?   	list[str]c                 C  s"   |  d} | d}dd |D S )zHSplit the text into paragraphs, preserve newlines within the paragraphs.r:   z

c                 S  s&   g | ]}d  dd |d D qS )r:   c                 s  s    | ]}t |V  qd S )N)r?   )r0   r\   r   r   r   	<genexpr>   s    z/_clean_paragraphs.<locals>.<listcomp>.<genexpr>)rS   rC   )r0   rY   r   r   r   
<listcomp>   s    z%_clean_paragraphs.<locals>.<listcomp>)rH   rC   )ra   
paragraphsr   r   r   rD      s
   

rD   )r   r   r   r   r   r	   )r   r   r   r   r   r   )ra   r   r   r   )ra   r   r   re   )
__future__r   rc   	streamlitr   streamlit.config_optionr   r   r`   r?   rD   r   r   r   r   <module>   s   


~