3
VmW                 @   s@   d Z ddlZddlZddlmZmZ dddZedkr<e  dS )	z
    weasyprint.__main__
    -------------------

    Command-line interface to WeasyPrint.

    :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
    :license: BSD, see LICENSE for details.

    N   )VERSIONHTMLc             C   s
  t jddd}|jdddt dd |jd	d
dd |jddddgdd |jddddd |jddddd |jddtdd  |jd!d"d |jd#d$dd%d |jd&d'd |jd(d)d |j| }|jd*kr|jj }|j	d+rd}n|j	d,rd}n
|j
d- n
|jj }|jd.krJ|d*kr.tj}t|d/|}|jsPd0|_n|j}|jd.krz|d*krltj}t|d/|}n|j}d1|ji}	|jr|dkr|j|	d2< n
|j
d3 |jr|dkr|j|	d4< n
|j
d5 t||j|j|jd6}
t|
d7| |f|	 d*S )8u<  The ``weasyprint`` program takes at least two arguments:

    .. code-block:: sh

        weasyprint [options] <input> <output>

    The input is a filename or URL to an HTML document, or ``-`` to read
    HTML from stdin. The output is a filename, or ``-`` to write to stdout.

    Options can be mixed anywhere before, between or after the input and
    output:

    .. option:: -e <input_encoding>, --encoding <input_encoding>

        Force the input character encoding (eg. ``-e utf8``).

    .. option:: -f <output_format>, --format <output_format>

        Choose the output file format among PDF and PNG (eg. ``-f png``).
        Required if the output is not a ``.pdf`` or ``.png`` filename.

    .. option:: -s <filename_or_URL>, --stylesheet <filename_or_URL>

        Filename or URL of a user CSS stylesheet (see
        :ref:`stylesheet-origins`\.) to add to the document.
        (eg. ``-s print.css``). Multiple stylesheets are allowed.

    .. option:: -r <dpi>, --resolution <dpi>

        For PNG output only. Set the resolution in PNG pixel per CSS inch.
        Defaults to 96, which means that PNG pixels match CSS pixels.

    .. option:: --base-url <URL>

        Set the base for relative URLs in the HTML input.
        Defaults to the input’s own URL, or the current directory for stdin.

    .. option:: -m <type>, --media-type <type>

        Set the media type to use for ``@media``. Defaults to ``print``.

    .. option:: -a <file>, --attachment <file>

        Adds an attachment to the document which is included in the PDF output.
        This option can be added multiple times to attach more files.

    .. option:: --version

        Show the version number. Other options and arguments are ignored.

    .. option:: -h, --help

        Show the command-line usage. Other options and arguments are ignored.

    
weasyprintz Renders web pages to PDF or PNG.)progdescriptionz	--versionversionzWeasyPrint version %sz+Print WeasyPrint's version number and exit.)actionr   helpz-ez
--encodingzCharacter encoding of the input)r
   z-fz--formatZpdfZpngzMOutput format. Can be ommited if `output` ends with a .pdf or .png extension.)choicesr
   z-sz--stylesheetappendzGURL or filename for a user CSS stylesheet. May be given multiple times.)r	   r
   z-mz--media-typeprintz/Media type to use for @media, defaults to print)defaultr
   z-rz--resolutionz\PNG only: the resolution in pixel per CSS inch. Defaults to 96, one PNG pixel per CSS pixel.)typer
   z
--base-urlzyBase for relative URLs in the HTML input. Defaults to the input's own filename or URL or the current directory for stdin.z-az--attachmentz7URL or filename of a file to attach to the PDF documentinputz1URL or filename of the HTML input, or - for stdinoutputz1Filename where output is written, or - for stdoutNz.pdfz.pngzWEither sepecify a format with -f or choose an output filename that ends in .pdf or .png-buffer.Zstylesheets
resolutionz---resolution only applies for the PNG format.attachmentsz---attachment only applies for the PDF format.)base_urlencoding
media_typeZwrite_)argparseArgumentParseradd_argumentr   float
parse_argsformatr   lowerendswitherrorr   sysstdingetattrr   stdoutZ
stylesheetr   
attachmentr   r   r   )argvr&   r$   parserargsZoutput_lowerZformat_sourcer   kwargshtml r.   S/var/www/html/enquirykeeper_venv/lib/python3.6/site-packages/weasyprint/__main__.pymain   sr    8



















r0   __main__)NNN)__doc__r#   r    r   r   r0   __name__r.   r.   r.   r/   <module>   s   
 
