Dump of a basically rewritten pyflyspray.py...