Working inprocess Qt kernel; tidied using pyflakes and PEP8