diff --git a/wpotd.py b/wpotd.py index 24133fe..2b0a97d 100644 --- a/wpotd.py +++ b/wpotd.py @@ -1,4 +1,12 @@ #!/usr/bin/env python3 -print('Content-Type: image/png') -print(open('out/waves.png', 'rb').read()) +import sys +import io +sys.path.append('..') +from waves import create_wpotd + +buf = io.BytesIO() +create_wpotd(buf) +sys.stdout.write('Content-Type: image/png\r\n\r\n') +sys.stdout.flush() +sys.stdout.buffer.write(buf.getvalue())