Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pep8 ification #7

Merged
merged 42 commits into from
Jan 23, 2019
Merged

Conversation

christian-intra2net
Copy link
Collaborator

The python source code did not comply with python coding standards. Ran the pep8 and pylint static code checkers on all python source files (except threadpool and progressbar which have nothing to do with file(1) functionality). Fixed most of the regressions reported. Mainly:

  • added doc strings to modules and functions
  • indent with 4 spaces instead of tabs
  • 2 lines of whitespace between functions
  • limit line length to 79
  • replace single-letter variables
  • use the print() function
  • create main() functions
  • use the with() statement for open()ing files, for cleaner exit in error case

This should simplify moving to python3 (py2 support ends 2020)

Fix whitespace
Shorten long lines
Use print() function
Add doc strings
Replace single-letter variable names
Define main() function
Add TODOs for more changes
@christian-intra2net
Copy link
Collaborator Author

Feel free to criticize, otherwise I will merge this in a few days

@zoulasc
Copy link
Contributor

zoulasc commented Jan 22, 2019

@christian-intra2net , go for it. But the tests are failing because they are now picking a different shared library?

@glensc
Copy link
Member

glensc commented Jan 22, 2019

LGTM for merge

as for wrong library, there's unfinished PR: #4 it was never finished

@zoulasc
Copy link
Contributor

zoulasc commented Jan 22, 2019

Well, PR#4 (I just saw it) is really "hand hurts, cut hand". Perhaps this can be fixed using {,DY}LD_LIBRARY_PATH... so that the file we are testing can find and use the local libmagic.

@christian-intra2net christian-intra2net merged commit ca2841c into file:master Jan 23, 2019
@christian-intra2net christian-intra2net deleted the pep8-ification branch January 23, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants