| 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 : |
�
Х=jS: � � � d Z ddlmZ ddlmZmZ ddlmZ ddlmZ ddl Z ddl
Z
ddlZdxZZ
i dd�d d�d
d�dd�dd�d
d�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�dd�ddd��Zg d�ZddlmZmZmZ ddlmZmZ d� Z G d � d!� � Z G d"� d#� � Z G d$� d%� � Zdd&lmZ dd'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 �� � t t | � 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_urlr5 d sp � � �d�=�#5�#5�f�#=�#=�>�>��E�E���%�!�%�%�f�b�1�1�7�7�9�9��� 4��,�d�3�3�3��� c �H � e Zd ZdZ dd�Zd
d�Zd� Zd� Zdd �Z dd�Z dS )r a3 HTML 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
�& � t j d|p|p|pt |dd� � � � t |t � � rt |� � }|�t
� � }t |||||||� � }
|
5 \ }}}}ddi}
|�||
d<