script for automating pep8 checks.

On ubuntu/debian install these tools...

   sudo apt-get install pylint pyflakes python-setuptools python-pip
   sudo pip install pep8

then run from blenders source dir...
   python release/test/pep8.py

This searches for the comments "# <pep8 compliant>" and "# <pep8-80 compliant>", running the checking tools on these scripts only.

* some minor pep8 corrections too.
This commit is contained in:
2009-12-13 13:59:16 +00:00
parent c1bfd014bd
commit a1656300ba
20 changed files with 230 additions and 116 deletions

View File

@@ -21,6 +21,7 @@
import bpy
import os
def expandpath(path):
if path.startswith("//"):
return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
@@ -44,15 +45,17 @@ _unclean_chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
_unclean_chars = ''.join([chr(i) for i in _unclean_chars])
def clean_name(name, replace="_"):
'''
All characters besides A-Z/a-z, 0-9 are replaced with "_"
or the replace argumet if defined.
'''
for ch in _unclean_chars:
name = name.replace(ch, replace)
name = name.replace(ch, replace)
return name
def display_name(name):
'''
Only capitalize all lowercase names, mixed case use them as is.
@@ -75,6 +78,7 @@ def display_name(name):
_scripts = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
_scripts = (os.path.normpath(_scripts), )
def script_paths(*args):
scripts = list(_scripts)
@@ -105,6 +109,7 @@ def script_paths(*args):
_presets = os.path.join(_scripts[0], "presets") # FIXME - multiple paths
def preset_paths(subdir):
'''
Returns a list of paths for a spesific preset.