After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 728182 - PEP 8 Compliance
PEP 8 Compliance
Status: RESOLVED FIXED
Product: mousetrap
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: mousetrap-maint
mousetrap-maint
Depends on:
Blocks:
 
 
Reported: 2014-04-14 14:04 UTC by Stoney Jackson
Modified: 2014-09-13 02:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes mousetrap/__init__.py to comply with pep8. (877 bytes, patch)
2014-04-14 14:11 UTC, Stoney Jackson
rejected Details | Review
Bug 728182 - PEP 8 Compliance updated (897 bytes, patch)
2014-04-25 21:44 UTC, Joshua Anderson
none Details | Review
Fixes mousetrap/ocvfw/__init__.py to comply with pep8. (935 bytes, patch)
2014-04-25 22:11 UTC, Brendan O'Dowd
none Details | Review
Fixes mousetrap/ocvfw/debug.py to comply with pep8. (935 bytes, patch)
2014-04-25 23:36 UTC, Brendan O'Dowd
rejected Details | Review
src/mousetrap/ocvfw/idm/finger.py for pep8 compliance (5.05 KB, patch)
2014-04-25 23:46 UTC, Chad Wade Day, Jr.
needs-work Details | Review
Fixes mousetrap/ocvfw/commons.py to comply with pep8. (2.22 KB, patch)
2014-04-26 00:05 UTC, Brendan O'Dowd
rejected Details | Review
src/mousetrap/ocvfw/idm/finger.py for pep8 compliance (5.01 KB, patch)
2014-04-26 00:34 UTC, Chad Wade Day, Jr.
none Details | Review
src/mousetrap/ocvfw/idm/forehead.py - for pep8 compliance (5.27 KB, text/plain)
2014-04-26 00:47 UTC, Ryan Murphy
  Details
Update several files for PEP8 compliance (9.55 KB, patch)
2014-04-26 00:58 UTC, tram611
needs-work Details | Review

Description Stoney Jackson 2014-04-14 14:04:49 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).
Comment 1 Stoney Jackson 2014-04-14 14:11:48 UTC
Created attachment 274275 [details] [review]
Fixes mousetrap/__init__.py to comply with pep8.
Comment 2 Joshua Anderson 2014-04-25 21:44:27 UTC
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.
Comment 3 Brendan O'Dowd 2014-04-25 22:11:19 UTC
Created attachment 275177 [details] [review]
Fixes mousetrap/ocvfw/__init__.py to comply with pep8.
Comment 4 Brendan O'Dowd 2014-04-25 23:36:58 UTC
Created attachment 275181 [details] [review]
Fixes mousetrap/ocvfw/debug.py to comply with pep8.
Comment 5 Chad Wade Day, Jr. 2014-04-25 23:46:08 UTC
Created attachment 275182 [details] [review]
src/mousetrap/ocvfw/idm/finger.py for pep8 compliance
Comment 6 Kevin Brown 2014-04-25 23:57:02 UTC
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.
Comment 7 Brendan O'Dowd 2014-04-26 00:05:26 UTC
Created attachment 275183 [details] [review]
Fixes mousetrap/ocvfw/commons.py to comply with pep8.
Comment 8 Chad Wade Day, Jr. 2014-04-26 00:34:57 UTC
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.
Comment 9 Ryan Murphy 2014-04-26 00:47:00 UTC
Created attachment 275185 [details]
src/mousetrap/ocvfw/idm/forehead.py - for pep8 compliance
Comment 10 tram611 2014-04-26 00:58:34 UTC
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
Comment 11 Heidi Ellis 2014-04-28 14:02:31 UTC
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.
Comment 12 Heidi Ellis 2014-04-28 14:02:49 UTC
Review of attachment 274275 [details] [review]:

Example. Committed the version by Joshua Anderson (attachment (id=275171) )
Comment 13 Stoney Jackson 2014-04-29 04:56:33 UTC
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.
Comment 14 Stoney Jackson 2014-05-16 15:45:33 UTC
(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.
Comment 15 Stoney Jackson 2014-05-16 16:08:25 UTC
Review of attachment 275181 [details] [review]:

This patch is for ocvfw/__init__.py, which you already submitted.