| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/soupsieve/__pycache__/ |
Upload File : |
o
B �a� � @ s� d Z ddlZddlmZ e�d�Ze�d�Ze�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�Zeeeee e
eee
eeeeeed�Zdedefdd�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)
```
� N)�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�obj�returnc
C s t | �}d}t|�d }d}g }||kr�d}t�� D ]l\}}|�||�}|r�|} |�d�}| dv rD|d7 }|�d�|�d�d| �� n@| dv rQ|�|�d�� n3| d v rb|d8 }|�|�d�� n"| d
v ru|�d�|�d�d| �� n| dv r�|�d�|�d��� nq||ksd
� |�S )z%Make the object output string pretty.r � N)r r r r � z{}
{}� )r r r r r r )r r
r )r
)r z{} � )
�str�len�TOKENS�items�match�end�append�format�group�join)
r �sel�indexr �indent�output�m�k�v�name� r* �2/usr/lib/python3/dist-packages/soupsieve/pretty.py�prettyj s8
��
r, )�__doc__�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* r+ �<module> sF C
�