a
    LcòfÚ  ã                   @   sŠ  d Z dZdd„ edƒD ƒZdd„ edƒD ƒZdZddd	d
ddœZd$dd„Zd%dd„ZdZ	dZ
dZe	i i i i i i i i i i i i i i i i i dœe
dddœdddœdddœddidddœddiddiddiddii ddiddidddœddidddœdddœddidœedddœdddœdddœddidddœddidd iddiddii dddœddidddœddidddœdddœddidœiZe
Zd!d"„ Zd#S )&z
termcolors.py
)ÚblackÚredÚgreenÚyellowÚblueÚmagentaÚcyanÚwhitec                 C   s   i | ]}t | d | “qS )z3%s©Úcolor_names©Ú.0Úx© r   úT/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/django/utils/termcolors.pyÚ
<dictcomp>   ó    r   é   c                 C   s   i | ]}t | d | “qS )z4%sr	   r   r   r   r   r      r   Ú0Ú1Ú4Ú5Ú7Ú8)ÚboldZ
underscoreÚblinkÚreverseÚconcealÚ r   c                 K   s¾   g }| dkr,t |ƒdkr,|d dkr,dt S | ¡ D ]6\}}|dkrT| t| ¡ q4|dkr4| t| ¡ q4|D ]}|tv rp| t| ¡ qpd|vr¤d	| pœdtf } d
dd |¡ | p¸df S )aB  
    Return your text, enclosed in ANSI graphics codes.

    Depends on the keyword arguments 'fg' and 'bg', and the contents of
    the opts tuple/list.

    Return the RESET code if no parameters are given.

    Valid colors:
        'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'

    Valid options:
        'bold'
        'underscore'
        'blink'
        'reverse'
        'conceal'
        'noreset' - string will not be auto-terminated with the RESET code

    Examples:
        colorize('hello', fg='red', bg='blue', opts=('blink',))
        colorize()
        colorize('goodbye', opts=('underscore',))
        print(colorize('first line', fg='red', opts=('noreset',)))
        print('this should be red too')
        print(colorize('and so should this'))
        print('this should not be red')
    r   é   é    Úresetz[%smÚfgÚbgZnoresetz%s[%smz%s%sú;)ÚlenÚRESETÚitemsÚappendÚ
foregroundÚ
backgroundÚopt_dictÚjoin)ÚtextÚoptsÚkwargsZ	code_listÚkÚvÚor   r   r   Úcolorize   s     r2   c                    s   ‡ ‡fdd„S )a  
    Return a function with default parameters for colorize()

    Example:
        bold_red = make_style(opts=('bold',), fg='red')
        print(bold_red('hello'))
        KEYWORD = make_style(fg='yellow')
        COMMENT = make_style(fg='blue', opts=('bold',))
    c                    s   t | ˆfi ˆ ¤ŽS ©N)r2   )r,   ©r.   r-   r   r   Ú<lambda>J   r   zmake_style.<locals>.<lambda>r   )r-   r.   r   r4   r   Ú
make_style@   s    
r6   ZnocolorZdarkÚlight)ÚERRORÚSUCCESSÚWARNINGZNOTICEZ	SQL_FIELDZSQL_COLTYPEZSQL_KEYWORDZ	SQL_TABLEZ	HTTP_INFOZHTTP_SUCCESSZHTTP_REDIRECTZHTTP_NOT_MODIFIEDZHTTP_BAD_REQUESTZHTTP_NOT_FOUNDZHTTP_SERVER_ERRORZMIGRATE_HEADINGZMIGRATE_LABELr   )r   )r!   r-   r   r   r!   r-   r   r   r   c                 C   s  | st t S |  ¡  d¡}t t  ¡ }|D ]Ð}|t v rF| t | ¡ q*d|v r*i }| d¡\}}| ¡ }| d¡}| ¡  | 	¡  d¡}| ¡  | 	¡ }	|	t
v r¨|	|d< |rÄ|d t
v rÄ|d |d< tdd	„ |D ƒƒ}
|
râ|
|d
< |t t v r*|r*|||< q*|t t k�rdS |S )a“  Parse a DJANGO_COLORS environment variable to produce the system palette

    The general form of a palette definition is:

        "palette;role=fg;role=fg/bg;role=fg,option,option;role=fg/bg,option,option"

    where:
        palette is a named palette; one of 'light', 'dark', or 'nocolor'.
        role is a named style used by Django
        fg is a foreground color.
        bg is a background color.
        option is a display options.

    Specifying a named palette is the same as manually specifying the individual
    definitions for each role. Any individual definitions following the palette
    definition will augment the base palette definition.

    Valid roles:
        'error', 'success', 'warning', 'notice', 'sql_field', 'sql_coltype',
        'sql_keyword', 'sql_table', 'http_info', 'http_success',
        'http_redirect', 'http_not_modified', 'http_bad_request',
        'http_not_found', 'http_server_error', 'migrate_heading',
        'migrate_label'

    Valid colors:
        'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'

    Valid options:
        'bold', 'underscore', 'blink', 'reverse', 'conceal', 'noreset'
    r#   ú=ú,ú/r!   éÿÿÿÿr"   c                 s   s   | ]}|t v r|V  qd S r3   )r*   )r   Úsr   r   r   Ú	<genexpr>Ð   r   z&parse_color_setting.<locals>.<genexpr>r-   N)ÚPALETTESÚDEFAULT_PALETTEÚlowerÚsplitÚNOCOLOR_PALETTEÚcopyÚupdateÚupperr   Úpopr
   Útuple)Zconfig_stringÚpartsÚpaletteÚpartZ
definitionÚroleZinstructionsÚstylesÚcolorsr!   r-   r   r   r   Úparse_color_setting�   s8    

rQ   N)r   r   )r   )Ú__doc__r
   Úranger(   r)   r%   r*   r2   r6   rE   ZDARK_PALETTEZLIGHT_PALETTErA   rB   rQ   r   r   r   r   Ú<module>   s–   û	
-
ïïïÙ;