403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /tmp/calpy/weasyprint/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /tmp/calpy/weasyprint/__pycache__/__init__.cpython-311.pyc
�

Х=jS:���dZddlmZddlmZmZddlmZddlmZddl	Z	ddl
Z
ddlZdxZZ
idd�d	d�d
d�dd�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�ddd��Zgd�ZddlmZmZmZddlmZmZd�ZGd �d!��ZGd"�d#��ZGd$�d%��Zdd&lmZdd'lmZmZm Z m!Z!dd(l"m#Z#m$Z$dS))z~The Awesome Document Factory.

The public API is what is accessible from this "root" packages without
importing sub-modules.

�)�datetime)�getctime�getmtime)�Path)�urljoinNz69.0�stylesheets�attachments�attachment_relationships�pdf_identifier�pdf_variant�pdf_version�	pdf_forms�pdf_tagsF�uncompressed_pdf�xmp_metadata�custom_metadata�presentational_hints�
output_intent�optimize_images�jpeg_quality�dpi�
full_fonts)�hinting�cache)	�CSS�DEFAULT_OPTIONS�HTML�VERSION�
Attachment�Document�Page�__version__�default_url_fetcher�)�
URLFetcherr#�
select_source)�LOGGER�PROGRESS_LOGGERc���tt|�d����d��}|�:|�dd�����}|rt	||��S|S)zlReturn the base URL for the document.

    See https://www.w3.org/TR/html5/urls.html#document-base-url

    �baseN�href�)�next�iter�get�stripr)�
html_document�fallback_base_url�first_base_elementr+s    �F/tmp/claude-1015/pip-target-jmvfl800/lib/python/weasyprint/__init__.py�_find_base_urlr5dsp���d�=�#5�#5�f�#=�#=�>�>��E�E���%�!�%�%�f�b�1�1�7�7�9�9���	4��,�d�3�3�3���c�H�eZdZdZ			dd�Zd
d�Zd�Zd�Zdd	�Z		dd�Z	dS)ra3HTML document parsed by tinyhtml5.

    You can just create an instance with a positional argument:
    ``doc = HTML(something)``
    The class will try to guess if the input is a filename, an absolute URL,
    or a :term:`file object`.

    Alternatively, use **one** named argument so that no guessing is involved:

    :type filename: str or pathlib.Path
    :param filename:
        A filename, relative to the current directory, or absolute.
    :param str url:
        An absolute, fully qualified URL.
    :type file_obj: :term:`file object`
    :param file_obj:
        Any object with a ``read`` method.
    :param str string:
        A string of HTML source.

    Specifying multiple inputs is an error:
    ``HTML(filename="foo.html", url="localhost://bar.html")``
    will raise a :obj:`TypeError`.

    You can also pass optional named arguments:

    :param str encoding:
        Force the source character encoding.
    :type base_url: str or pathlib.Path
    :param base_url:
        The base used to resolve relative URLs (e.g. in
        ``<img src="../foo.png">``). If not provided, try to use the input
        filename, URL, or ``name`` attribute of
        :term:`file objects <file object>`.
    :type url_fetcher: :term:`callable`
    :param url_fetcher:
        An instance of :class:`urls.URLFetcher`. (See :ref:`URL Fetchers`.)
    :param str media_type:
        The media type to use for ``@media``. Defaults to ``'print'``.
        **Note:** In some cases like ``HTML(string=foo)`` relative URLs will be
        invalid if ``base_url`` is not provided.

    N�printc
	�&�tjd|p|p|pt|dd����t|t��rt|��}|�t
��}t|||||||��}
|
5\}}}}ddi}
|�||
d<|�||
d<tj	|fi|
��}
ddd��n#1swxYwYt|
|��|_||_|	|_
tj�|
d���|_|jj|_dS)	Nz'Step 1 - Fetching and parsing HTML - %s�namezHTML string�namespace_html_elementsF�transport_encoding�override_encoding)�content_language)r(�info�getattr�
isinstancer�strr%r&�	tinyhtml5�parser5�base_url�url_fetcher�
media_type�
cssselect2�ElementWrapper�from_html_root�wrapper_element�
etree_element)�self�guess�filename�url�file_obj�string�encodingrErFrG�result�protocol_encoding�_�kwargss              r4�__init__z
HTML.__init__�s���	��5��
5�X�
5��
5��H�f�m�4�4�	6�	6�	6��h��%�%�	%��8�}�}�H���$�,�,�K���8�S�(�F�H�k�K�K��
�	9�A��(�,=�q�/��7�F� �,�/@��+�,��#�.6��*�+��_�X�8�8��8�8�F�
	9�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9����	9�	9�	9�	9�'�v�x�8�8��
�&���$���)�8�G�G��T� H� +� +���!�1�?����s�6*B,�,B0�3B0Fc�2�|rttgStgS�N)�HTML5_UA_STYLESHEET�HTML5_UA_FORM_STYLESHEET)rM�formss  r4�_ua_stylesheetszHTML._ua_stylesheets�s ���	C�'�)A�B�B�#�$�$r6c�*�tj��gSrZ)�HTML5_UA_COUNTER_STYLE�copy�rMs r4�_ua_counter_stylezHTML._ua_counter_style�s��&�+�-�-�.�.r6c��tgSrZ)�HTML5_PH_STYLESHEETrbs r4�_ph_stylesheetszHTML._ph_stylesheets�s��#�$�$r6c�
�t|��tt��z
D]}tjd|���t���}|�|��|}t
j|||||��S)a�Lay out and paginate the document, but do not (yet) export it.

        This returns a :class:`document.Document` object which provides
        access to individual pages and various meta-data.
        See :meth:`write_pdf` to get a PDF directly.

        :type font_config: :class:`text.fonts.FontConfiguration`
        :param font_config:
            A font configuration handling ``@font-face`` rules.
        :type counter_style: :class:`css.counters.CounterStyle`
        :param counter_style:
            A dictionary storing ``@counter-style`` rules.
        :param options:
            The ``options`` parameter includes by default the
            :data:`DEFAULT_OPTIONS` values.
        :returns: A :class:`document.Document` object.

        zUnknown rendering option: %s.)�setrr'�warningra�updater �_render)rM�font_config�
counter_style�color_profiles�options�unknown�new_optionss       r4�renderzHTML.render�s���(�7�|�|�c�/�&:�&:�:�	E�	E�G��N�:�G�D�D�D�D�%�*�*�,�,�����7�#�#�#������+�}�n�g�G�G�	Gr6r$c��t���}|�|��|}|j|||fi|��j|||fi|��S)aERender the document to a PDF file.

        This is a shortcut for calling :meth:`render`, then
        :meth:`Document.write_pdf() <document.Document.write_pdf>`.

        :type target:
            :class:`str`, :class:`pathlib.Path` or :term:`file object`
        :param target:
            A filename where the PDF file is generated, a file object, or
            :obj:`None`.
        :param float zoom:
            The zoom factor in PDF units per CSS units.  **Warning**:
            All CSS units are affected, including physical units like
            ``cm`` and named sizes like ``A4``.  For values other than
            1, the physical CSS units will thus be "wrong".
        :type finisher: :term:`callable`
        :param finisher:
            A finisher function or callable that accepts the document and a
            :class:`pydyf.PDF` object as parameters. Can be passed to perform
            post-processing on the PDF right before the trailer is written.
        :type font_config: :class:`text.fonts.FontConfiguration`
        :param font_config:
            A font configuration handling ``@font-face`` rules.
        :type counter_style: :class:`css.counters.CounterStyle`
        :param counter_style:
            A dictionary storing ``@counter-style`` rules.
        :param options:
            The ``options`` parameter includes by default the
            :data:`DEFAULT_OPTIONS` values.
        :returns:
            The PDF as :obj:`bytes` if ``target`` is not provided or
            :obj:`None`, otherwise :obj:`None` (the PDF is written to
            ``target``).

        )rrarjrr�	write_pdf)	rM�target�zoom�finisherrlrmrnrorqs	         r4rtzHTML.write_pdf�ss��J&�*�*�,�,�����7�#�#�#���
�K�D�K��]�N�N�N�g�N�N�
�v�t�X�
:�
:�18�
:�
:�	;r6)	NNNNNNNNr8)F)NNN)Nr$NNNN)
�__name__�
__module__�__qualname__�__doc__rXr^rcrfrrrt�r6r4rrrs�������*�*�VFJ�6:�.5�@�@�@�@�6%�%�%�%�
/�/�/�%�%�%�G�G�G�G�87;�GK�*;�*;�*;�*;�*;�*;r6rc�$�eZdZdZ					dd�ZdS)ra#CSS stylesheet parsed by tinycss2.

    An instance is created in the same way as :class:`HTML`, with the same
    arguments.

    An additional argument called ``font_config`` must be provided to handle
    ``@font-face`` rules. The same ``text.fonts.FontConfiguration`` object
    must be used for different ``CSS`` objects applied to the same document.

    ``CSS`` objects have no public attributes or methods. They are only meant
    to be used in the :meth:`HTML.write_pdf` and :meth:`HTML.render` methods
    of :class:`HTML` objects.

    NFr8c
�j�tjd|p|pt|dd����|�t��}t	||||||||	���}|5\}}}}|���}t
|t��rtj	|��}ntj
|||���\}}ddd��n#1swxYwY||_|ptj
��|_|�gn||_|�gn||_|�in|}|
�in|
}
t#|
||||j|j|j|||
|���dS)Nz&Step 2 - Fetching and parsing CSS - %sr:z
CSS string)rErF�check_css_mime_type)�environment_encodingrU)�layer)r(r?r@r%r&�readrArB�tinycss2�parse_stylesheet�parse_stylesheet_bytesrErH�Matcher�matcher�
page_rules�layers�preprocess_stylesheet)rMrNrOrPrQrRrSrErF�_check_mime_typerGrlrmrnr�r�r�r�rTrU�	mime_type�css�
stylesheetrVs                        r4rXzCSS.__init__s���
	��4��F��F�w�x���F�F�	H�	H�	H���$�,�,�K���8�S�(�F�X�#�9I�K�K�K���	9�I��(�,=�y��-�-�/�/�C��#�s�#�#�
9�%�6�s�;�;�
�
� (� ?��h�&7�!9�!9�!9�
�
�A�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9����	9�	9�	9�	9�!��
��6�*�"4�"6�"6��� *� 2�"�"�
���"�N�b�b����+�3����
�-�5���>�����*�k�4�<��O�T�[�+�}�n��	�	�	�	�	�	s�AB<�<C�C)NNNNNNNNFr8NNNNNNN�rxryrzr{rXr|r6r4rr
sE������
�
�SW�RW�EI�LP��	�����r6rc�"�eZdZdZ				dd�ZdS)ra�File attachment for a PDF document.

    An instance is created in the same way as :class:`HTML`, except that the
    HTML specific arguments (``encoding`` and ``media_type``) are not
    supported.

    :param str name:
        The name of the attachment to be included in the PDF document.
        May be :obj:`None`.
    :param str description:
        A description of the attachment to be included in the PDF document.
        May be :obj:`None`.
    :type created: :obj:`datetime.datetime`
    :param created:
        Creation date and time. Default is current date and time.
    :type modified: :obj:`datetime.datetime`
    :param modified:
        Modification date and time. Default is current date and time.
    :param str relationship:
        A string that represents the relationship between the attachment and
        the PDF it is embedded in. Default is 'Unspecified', other common
        values are defined in ISO-32000-2:2020, 7.11.3.

    N�Unspecifiedc
	��|�t��}t|||||||���|_||_|	|_||_d|_|
�7|r"tjt|����}
ntj
��}
|�7|r"tjt|����}ntj
��}|
|_||_
dS)N)rErF)r%r&�sourcer:�description�relationship�md5r�
fromtimestampr�nowr�created�modified)
rMrNrOrPrQrRrErFr:r�r�r�r�s
             r4rXzAttachment.__init__Vs�����$�,�,�K�#��8�S�(�F�X�#�%�%�%�����	�&���(�������?��
)�"�0��(�1C�1C�D�D���"�,�.�.�����
*�#�1�(�8�2D�2D�E�E���#�<�>�>����� ��
�
�
r6)NNNNNNNNNNNr�r�r|r6r4rr=sB��������0FJ�DH�:>�+�!�!�!�!�!�!r6r)r�)r`r[r\re)r r!)%r{r�os.pathrr�pathlibr�urllib.parserrHr�rCrr"r�__all__�urlsr%r#r&�loggerr'r(r5rrrr�r��htmlr`r[r\re�documentr r!r|r6r4�<module>r�s�����������&�&�&�&�&�&�&�&������� � � � � � ����������������+�b��4���4������d�	�
�4���4�
�����������D���u���E���T���u���D�� 
�4�!�"�%�#�$�
�'����,*�*�*��A�@�@�@�@�@�@�@�@�@�+�+�+�+�+�+�+�+�
���X;�X;�X;�X;�X;�X;�X;�X;�v-�-�-�-�-�-�-�-�`2!�2!�2!�2!�2!�2!�2!�2!�l'�&�&�&�&�&�������������%�$�$�$�$�$�$�$�$�$r6

Youez - 2016 - github.com/yon3zu
LinuXploit