pep8: port script from master
pep8: W391 blank line at end of file
pep8: E703 statement ends with a semicolon
pep8: E111 indentation is not a multiple of four
pep8: W292 no newline at end of file
pep8: W293 blank line contains whitespace
pep8: E711 comparison to None should be 'if cond is None:'
pep8: E271 multiple spaces after keyword
pep8: E261 at least two spaces before inline comment