File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/soupsieve/__pycache__/pretty.cpython-310.pyc
Back
o �h� � @ s� d Z ddlmZ ddlZddlmZ e�d�Ze�d�Ze�d�Z e�d�Z e�d �Ze�d �Ze�d�Z e�d�Ze�d �Ze�d�Ze�d�Ze�d�Ze�d�Ze�d�Ze�d�Zeee e eee eeeeeeeed�Zddd�ZdS )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 C s$ t | �}d}t|�d }d}g }||kr�d}t�� D ]n\}}|�||�}|r�|} |�d�}| dv rE|d7 }|�|�d�� dd| � �� nA| dv rR|�|�d�� n4| d v rc|d8 }|�|�d�� n#| d v rw|�|�d�� dd| � �� n| dv r�|�|�d�� d�� nq||ksd�|�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�name� r+ �C/usr/local/CyberCP/lib/python3.10/site-packages/soupsieve/pretty.py�prettyl s8 �� r- )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+ r+ r, �<module> sH D �
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings