The python script is already adapted to the timeout option of mist.
During the implementation of this feature I found and fix some problems with the script's output