bit of a niche scenario here, and to test directly you'll need wkhtmltopdf (in this case listening to port 7000 w/ --read-args-from-stdin) up and running as a daemon (and a handy html file on hand.)
if I do:
echo "-s letter -T 24mm -R 24mm -B 0mm -g ~/my.html /tmp/my.pdf" | nc localhost 7000
then very swiftly out pops /tmp/my.pdf ... I can do this 25 times in a row and get as many results as if I spun wkhtmltopdf up and down 25 times separately.
Walp, that means I need to be able to call THIS from within our own queue-eating daemon and, further, I have to wait for it to finish before checking for the presence of results and ticking of successes or failures accordingly.
I found subprocess.call, but it's not working for reasons unspecified... to wit, from the python prompt:
call(['echo', '\"-s letter -T 24mm -R 24mm -B 0mm -g ~/my.html /tmp/my1.pdf\"', '|', 'nc', 'localhost', '7000'])
I get:
"-s letter -T 24mm -R 24mm -B 0mm -g ~my.html /tmp/my1.pdf" | nc localhost 7000
0
the 0 suggests it THINKs it was successful... but, unlike when I do the identical statement from the bash itself, nothing comes out of the wkhtmltopdf daemon. I tried sticking an extra 'echo ' in there since the printout doesn't include it, but same result.
So... somehow, this is not engaging things in the same way that is done when typed directly into the bash prompt.
Ideas? Expertise?
Thanks!