"""
weasyprint.__main__
-------------------
Command-line interface to WeasyPrint.
"""
import argparse
import logging
import platform
import sys
import cairosvg
import pydyf
from . import HTML, LOGGER, __version__
from .text import pango
class PrintInfo(argparse.Action):
def __call__(*_, **__):
uname = platform.uname()
print('System:', uname.system)
print('Machine:', uname.machine)
print('Version:', uname.version)
print('Release:', uname.release)
print()
print('WeasyPrint version:', __version__)
print('Python version:', sys.version.split()[0])
print('Pydyf version:', pydyf.__version__)
print('Pango version:', pango.pango_version())
print('CairoSVG version:', cairosvg.__version__)
sys.exit()
def main(argv=None, stdout=None, stdin=None):
"""The ``weasyprint`` program takes at least two arguments:
.. code-block:: sh
weasyprint [options]