Letractively / pytof

Automatically exported from code.google.com/p/pytof
Other
0 stars 1 forks source link

Enforce proper python coding style #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The coding style should be uniform through the application. We should follow 
the official python 
style guide (http://www.python.org/dev/peps/pep-0008/). Using a tool such as 
pylint could be 
useful.

Original issue reported on code.google.com by mathieu....@gmail.com on 8 Jan 2007 at 9:00

GoogleCodeExporter commented 8 years ago
I have started with pychecker. Here are things to correct.

[bsergean@marge1 pytof]$ pychecker *.py
Processing albumdataparser...
Processing config...
Processing exif...
Processing ftp...
Processing __init__...
Processing log...
Processing makefs...
Processing makepage...
Processing photo...
Processing utils...

Warnings...

/usr/lib/python2.4/ftplib.py:292: Local variable (resp) not used
/usr/lib/python2.4/ftplib.py:395: Local variable (resp) not used
/usr/lib/python2.4/ftplib.py:505: Function return types are inconsistent

/usr/lib/python2.4/glob.py:24: (list) shadows builtin
/usr/lib/python2.4/glob.py:26: (list) shadows builtin

/usr/lib/python2.4/posixpath.py:171: Local variable (st) not used

albumdataparser.py:36: (id) shadows builtin
albumdataparser.py:40: Parameter (name) not used
albumdataparser.py:46: Parameter (name) not used
albumdataparser.py:87: Local variable (res) not used
albumdataparser.py:130: No global (data) found
albumdataparser.py:131: (id) shadows builtin
albumdataparser.py:174: Raising an exception on a non-Exception object
(AlbumDataParserError)
albumdataparser.py:184: (list) shadows builtin
albumdataparser.py:193: Parameter (attrs) not used
albumdataparser.py:236: Invalid arguments to (__init__), got 0, expected 2

config.py:19: Imported module (getopt) not used
config.py:20: (help) shadows builtin
config.py:89: No global (confFilename) found

exif.py:777: (slice) shadows builtin
exif.py:792: Local variable (i) not used
exif.py:865: Local variable (j) not used
exif.py:977: Local variable (model) not used

ftp.py:20: (exit) shadows builtin
ftp.py:51: Redefining attribute (upload) original line (44)

makefs.py:16: Variable (__dependencies__) not used
makefs.py:38: (id) shadows builtin

makepage.py:17: Variable (__dependencies__) not used
makepage.py:26: Imported module (getopt) not used
makepage.py:27: (help) shadows builtin
makepage.py:264: No global (error) found
makepage.py:285: (id) shadows builtin
makepage.py:301: Local variable (photoPageName) not used

photo.py:53: Parameter (date) not used
photo.py:103: Local variable (cropLength) not used

utils.py:137: Local variable (mod) shadows global defined on line 0 in file 
<unknown>
utils.py:139: Local variable (mod) shadows global defined on line 0 in file 
<unknown>
utils.py:141: Local variable (mod) shadows global defined on line 0 in file 
<unknown>
utils.py:174: Raising an exception on a non-Exception object (BadYear)
utils.py:176: Raising an exception on a non-Exception object (BadYear)
utils.py:185: (dir) shadows builtin
utils.py:186: (dir) shadows builtin
utils.py:188: Raising an exception on a non-Exception object 
(BadMusicDirectoryName)
utils.py:194: Raising an exception on a non-Exception object 
(BadMusicDirectoryName)

Original comment by bserg...@gmail.com on 9 Jan 2007 at 9:19

GoogleCodeExporter commented 8 years ago
Less errors in revision 156

[bsergean@marge1 pytof]$ pychecker *.py | grep -v python2.4
Processing albumdataparser...
Processing config...
Processing exif...
Processing ftp...
Processing __init__...
Processing log...
Processing makefs...
Processing makepage...
Processing photo...
Processing utils...

Warnings...

albumdataparser.py:40: Parameter (name) not used
albumdataparser.py:46: Parameter (name) not used
albumdataparser.py:192: Parameter (attrs) not used

exif.py:777: (slice) shadows builtin
exif.py:792: Local variable (i) not used
exif.py:865: Local variable (j) not used
exif.py:977: Local variable (model) not used

Original comment by bserg...@gmail.com on 9 Jan 2007 at 9:47

GoogleCodeExporter commented 8 years ago
This should be in the wiki as a coding style guidelines, but not an issue as it 
will
never be really fixed, just waiting for new code to break it. The style is 
better
now, I close this to make some real bug triage.

Original comment by bserg...@gmail.com on 14 Mar 2007 at 9:42