
    Mh                    6   d Z ddlmZ ddlZddlmZ  ej        d          Z ej        d          Z ej        d          Z	 ej        d          Z
 ej        d	          Z ej        d
          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Z ej        d          Zeee	e
eeeeeeeeeeedZddZdS )a  
Format a pretty string of a `SoupSieve` object for easy debugging.

This won't necessarily support all types and such, and definitely
not support custom outputs.

It is mainly geared towards our types as the `SelectorList`
object is a beast to look at without some indentation and newlines.
The format and various output types is fairly known (though it
hasn't been tested extensively to make sure we aren't missing corners).

Example:
-------
```
>>> import soupsieve as sv
>>> sv.compile('this > that.class[name=value]').selectors.pretty()
SelectorList(
    selectors=(
        Selector(
            tag=SelectorTag(
                name='that',
                prefix=None),
            ids=(),
            classes=(
                'class',
                ),
            attributes=(
                SelectorAttribute(
                    attribute='name',
                    prefix='',
                    pattern=re.compile(
                        '^value$'),
                    xml_type_pattern=None),
                ),
            nth=(),
            selectors=(),
            relation=SelectorList(
                selectors=(
                    Selector(
                        tag=SelectorTag(
                            name='this',
                            prefix=None),
                        ids=(),
                        classes=(),
                        attributes=(),
                        nth=(),
                        selectors=(),
                        relation=SelectorList(
                            selectors=(),
                            is_not=False,
                            is_html=False),
                        rel_type='>',
                        contains=(),
                        lang=(),
                        flags=0),
                    ),
                is_not=False,
                is_html=False),
            rel_type=None,
            contains=(),
            lang=(),
            flags=0),
        ),
    is_not=False,
    is_html=False)
```

    )annotationsN)Anyz(?i)[a-z_][_a-z\d\.]+\(z(?i)[_a-z][_a-z\d]+=z\(\)|\[\]|\{\}z\[z\{z\(z\]z\}z\)z\d+z(?i)[_a-z][_a-z\d]+z"(?:\\.|[^"\\])*"z'(?:\\.|[^'\\])*'z	\s*(,)\s*z	\s*(:)\s*)classparamemptylstrtdstrttstrtlenddendtendsqstrsepdsepintkworddqstrobjr   returnstrc                :   t          |           }d}t          |          dz
  }d}g }||k    rYd}t                                          D ]5\  }}|                    ||          }|r|}	|                    d          }|	dv r6|dz  }|                    |                    d           dd|z              n|	dv r)|                    |                    d                     n|	d	v r.|dz  }|                    |                    d                     nd|	d
v r1|                    |                    d           dd|z              n/|	dv r+|                    |                    d           d            n7||k    Yd                    |          S )z%Make the object output string pretty.r      N)r   r   r	   r
      
 )r   r   r   r   r   r   )r   r   r   )r   )r    )	r   lenTOKENSitemsmatchendappendgroupjoin)
r   selindexr!   indentoutputmkvnames
             P/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/soupsieve/pretty.pyprettyr.   l   s    c((CE
c((Q,CFF
3,,LLNN 	 	DAqU##A a???aKFMMQWWQZZ"A"A3<"A"ABBBBQQQMM!''!**----555aKFMM!''!**----X%%MMQWWQZZ"A"A3<"A"ABBBBY&&MMQWWQZZ"2"2"2333 3,,, 776??    )r   r   r   r   )__doc__
__future__r   retypingr   compileRE_CLASSRE_PARAMRE_EMPTYRE_LSTRTRE_DSTRTRE_TSTRTRE_LENDRE_DENDRE_TENDRE_INTRE_KWORDRE_DQSTRRE_SQSTRRE_SEPRE_DSEPr   r.    r/   r-   <module>rE      s  C CH # " " " " " 				      2:0112:-..2:'((2:e2:e2:e
"*U


"*U


"*U

	F		2:,--2:*++2:*++	L	!	!
"*\
"
" 
 
&     r/   