[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40576] trunk/blender: pep8 cleanup and fix for keymap test operator from my own recent fix.
Campbell Barton
ideasman42 at gmail.com
Mon Sep 26 17:39:15 CEST 2011
Revision: 40576
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40576
Author: campbellbarton
Date: 2011-09-26 15:39:15 +0000 (Mon, 26 Sep 2011)
Log Message:
-----------
pep8 cleanup and fix for keymap test operator from my own recent fix.
Modified Paths:
--------------
trunk/blender/build_files/cmake/cmake_static_check_cppcheck.py
trunk/blender/build_files/cmake/project_source_info.py
trunk/blender/release/scripts/modules/bpy_extras/anim_utils.py
trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py
trunk/blender/release/scripts/startup/bl_operators/console.py
trunk/blender/release/scripts/startup/bl_operators/view3d.py
trunk/blender/release/scripts/startup/bl_operators/wm.py
trunk/blender/release/scripts/startup/bl_ui/space_text.py
Modified: trunk/blender/build_files/cmake/cmake_static_check_cppcheck.py
===================================================================
--- trunk/blender/build_files/cmake/cmake_static_check_cppcheck.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/build_files/cmake/cmake_static_check_cppcheck.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -58,8 +58,8 @@
check_commands.append((c, cmd))
+ process_functions = []
- process_functions = []
def my_process(i, c, cmd):
percent = 100.0 * (i / (len(check_commands) - 1))
percent_str = "[" + ("%.2f]" % percent).rjust(7) + " %:"
Modified: trunk/blender/build_files/cmake/project_source_info.py
===================================================================
--- trunk/blender/build_files/cmake/project_source_info.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/build_files/cmake/project_source_info.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -161,8 +161,6 @@
del multiprocessing
if job_total == 1:
- import os
- import sys
for func, args in process_funcs:
sys.stdout.flush()
sys.stderr.flush()
@@ -171,14 +169,13 @@
process.wait()
else:
import time
- import subprocess
processes = []
for func, args in process_funcs:
# wait until a thread is free
while 1:
processes[:] = [p for p in processes if p.poll() is None]
-
+
if len(processes) <= job_total:
break
else:
Modified: trunk/blender/release/scripts/modules/bpy_extras/anim_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/anim_utils.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/modules/bpy_extras/anim_utils.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -59,7 +59,7 @@
:arg action: An action to bake the data into, or None for a new action
to be created.
:type action: :class:`bpy.types.Action` or None
-
+
:return: an action or None
:rtype: :class:`bpy.types.Action`
"""
@@ -115,7 +115,6 @@
return info
-
def obj_frame_info(obj):
info = {}
# parent = obj.parent
@@ -183,7 +182,8 @@
pbone.constraints.remove(pbone.constraints[0])
for f in frame_range:
- matrix = pose_info[(f - frame_start) // frame_step][name]["matrix_key"]
+ f_step = (f - frame_start) // frame_step
+ matrix = pose_info[f_step][name]["matrix_key"]
# pbone.location = matrix.to_translation()
# pbone.rotation_quaternion = matrix.to_quaternion()
Modified: trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -218,7 +218,7 @@
def keyconfig_test(kc):
- def testEntry(self, kc, entry, src=None, parent=None):
+ def testEntry(kc, entry, src=None, parent=None):
result = False
def kmistr(kmi):
Modified: trunk/blender/release/scripts/startup/bl_operators/console.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/console.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/startup/bl_operators/console.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -37,12 +37,14 @@
if execute:
return execute(context)
else:
- print("Error: bpy.ops.console.execute_" + sc.language + " - not found")
+ print("Error: bpy.ops.console.execute_%s - not found" %
+ sc.language)
return {'FINISHED'}
class ConsoleAutocomplete(Operator):
- '''Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one'''
+ """Evaluate the namespace up until the cursor and give a list of """ \
+ """options or complete the name if there is only one"""
bl_idname = "console.autocomplete"
bl_label = "Console Autocomplete"
@@ -54,7 +56,8 @@
if autocomplete:
return autocomplete(context)
else:
- print("Error: bpy.ops.console.autocomplete_" + sc.language + " - not found")
+ print("Error: bpy.ops.console.autocomplete_%s - not found" %
+ sc.language)
return {'FINISHED'}
@@ -76,7 +79,8 @@
if banner:
return banner(context)
else:
- print("Error: bpy.ops.console.banner_" + sc.language + " - not found")
+ print("Error: bpy.ops.console.banner_%s - not found" %
+ sc.language)
return {'FINISHED'}
@@ -103,4 +107,3 @@
remove_duplicates=True)
return {'FINISHED'}
-
Modified: trunk/blender/release/scripts/startup/bl_operators/view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/view3d.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/startup/bl_operators/view3d.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -36,7 +36,10 @@
# totvert = mesh.total_vert_sel
if select_mode[2] and totface == 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (False, False, True)})
elif select_mode[2] and totface > 1:
bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
elif select_mode[1] and totedge >= 1:
@@ -44,7 +47,8 @@
else:
bpy.ops.mesh.extrude_vertices_move('INVOKE_REGION_WIN')
- # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
+ # ignore return from operators above because they are 'RUNNING_MODAL',
+ # and cause this one not to be freed. [#24671]
return {'FINISHED'}
def invoke(self, context, event):
@@ -64,13 +68,20 @@
# totvert = mesh.total_vert_sel
if totface >= 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (False, False, True)})
elif totedge == 1:
- bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
+ bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
+ TRANSFORM_OT_translate={
+ "constraint_orientation": 'NORMAL',
+ "constraint_axis": (True, True, False)})
else:
bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
- # ignore return from operators above because they are 'RUNNING_MODAL', and cause this one not to be freed. [#24671]
+ # ignore return from operators above because they are 'RUNNING_MODAL',
+ # and cause this one not to be freed. [#24671]
return {'FINISHED'}
def invoke(self, context, event):
Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -1180,7 +1180,7 @@
return {'CANCELLED'}
-
+
class WM_OT_keyconfig_test(Operator):
"Test keyconfig for conflicts"
bl_idname = "wm.keyconfig_test"
@@ -1447,8 +1447,8 @@
textblock.write('\n'.join(op_strings))
self.report({'INFO'}, "See OperatorList.txt textblock")
return {'FINISHED'}
-
-
+
+
class WM_OT_addon_enable(Operator):
"Enable an addon"
bl_idname = "wm.addon_enable"
Modified: trunk/blender/release/scripts/startup/bl_ui/space_text.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_text.py 2011-09-26 15:39:10 UTC (rev 40575)
+++ trunk/blender/release/scripts/startup/bl_ui/space_text.py 2011-09-26 15:39:15 UTC (rev 40576)
@@ -66,9 +66,11 @@
row = layout.row()
if text.filepath:
if text.is_dirty:
- row.label(text="File" + ": *%r " % text.filepath + "(unsaved)")
+ row.label(text="File" + ": *%r " %
+ text.filepath + "(unsaved)")
else:
- row.label(text="File" + ": %r" % text.filepath)
+ row.label(text="File" + ": %r" %
+ text.filepath)
else:
row.label(text="Text: External"
if text.library
More information about the Bf-blender-cvs
mailing list