Make it work on OS X
Make script PEP-8 compliant on imports and whitespace
Remove unused variables
Merge pull request #1 from pkoch/osx

Make it work on OS X