403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.52
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/css_parser/css/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/css_parser/css/__pycache__/cssrule.cpython-312.pyc
�

��3eI0����ddlmZmZmZmZddlZddlZ	dgZdZ	dZ
ddlZejddk\re
ZneZGd�dej j"�ZGd�d	e�Zy)
�)�unicode_literals�division�absolute_import�print_functionN�CSSRule�restructuredtextz$Id$�c�\��eZdZdZ	dZ	dZ	dZ	dZ	dZ	dZ		dZ
	d	Z	d
Z	dZ
	dZ	ed
edededede	de
dedede
dediZd,�fd�	Zd�Zed�ed��Zd�Zed�ed��Zed �d!��Zed"�d#��Zd$�Zeed%��Zed&�d'��Zed(�d)��Zed*�d+��Z�xZS)-raLAbstract base interface for any type of CSS statement. This includes
    both rule sets and at-rules. An implementation is expected to preserve
    all rules specified in a CSS style sheet, even if the rule is not
    recognized by the parser. Unrecognized rules are represented using the
    :class:`CSSUnknownRule` interface.
    r��r	����
i�i�i��UNKNOWN_RULE�
STYLE_RULE�CHARSET_RULE�IMPORT_RULE�
MEDIA_RULE�FONT_FACE_RULE�	PAGE_RULE�NAMESPACE_RULE�COMMENT�VARIABLES_RULE�MARGIN_RULEc���tt|��||_||_||_|j
|j��d|_y)z$Set common attributes for all rules.FN)	�superr�__init__�_parent�_parentRule�_parentStyleSheet�_setSeq�_tempSeq�	_readonly)�self�
parentRule�parentStyleSheet�readonly�	__class__s    ��8/usr/lib/python3/dist-packages/css_parser/css/cssrule.pyrzCSSRule.__init__FsB���
�g�t�%�'�!���%���!1������T�]�]�_�%����c��|j|�}|jr|j|k(r||_||_y|jj|j�d|��tjj��y)z2Check if new keyword fits the rule it is used for.z#: Invalid atkeyword for this rule: )�errorN)	�
_normalize�	atkeyword�
_atkeyword�_keyword�_logr-�xml�dom�InvalidModificationErr)r%�keywordr/s   r*�
_setAtkeywordzCSSRule._setAtkeywordQsa���O�O�G�,�	��~�~�$�.�.�I�"=�'�D�O�#�D�M��I�I�O�O�!�^�^�W�6�"%�'�'�"@�"@�
�
Br+c��|jS�N)r0�r%s r*�<lambda>zCSSRule.<lambda>\s
��d�o�o�r+z3Normalized  keyword of an @rule (e.g. ``@import``).)�docc�$�|j�y)a�
        :param cssText:
            A parsable DOMString.
        :exceptions:
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified CSS string value has a syntax error and
              is unparsable.
            - :exc:`~xml.dom.InvalidModificationErr`:
              Raised if the specified CSS string value represents a different
              type of rule than the current one.
            - :exc:`~xml.dom.HierarchyRequestErr`:
              Raised if the rule cannot be inserted at this point in the
              style sheet.
            - :exc:`~xml.dom.NoModificationAllowedErr`:
              Raised if the rule is readonly.
        N)�_checkReadonly)r%�cssTexts  r*�_setCssTextzCSSRule._setCssText_s��"	
���r+c��y)N��r:s r*r;zCSSRule.<lambda>r��r+z}(DOM) The parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.c��|jSr9)rr:s r*r;zCSSRule.<lambda>ws
��4�<�<�r+z(The Parent Node of this CSSRule or None.c��|jSr9)r r:s r*r;zCSSRule.<lambda>zs��t�'7�'7�r+z�If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns None.c�^�|jr|jjS|jSr9)r&r!r:s r*�_getParentStyleSheetzCSSRule._getParentStyleSheet�s%���O�O��?�?�4�4�4��)�)�)r+z(The style sheet that contains this rule.c��|jSr9)rr:s r*r;zCSSRule.<lambda>�s���!2�!2�r+z=The type of this rule, as defined by a CSSRule type constant.c�<�tj|jSr9)r�_typestrings�typer:s r*r;zCSSRule.<lambda>�s��w�';�';�D�I�I�'F�r+z%Descriptive name of this rule's type.c��y)NFrCr:s r*r;zCSSRule.<lambda>�rDr+zIf the rule is wellformed.)NNF)�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrrrKrr7�propertyr/r@r?�parentr&rHr'rL�
typeString�
wellformed�
__classcell__�r)s@r*rrsj������L�H��J�*��L�H��K�+��J�*��N�-��I�)��N�G��G�$��N���K��!�.��� �.�����"�$4��{�"�$4��Y�"�$4����L�	�	B��5�}�R�T�I��&���8�9�G�
�/�D�F�F��7�G�H�J�*� � 4�$N�P���2�)�*�D��F�E�G�J��,�:�<�Jr+c�h��eZdZdZd�fd�	Zd�Zd�Zed�ed�Zd�Z	d
d�Z
d	�Zd
�Zd
d�Z
�xZS)�CSSRuleRulesz�Abstract base interface for rules that contain other rules
    like @media or @page. Methods may be overwritten if a rule
    has specific stuff to do like checking the order of insertion like
    @media does.
    c�v��tt|�||��tjj�|_y)N)r&r')rrYr�
css_parser�css�CSSRuleList�cssRules)r%r&r'r)s   �r*rzCSSRuleRules.__init__�s3���
�l�D�*�j�<L�	+�	N�#���2�2�4��
r+c#�6K�|jD]}|���y�w)z/Generator iterating over these rule's cssRules.N��	_cssRules�r%�rules  r*�__iter__zCSSRuleRules.__iter__�s�����N�N�	�D��J�	�s�c��|j|_|j|_|j|jk(|D]}||_d|_�||_y)z1Set new cssRules and update contained rules refs.N)�
insertRule�append�extend�__delitem__�
deleteRuler r!ra)r%r^rcs   r*�_setCssRuleszCSSRuleRules._setCssRules�sR���/�/����/�/���������/��	*�D�#�D��%)�D�"�	*�"��r+c��|jSr9r`r:s r*r;zCSSRuleRules.<lambda>�s
��T�^�^�r+zFAll Rules in this style sheet, a :class:`~css_parser.css.CSSRuleList`.c��|j�t|t�r^t|j�D]\}}||k(s�|}n9t
jj|jj�d|����	d|j|_|j|=y#t$rNt
jjd|jj||jjfz��wxYw)a�
        Delete the rule at `index` from rules ``cssRules``.

        :param index:
            The `index` of the rule to be removed from the rules cssRules
            list. For an `index` < 0 **no** :exc:`~xml.dom.IndexSizeErr` is
            raised but rules for normal Python lists are used. E.g.
            ``deleteRule(-1)`` removes the last rule in cssRules.

            `index` may also be a CSSRule object which will then be removed.

        :Exceptions:
            - :exc:`~xml.dom.IndexSizeErr`:
              Raised if the specified index does not correspond to a rule in
              the media rule list.
            - :exc:`~xml.dom.NoModificationAllowedErr`:
              Raised if this media rule is readonly.
        z+: Not a rule in this rule'a cssRules list: Nz8%s: %s is not a valid index in the rulelist of length %i)r>�
isinstancer�	enumerater^r3r4�IndexSizeErrr)rNrar �
IndexError�length)r%�index�i�rs    r*rjzCSSRuleRules.deleteRule�s���&	
�����e�W�%�!�$�-�-�0�
O���1��A�:��E��
O�
�g�g�*�*�.2�n�n�.E�.E�u�,N�O�O�		I�04�D�N�N�5�!�-����u�%���	I��'�'�&�&�(F�*.�.�.�*A�*A�*/����1F�1F�*H�(H�I�
I�	I�s
�!B"�"AC9c�&�|j�|�t|j�}nn|dks||jjkDrPtj
j
|jj�d|�d|jj�d���t|t�r�tjj�}||_t|j�dk7s=|jrft|jdtjj �s5|j"j%|jj�d|���y|jd}||fSt|tjj&�r)t)|�D]\}}|j+|||z��yt|tjj �s5|j"j%|�d	|jj���y||fS)
z1return checked `index` and optional parsed `rule`rz: Invalid index z" for CSSRuleList with a length of �.rz: Invalid Rule: )FF)TTz: Not a CSSRule: )r>�lenrarrr3r4rpr)rNrn�string_typer[r\�
CSSStyleSheetr?r^rr2r-r]rorf)r%rcrs�	tempsheetrtrus      r*�_prepareInsertRulezCSSRuleRules._prepareInsertRule�s��������=�����'�E�
�Q�Y�%�$�.�.�"7�"7�7��'�'�&�&�*.�.�.�*A�*A�*/����1F�1F�(H�I�
I��d�K�(�"���4�4�6�I� $�I���9�%�%�&�!�+�	�0B�0B�4>�y�?Q�?Q�RS�?T�V`�Vd�Vd�Vl�Vl�4m��	�	���$�.�.�:Q�:Q�:>�!@�A�#��%�%�a�(�D��U�{����j�n�n�8�8�
9�!�$��
.���1�����5�1�9�-�
.���D�*�.�.�"8�"8�9��I�I�O�O�t�7;�~�~�7N�7N�P�
Q���U�{�r+c�Z�||_d|_|jj||�|S)zadd `rule` at `index`N)r r!ra�insert�r%rcrss   r*�_finishInsertRulezCSSRuleRules._finishInsertRule	s+�����!%��������e�T�*��r+c�$�|j|�S)z6Add `rule` to page rule. Same as ``insertRule(rule)``.)rfrbs  r*�addzCSSRuleRules.adds�����t�$�$r+c�&�|j||�S)a�
        Insert `rule` into the rules ``cssRules``.

        :param rule:
            the parsable text representing the `rule` to be inserted. For rule
            sets this contains both the selector and the style declaration.
            For at-rules, this specifies both the at-identifier and the rule
            content.

            css_parser also allows rule to be a valid
            :class:`~css_parser.css.CSSRule` object.

        :param index:
            before the `index` the specified `rule` will be inserted.
            If the specified `index` is equal to the length of the rules
            rule collection, the rule will be added to the end of the rule.
            If index is not given or None rule will be appended to rule
            list.

        :returns:
            the index of the newly inserted rule.

        :exceptions:
            - :exc:`~xml.dom.HierarchyRequestErr`:
              Raised if the `rule` cannot be inserted at the specified `index`,
              e.g., if an @import rule is inserted after a standard rule set
              or other at-rule.
            - :exc:`~xml.dom.IndexSizeErr`:
              Raised if the specified `index` is not a valid insertion point.
            - :exc:`~xml.dom.NoModificationAllowedErr`:
              Raised if this rule is readonly.
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified `rule` has a syntax error and is
              unparsable.
        )r|rs   r*rfzCSSRuleRules.insertRules��H�&�&�t�U�3�3r+)NNr9)rNrOrPrQrrdrkrRr^rjr|r�r�rfrVrWs@r*rYrY�sK����5��

"��3�\�@�A�H�(I�T%�N�%�$4r+rY)�
__future__rrrr�xml.domr3r[�__all__�
__docformat__�__version__�sys�version_info�strry�
basestring�util�Base2rrYrCr+r*�<module>r�sl��R�R���1��+��"�
���
����A��!���K��K�A<�j�o�o�#�#�A<�Hc4�7�c4r+

Youez - 2016 - github.com/yon3zu
LinuXploit