示例#1
0
def _run(args, stdin=b''):
    stdin = io.BytesIO(stdin)
    stdout = io.BytesIO()
    try:
        __main__.HTML = FakeHTML
        __main__.main(args.split(), stdin=stdin, stdout=stdout)
    finally:
        __main__.HTML = HTML
    return stdout.getvalue()
示例#2
0
#!/home/nicolas/dev/WeasyPrint/env/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from weasyprint.__main__ import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
#!/usr/bin/env python
from weasyprint.__main__ import main

if __name__ == '__main__':
    main()