1
0
Fork 1
mirror of https://github.com/andrewferrier/email2pdf.git synced 2025-03-18 05:52:59 +00:00

Convert to Python 3.0.

This commit is contained in:
Andrew Ferrier 2014-09-28 19:31:56 +01:00
parent 246cac017e
commit c8e8c9c1d4

View file

@ -1,6 +1,4 @@
#!/usr/bin/env python
from __future__ import print_function
#!/usr/bin/env python3
from datetime import datetime
from subprocess import Popen, PIPE
@ -64,9 +62,9 @@ def main():
if payload == None:
print("ERROR: Cannot find an appropriate payload in email.", file=sys.stderr)
else:
payload = "<html><body><pre>\n" + payload + "\n</pre></body></html>"
payload = bytes("<html><body><pre>\n", 'UTF-8') + payload + bytes("\n</pre></body></html>", 'UTF-8')
payload = header_info + payload
payload = bytes(header_info, 'UTF-8') + payload
p = Popen(['wkhtmltopdf', '-q', '--load-error-handling', 'ignore', '--load-media-error-handling', 'ignore', '-', output_file_name], stdin=PIPE)
output = p.communicate(input = payload)