Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
0øªjò6 ã @ sú d Z ddlZddlmZ ddlZddlZddlZd ZZddddd d
ddgZ d
dl
mZmZm
Z
mZmZ d
dlmZmZ G dd„ dƒZG dd„ dƒZG dd„ dƒZejddddddedfdd„ƒZd
dlmZ d
dlmZmZmZmZ d
dlm Z m!Z! dS )z¶
WeasyPrint
==========
WeasyPrint converts web documents to PDF.
The public API is what is accessible from this "root" packages
without importing sub-modules.
é N)ÚPathz54.3ÚHTMLÚCSSÚ
AttachmentÚDocumentÚPageÚdefault_url_fetcherÚVERSIONÚ__version__é )Úfetchr Úpath2urlÚ
ensure_urlÚurl_is_absolute)ÚLOGGERÚPROGRESS_LOGGERc
@ sX e Zd ZdZdddddddedf dd„Zdd„ Zdd „ Zd
d„ Zddd„Z ddd„Z
dS )r ad HTML document parsed by html5lib.
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.
:param str base_url: The base used to resolve relative URLs
(e.g. in ``
``). If not provided, try to use
the input filename, URL, or ``name`` attribute of :term:`file objects
`.
:type url_fetcher: :term:`function`
:param url_fetcher: A function or other callable
with the same signature as :func:`default_url_fetcher` called to
fetch external resources such as stylesheets and images.
(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
C s° t jd|p|p|pt|ddƒƒ t|||||||ƒ}
|
�:\}}}}
t|tƒr\tj|dd�}
ntj|||
dd�}
W d Q R X t|
|ƒ| _ || _
| | _tj
j|
d d�| _| jj| _d S )Nz'Step 1 - Fetching and parsing HTML - %sÚnamezHTML stringF)ÚnamespaceHTMLElements)Úoverride_encodingÚtransport_encodingr )Zcontent_language)r ÚinfoÚgetattrÚ_select_sourceÚ
isinstanceÚstrÚhtml5libÚparseÚ
find_base_urlÚbase_urlÚurl_fetcherÚ
media_typeÚ
cssselect2ZElementWrapperZfrom_html_rootZwrapper_elementZ
etree_element)ÚselfÚguessÚfilenameÚurlÚfile_objÚstringÚencodingr r r! ÚresultÚsource_typeÚsourceÚprotocol_encoding© r. ú9/tmp/pip-build-_d5lkt3n/weasyprint/weasyprint/__init__.pyÚ__init__J s&