Skip to content

Pep8 ification#7

Merged
christian-intra2net merged 42 commits into
file:masterfrom
christian-intra2net:pep8-ification
Jan 23, 2019
Merged

Pep8 ification#7
christian-intra2net merged 42 commits into
file:masterfrom
christian-intra2net:pep8-ification

Conversation

@christian-intra2net

Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

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

@zoulasc

zoulasc commented Jan 22, 2019

Copy link
Copy Markdown
Contributor

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

@glensc

glensc commented Jan 22, 2019

Copy link
Copy Markdown
Member

LGTM for merge

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

@zoulasc

zoulasc commented Jan 22, 2019

Copy link
Copy Markdown
Contributor

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.

4 participants