dagwieers/unoconv — pull request #201 by l3thal (2014-05-07 17:06:28+00:00)
Title: fixes issue where conversion fails with no output with --stdout option 

stdout buffer is never flushed, therefore shouldn't be used.
writing directly to stdout solves the problem

```
root@app0:~# python --version; date
Python 2.7.3
Wed May 7 12:29:31 EDT 2014
root@app0:~# unoconv -vvv -f html sample.docx
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=32584)
Input file: sample.docx
Selected output format: HTML Document (OpenOffice.org Writer) [.html]
Selected office filter: HTML (StarWriter)
Used doctype: document
Output file: sample.html
DEBUG: Terminating LibreOffice instance.
DEBUG: Waiting for LibreOffice instance to exit.
You have new mail in /var/mail/root

root@app0:~# ls -al sample.html
-rw-r--r-- 1 root root 114969 May 7 12:30 sample.html
root@app0:~# unoconv --stdout -vvv -f html sample.docx
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=32605)
Input file: sample.docx
Selected output format: HTML Document (OpenOffice.org Writer) [.html]
Selected office filter: HTML (StarWriter)
Used doctype: document
DEBUG: Terminating LibreOffice instance.
DEBUG: Waiting for LibreOffice instance to exit.
```
Also, empty file is created if redirection is used
```
root@app0:~# unoconv --stdout -vvv -f html sample.docx > /tmp/test
Verbosity set to level 3
Using office base path: /usr/lib/libreoffice
Using office binary path: /usr/lib/libreoffice/program
DEBUG: Connection type: socket,host=127.0.0.1,port=2002;urp;StarOffice.ComponentContext
DEBUG: Existing listener not found.
DEBUG: Launching our own listener using /usr/lib/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=32626)
Input file: sample.docx
Selected output format: HTML Document (OpenOffice.org Writer) [.html]
Selected office filter: HTML (StarWriter)
Used doctype: document
DEBUG: Terminating LibreOffice instance.
DEBUG: Waiting for LibreOffice instance to exit.
root@app0:~# ls -al /tmp/test; cat /tmp/test
-rw-r--r-- 1 root root 0 May 7 12:30 /tmp/test
```