Fix scripts to comply with PEP8 1.5.0 (rebased onto dev_4_4)



This is the same as gh-72 but rebased onto dev_4_4.

----

This should fix the Travis build since PEP8 has been bumped to version 1.5.0

To test this PR, check the Travis build is green and no functionality is altered by the code changes.