GNOME Bugzilla – Bug 728182
PEP 8 Compliance
Last modified: 2014-09-13 02:10:39 UTC
Going forward we want to follow PEP 8 coding conventions (http://legacy.python.org/dev/peps/pep-0008/). We should start converting files to PEP 8. There is a pep8 tool to help check (https://pypi.python.org/pypi/pep8).
Created attachment 274275 [details] [review] Fixes mousetrap/__init__.py to comply with pep8.
Created attachment 275171 [details] [review] Bug 728182 - PEP 8 Compliance updated This patch contains PEP 8 Compliance changes for the /src/mousetrap/__init__.py. We ran the PEP 8 Compliance program before making changes to see what needed to be changed: bash-4.2$ sudo pep8 --first __init__.py __init__.py:21:7: E221 multiple spaces before operator Removed the white-spaces and verified with Compliance.
Created attachment 275177 [details] [review] Fixes mousetrap/ocvfw/__init__.py to comply with pep8.
Created attachment 275181 [details] [review] Fixes mousetrap/ocvfw/debug.py to comply with pep8.
Created attachment 275182 [details] [review] src/mousetrap/ocvfw/idm/finger.py for pep8 compliance
Review of attachment 275182 [details] [review]: Thanks for the patch, I've left a few comments that should line up with what is recommended by PEP8. ::: src/mousetrap/ocvfw/idm/finger.py @@ +54,3 @@ + MouseTrap's controller (mousetrap.py) when loaded. + - stgs: Possible settings loaded from the user's settings file. \ + If there aren't settings the IDM will use the a_settings dict. When inside docstrings (such as this), you do not need to end long lines with a backslash as the indentation whitespace does not have an impact. @@ +67,3 @@ ############################## +# self.step = self.settings.getint( "mouse", "stepSpeed" ) Dead code can be removed, moving the comment to the far left will cause compilation issues when a strict compiler is used.
Created attachment 275183 [details] [review] Fixes mousetrap/ocvfw/commons.py to comply with pep8.
Created attachment 275184 [details] [review] src/mousetrap/ocvfw/idm/finger.py for pep8 compliance Thanks for the advice, Kevin. I've updated the patch and made the corrections.
Created attachment 275185 [details] src/mousetrap/ocvfw/idm/forehead.py - for pep8 compliance
Created attachment 275187 [details] [review] Update several files for PEP8 compliance modified: src/mousetrap/__init__.py modified: src/mousetrap/ocvfw/commons.py modified: src/mousetrap/ocvfw/debug.py modified: src/mousetrap/ocvfw/dev/camera.py modified: src/mousetrap/ocvfw/pocv.py modified: src/test.py
Review of attachment 275183 [details] [review]: The PEP8 compliance made a change that changes the meaning of the code. In the original file, lines 52 through 59 have a function defined within a function. The outer function return the inner function. In the revised version, lines 56-63, the inner function is defined as a separate function at the same level as the original outer function. This changes the meaning of the code.
Review of attachment 274275 [details] [review]: Example. Committed the version by Joshua Anderson (attachment (id=275171) )
Review of attachment 275187 [details] [review]: The following files have been modified in other patches. src/mousetrap/__init__.py src/mousetrap/ocvfw/commons.py src/mousetrap/ocvfw/debug.py Please remove them from your patch and resubmit your patch. Below are directions to help you do that. Use the following commands to Make sure you are on the branch with the changes you submitted. git status git branch git log If you are not on the right branch, use this to change to the correct branch. git checkout 'branch that contains your changes' Now you have two choices. Either undo all your work and redo just those parts you want to resubmit. git reset --hard 'HEAD^' Or roll back to just before your last commit... git reset --soft 'HEAD^' ...and undo changes to those files that have conflicts. git checkout -- 'path/to/file1' 'path/to/file2' ... Now stage your changes, commit them, and create a patch. git add -A git commit -m'YOUR MESSAGE HERE' git format-patch 'HEAD^' Post the new patch file, and please make sure to check the box to invalidate your original patch.
(In reply to comment #9) > Created an attachment (id=275185) [details] > src/mousetrap/ocvfw/idm/forehead.py - for pep8 compliance This is not a patch.
Review of attachment 275181 [details] [review]: This patch is for ocvfw/__init__.py, which you already submitted.