o
    e
                     @   s<   d Z dgZddlmZ ddlZddlZG dd dejZdS )zCSSComment is not defined in DOM Level 2 at all but a cssutils defined
class only.

Implements CSSRule which is also extended for a CSSComment rule type.

CSSComment   )cssrule    Nc                       sr   e Zd ZdZ	d fdd	Zdd Zdd	 Zd
d Z fddZe	eeddZ
e	dd ddZe	dd Z  ZS )r   zR
    Represents a CSS comment (cssutils only).

    Format::

        /*...*/
    NFc                    s.   t  j||d d | _|r| | || _d S )N)
parentRuleparentStyleSheet)super__init___cssText_setCssTextZ	_readonly)selfcssTextr   r   readonly	__class__ GD:\Projects\ConvertPro\env\Lib\site-packages\cssutils/css/csscomment.pyr      s
   

zCSSComment.__init__c                 C   s   d | jj| jS )Nzcssutils.css.{}(cssText={!r}))formatr   __name__r   r   r   r   r   __repr__!   s   
zCSSComment.__repr__c                 C   s   d | jj| jt| S )Nz/<cssutils.css.{} object cssText={!r} at 0x{:x}>)r   r   r   r   idr   r   r   r   __str__&   s
   zCSSComment.__str__c                 C   s   t j| S )z#Return serialized property cssText.)cssutilsZserZdo_CSSCommentr   r   r   r   _getCssText-   s   zCSSComment._getCssTextc                    sv   t  | | |}| |}| |}|r"| || jjks"|r3| jjd| 	| t
jjd dS | || _dS )ah  
        :param cssText:
            textual text to set or tokenlist which is not tokenized
            anymore. May also be a single token for this rule

        :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.NoModificationAllowedErr`:
              Raised if the rule is readonly.
        z CSSComment: Not a CSSComment: %r)errorN)r   r
   Z
_tokenize2Z
_nexttoken_typeZ_prodsCOMMENT_logr   Z	_valuestrxmldomZInvalidModificationErrZ_tokenvaluer	   )r   r   Z	tokenizerZcommenttokenZ
unexpectedr   r   r   r
   1   s   



zCSSComment._setCssTextz1The parsable textual representation of this rule.)docc                 C   s   | j S )N)r   r   r   r   r   <lambda>Z   s    zCSSComment.<lambda>z=The type of this rule, as defined by a CSSRule type constant.c                 C   s   dS )NTr   r   r   r   r   r!   _   s    )NNNF)r   
__module____qualname____doc__r   r   r   r   r
   propertyr   typeZ
wellformed__classcell__r   r   r   r   r      s$    	")	r$   __all__ r   r   Zxml.domr   ZCSSRuler   r   r   r   r   <module>   s    