| 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 : /usr/lib/python3/dist-packages/tinycss/__pycache__/ |
Upload File : |
o
�9�W�q � @ s� d Z ddlmZ ddlmZmZ ddlmZ ddlm Z m
Z
mZmZm
Z
mZ ddlmZ ddlmZ G d d
� d
e�ZG dd� de�ZG d
d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zdd� ZG dd� de�ZdS )z�
tinycss.css21
-------------
Parser for CSS 2.1
http://www.w3.org/TR/CSS21/syndata.html
:copyright: (c) 2012 by Simon Sapin.
:license: BSD, see LICENSE for more details.
� )�unicode_literals)�chain�islice� )�decode)�
ParseError�remove_whitespace�split_on_comma�strip_whitespace�validate_any�validate_value)� TokenList)�tokenize_groupedc @ � e Zd ZdZdd� Zdd� ZdS )�
Stylesheetal
A parsed CSS stylesheet.
.. attribute:: rules
A mixed list, in source order, of :class:`RuleSet` and various
at-rules such as :class:`ImportRule`, :class:`MediaRule`
and :class:`PageRule`.
Use their :obj:`at_keyword` attribute to distinguish them.
.. attribute:: errors
A list of :class:`~.parsing.ParseError`. Invalid rules and declarations
are ignored, with the details logged in this list.
.. attribute:: encoding
The character encoding that was used to decode the stylesheet
from bytes, or ``None`` for Unicode stylesheets.
c C s || _ || _|| _d S �N)�rules�errors�encoding)�selfr r r � r �//usr/lib/python3/dist-packages/tinycss/css21.py�__init__@ s
zStylesheet.__init__c C s d� | t| j�t| j��S )Nz-<{0.__class__.__name__} {1} rules {2} errors>)�format�lenr r �r r r r �__repr__E s �zStylesheet.__repr__N��__name__�
__module__�__qualname__�__doc__r r r r r r r * s r c @ r )�AtRulea�
An unparsed at-rule.
.. attribute:: at_keyword
The normalized (lower-case) at-keyword as a string. Eg: ``'@page'``
.. attribute:: head
The part of the at-rule between the at-keyword and the ``{``
marking the body, or the ``;`` marking the end of an at-rule without
a body. A :class:`~.token_data.TokenList`.
.. attribute:: body
The content of the body between ``{`` and ``}`` as a
:class:`~.token_data.TokenList`, or ``None`` if there is no body
(ie. if the rule ends with ``;``).
The head was validated against the core grammar but **not** the body,
as the body might contain declarations. In case of an error in a
declaration, parsing should continue from the next declaration.
The whole rule should not be ignored as it would be for an error
in the head.
These at-rules are expected to be parsed further before reaching
the user API.
c C s6 || _ t|�| _|d urt|�n|| _|| _|| _d S r )�
at_keywordr
�head�body�line�column)r r# r$ r% r&