pep8 edits and avoid naming conflicts with python builtins
This commit is contained in:
@@ -75,14 +75,14 @@ def svn_step(branch=''):
|
||||
return SVN(baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/blender', mode='update', defaultBranch='trunk', workdir='blender')
|
||||
|
||||
|
||||
def lib_svn_step(dir):
|
||||
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
|
||||
def lib_svn_step(libdir):
|
||||
return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + libdir, mode='update', defaultBranch='trunk', workdir='lib/' + libdir)
|
||||
|
||||
# generic builder
|
||||
|
||||
|
||||
def generic_builder(id, libdir='', branch=''):
|
||||
filename = 'buildbot_upload_' + id + '.zip'
|
||||
def generic_builder(idname, libdir='', branch=''):
|
||||
filename = 'buildbot_upload_' + idname + '.zip'
|
||||
compile_script = '../blender/build_files/buildbot/slave_compile.py'
|
||||
test_script = '../blender/build_files/buildbot/slave_test.py'
|
||||
pack_script = '../blender/build_files/buildbot/slave_pack.py'
|
||||
@@ -93,10 +93,10 @@ def generic_builder(id, libdir='', branch=''):
|
||||
if libdir != '':
|
||||
f.addStep(lib_svn_step(libdir))
|
||||
|
||||
f.addStep(Compile(command=['python', compile_script, id]))
|
||||
f.addStep(Test(command=['python', test_script, id]))
|
||||
f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
|
||||
if id.find('cmake') != -1:
|
||||
f.addStep(Compile(command=['python', compile_script, idname]))
|
||||
f.addStep(Test(command=['python', test_script, idname]))
|
||||
f.addStep(ShellCommand(name='package', command=['python', pack_script, idname, branch], description='packaging', descriptionDone='packaged'))
|
||||
if 'cmake' in idname:
|
||||
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024))
|
||||
else:
|
||||
f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=100 * 1024 * 1024, workdir='install'))
|
||||
|
||||
@@ -84,12 +84,12 @@ if builder.find('scons') != -1:
|
||||
sys.exit(retcode)
|
||||
|
||||
# clean release directory if it already exists
|
||||
dir = 'release'
|
||||
release_dir = 'release'
|
||||
|
||||
if os.path.exists(dir):
|
||||
for f in os.listdir(dir):
|
||||
if os.path.isfile(os.path.join(dir, f)):
|
||||
os.remove(os.path.join(dir, f))
|
||||
if os.path.exists(release_dir):
|
||||
for f in os.listdir(release_dir):
|
||||
if os.path.isfile(os.path.join(release_dir, f)):
|
||||
os.remove(os.path.join(release_dir, f))
|
||||
|
||||
# create release package
|
||||
try:
|
||||
@@ -99,16 +99,16 @@ except Exception, ex:
|
||||
sys.exit(1)
|
||||
|
||||
# find release directory, must exist this time
|
||||
if not os.path.exists(dir):
|
||||
sys.stderr.write("Failed to find release directory.\n")
|
||||
if not os.path.exists(release_dir):
|
||||
sys.stderr.write("Failed to find release directory %r.\n" % release_dir)
|
||||
sys.exit(1)
|
||||
|
||||
# find release package
|
||||
file = None
|
||||
filepath = None
|
||||
|
||||
for f in os.listdir(dir):
|
||||
rf = os.path.join(dir, f)
|
||||
for f in os.listdir(release_dir):
|
||||
rf = os.path.join(release_dir, f)
|
||||
if os.path.isfile(rf) and f.startswith('blender'):
|
||||
file = f
|
||||
filepath = rf
|
||||
|
||||
@@ -11,13 +11,13 @@ from bge import texture
|
||||
|
||||
def createTexture(cont):
|
||||
"""Create a new Dynamic Texture"""
|
||||
object = cont.owner
|
||||
obj = cont.owner
|
||||
|
||||
# get the reference pointer (ID) of the internal texture
|
||||
ID = texture.materialID(object, 'IMoriginal.png')
|
||||
ID = texture.materialID(obj, 'IMoriginal.png')
|
||||
|
||||
# create a texture object
|
||||
object_texture = texture.Texture(object, ID)
|
||||
object_texture = texture.Texture(obj, ID)
|
||||
|
||||
# create a new source with an external image
|
||||
url = logic.expandPath("//newtexture.jpg")
|
||||
|
||||
@@ -6,7 +6,7 @@ set(INC
|
||||
../kernel/svm
|
||||
../util
|
||||
../subd
|
||||
../../../intern/guardedalloc
|
||||
../../guardedalloc
|
||||
../../../source/blender/makesdna
|
||||
../../../source/blender/makesrna
|
||||
../../../source/blender/blenloader
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
import bpy
|
||||
from bpy.props import *
|
||||
from bpy.props import (EnumProperty,
|
||||
FloatProperty,
|
||||
IntProperty,
|
||||
PointerProperty)
|
||||
|
||||
import math
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ def find_node(material, nodetype):
|
||||
ntree = material.node_tree
|
||||
|
||||
for node in ntree.nodes:
|
||||
if hasattr(node, 'type') and node.type == nodetype:
|
||||
if getattr(node, "type", None) == nodetype:
|
||||
return node
|
||||
|
||||
return None
|
||||
@@ -363,14 +363,14 @@ def find_node_input(node, name):
|
||||
return None
|
||||
|
||||
|
||||
def panel_node_draw(layout, id, output_type, input_name):
|
||||
if not id.node_tree:
|
||||
layout.prop(id, "use_nodes", icon='NODETREE')
|
||||
def panel_node_draw(layout, id_data, output_type, input_name):
|
||||
if not id_data.node_tree:
|
||||
layout.prop(id_data, "use_nodes", icon='NODETREE')
|
||||
return False
|
||||
|
||||
ntree = id.node_tree
|
||||
ntree = id_data.node_tree
|
||||
|
||||
node = find_node(id, output_type)
|
||||
node = find_node(id_data, output_type)
|
||||
if not node:
|
||||
layout.label(text="No output node.")
|
||||
else:
|
||||
|
||||
@@ -61,12 +61,12 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
|
||||
|
||||
# get mesh
|
||||
scene = context.scene
|
||||
object = context.object
|
||||
obj = context.object
|
||||
|
||||
if not object:
|
||||
if not obj:
|
||||
raise Exception("No active object")
|
||||
|
||||
mesh = object.to_mesh(scene, True, 'PREVIEW')
|
||||
mesh = obj.to_mesh(scene, True, 'PREVIEW')
|
||||
|
||||
if not mesh:
|
||||
raise Exception("No mesh data in active object")
|
||||
|
||||
@@ -171,7 +171,9 @@ def modules(module_cache):
|
||||
mod = None
|
||||
|
||||
if mod is None:
|
||||
mod = fake_module(mod_name, mod_path, force_support=force_support)
|
||||
mod = fake_module(mod_name,
|
||||
mod_path,
|
||||
force_support=force_support)
|
||||
if mod:
|
||||
module_cache[mod_name] = mod
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ def user_script_path():
|
||||
return None
|
||||
|
||||
|
||||
def script_paths(subdir=None, user_pref=True, all=False):
|
||||
def script_paths(subdir=None, user_pref=True, check_all=False):
|
||||
"""
|
||||
Returns a list of valid script paths.
|
||||
|
||||
@@ -271,9 +271,9 @@ def script_paths(subdir=None, user_pref=True, all=False):
|
||||
:type subdir: string
|
||||
:arg user_pref: Include the user preference script path.
|
||||
:type user_pref: bool
|
||||
:arg all: Include local, user and system paths rather just the paths
|
||||
:arg check_all: Include local, user and system paths rather just the paths
|
||||
blender uses.
|
||||
:type all: bool
|
||||
:type check_all: bool
|
||||
:return: script paths.
|
||||
:rtype: list
|
||||
"""
|
||||
@@ -286,7 +286,7 @@ def script_paths(subdir=None, user_pref=True, all=False):
|
||||
else:
|
||||
user_script_path = None
|
||||
|
||||
if all:
|
||||
if check_all:
|
||||
# all possible paths
|
||||
base_paths = tuple(_os.path.join(resource_path(res), "scripts")
|
||||
for res in ('LOCAL', 'USER', 'SYSTEM'))
|
||||
@@ -343,7 +343,7 @@ def preset_paths(subdir):
|
||||
:rtype: list
|
||||
"""
|
||||
dirs = []
|
||||
for path in script_paths("presets", all=True):
|
||||
for path in script_paths("presets", check_all=True):
|
||||
directory = _os.path.join(path, subdir)
|
||||
if not directory.startswith(path):
|
||||
raise Exception("invalid subdir given %r" % subdir)
|
||||
@@ -432,9 +432,9 @@ def keyconfig_set(filepath):
|
||||
keyconfigs_old = keyconfigs[:]
|
||||
|
||||
try:
|
||||
file = open(filepath)
|
||||
exec(compile(file.read(), filepath, 'exec'), {"__file__": filepath})
|
||||
file.close()
|
||||
keyfile = open(filepath)
|
||||
exec(compile(keyfile.read(), filepath, 'exec'), {"__file__": filepath})
|
||||
keyfile.close()
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -72,7 +72,7 @@ def reduce_spaces(text):
|
||||
return RE_SPACE.sub(' ', text)
|
||||
|
||||
|
||||
def get_doc(object):
|
||||
def get_doc(obj):
|
||||
"""Get the doc string or comments for an object.
|
||||
|
||||
:param object: object
|
||||
@@ -82,7 +82,7 @@ def get_doc(object):
|
||||
>>> get_doc(abs)
|
||||
'abs(number) -> number\\n\\nReturn the absolute value of the argument.'
|
||||
"""
|
||||
result = inspect.getdoc(object) or inspect.getcomments(object)
|
||||
result = inspect.getdoc(obj) or inspect.getcomments(obj)
|
||||
return result and RE_EMPTY_LINE.sub('', result.rstrip()) or ''
|
||||
|
||||
|
||||
|
||||
@@ -454,15 +454,15 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
layout.separator()
|
||||
|
||||
layout.prop(md, "use_normals")
|
||||
|
||||
|
||||
split = layout.split()
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.prop(md, "use_foam")
|
||||
sub = col.row()
|
||||
sub.active = md.use_foam
|
||||
sub.prop(md, "foam_coverage", text="Coverage")
|
||||
|
||||
|
||||
col = split.column()
|
||||
col.active = md.use_foam
|
||||
col.label("Foam Data Layer Name:")
|
||||
|
||||
@@ -456,7 +456,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
|
||||
file_format = rd.image_settings.file_format
|
||||
|
||||
layout.prop(rd, "filepath", text="")
|
||||
|
||||
|
||||
flow = layout.column_flow()
|
||||
flow.prop(rd, "use_overwrite")
|
||||
flow.prop(rd, "use_placeholder")
|
||||
|
||||
@@ -475,7 +475,7 @@ class CLIP_PT_stabilization(Panel):
|
||||
|
||||
def draw_header(self, context):
|
||||
stab = context.space_data.clip.tracking.stabilization
|
||||
|
||||
|
||||
self.layout.prop(stab, "use_2d_stabilization", text="")
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
@@ -1666,7 +1666,8 @@ static void write_customdata(WriteData *wd, ID *id, int count, CustomData *data,
|
||||
writestruct(wd, DATA, structname, datasize, layer->data);
|
||||
}
|
||||
else
|
||||
printf("error: this CustomDataLayer must not be written to file\n");
|
||||
printf("%s error: layer '%s':%d - can't be written to file\n",
|
||||
__func__, structname, layer->type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,11 @@ set(INC
|
||||
../imbuf
|
||||
../makesdna
|
||||
../makesrna
|
||||
../nodes # For node muting stuff...
|
||||
../nodes/intern # For node muting stuff...
|
||||
|
||||
# For node muting stuff...
|
||||
../nodes
|
||||
../nodes/intern
|
||||
|
||||
../../../intern/guardedalloc
|
||||
../../../intern/smoke/extern
|
||||
)
|
||||
|
||||
@@ -241,7 +241,7 @@ static PyObject *Euler_rotate(EulerObject * self, PyObject *value)
|
||||
return NULL;
|
||||
|
||||
eulO_to_mat3(self_rmat, self->eul, self->order);
|
||||
mul_m3_m3m3(rmat, self_rmat, other_rmat);
|
||||
mul_m3_m3m3(rmat, other_rmat, self_rmat);
|
||||
|
||||
mat3_to_compatible_eulO(self->eul, self->eul, self->order, rmat);
|
||||
|
||||
|
||||
@@ -1041,7 +1041,7 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
|
||||
}
|
||||
|
||||
matrix_as_3x3(self_rmat, self);
|
||||
mul_m3_m3m3(rmat, self_rmat, other_rmat);
|
||||
mul_m3_m3m3(rmat, other_rmat, self_rmat);
|
||||
|
||||
copy_m3_m3((float (*)[3])(self->contigPtr), rmat);
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
|
||||
|
||||
length= normalize_qt_qt(tquat, self->quat);
|
||||
quat_to_mat3(self_rmat, tquat);
|
||||
mul_m3_m3m3(rmat, self_rmat, other_rmat);
|
||||
mul_m3_m3m3(rmat, other_rmat, self_rmat);
|
||||
|
||||
mat3_to_quat(self->quat, rmat);
|
||||
mul_qt_fl(self->quat, length); /* maintain length after rotating */
|
||||
|
||||
@@ -122,12 +122,13 @@ def main():
|
||||
"W0232," # class has no __init__, Operator/Panel/Menu etc
|
||||
"W0142," # Used * or ** magic
|
||||
# even needed in some cases
|
||||
"R0903," # bake_action] Too many statements (68/50)
|
||||
"R0902," # Too many instance attributes
|
||||
"R0903," # Too many statements
|
||||
"R0911," # Too many return statements
|
||||
"R0912," # Too many branches
|
||||
"R0913," # Too many arguments
|
||||
"R0914," # Too many local variables
|
||||
"R0915," # bake_action] Too many statements (68/50)
|
||||
"R0915," # Too many statements
|
||||
" "
|
||||
"--include-ids=y "
|
||||
"--output-format=parseable "
|
||||
|
||||
Reference in New Issue
Block a user