dagwieers/unoconv — pull request #101 by s0600204 (2012-11-26 19:05:23+00:00)
Title: Detection and setting of HOME environment variable for Open/LibreOffice to use

When run, Unoconv now checks to see if the HOME environment variable is set and valid (i.e. exists and is writeable to). If neither of these things or if the user passes a '-H' argument, then Unoconv creates a temporary folder and sets that as HOME for the duration of the conversion, deleting it and its contents after use.

The user can also specify (with '--home=PATH') an alternate directory to use as HOME, and Unoconv will check that this is usable, defaulting to the user's HOME if not or a temporary folder if the user's HOME is not valid either.

As using a folder that has never been used before by Open/LibreOffice as HOME will cause Office to exit with code 81 (normal restart), Unoconv will catch this and try again. Unoconv will attempt to do this three times (four if you include the initial invocation) before giving up (to prevent an endless start-quit-start-quit cycle).

With any luck this should resolve issue #87. It certainly does for me. :smile: May also resolve issues 85 and 86.