Not seriously tested yet.
Also, there are probably better ways to do this in Python. Suggestions are welcome.