[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43467] trunk/blender/release/scripts: pep8 edits, also remove unused vars

Campbell Barton ideasman42 at gmail.com
Tue Jan 17 18:57:32 CET 2012


Revision: 43467
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43467
Author:   campbellbarton
Date:     2012-01-17 17:57:20 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
pep8 edits, also remove unused vars

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/rna_xml.py
    trunk/blender/release/scripts/startup/bl_operators/clip.py
    trunk/blender/release/scripts/startup/bl_operators/wm.py
    trunk/blender/release/scripts/startup/bl_ui/properties_game.py
    trunk/blender/release/scripts/startup/bl_ui/properties_render.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_time.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py

Modified: trunk/blender/release/scripts/modules/rna_xml.py
===================================================================
--- trunk/blender/release/scripts/modules/rna_xml.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/modules/rna_xml.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -141,7 +141,7 @@
                                     return number_to_str(s, subsubvalue_type)
                                 else:
                                     return " ".join([str_recursive(si) for si in s])
-                            
+
                             array_value = " ".join(str_recursive(v) for v in subvalue_rna)
 
                         node_attrs.append("%s=\"%s\"" % (prop, array_value))
@@ -308,13 +308,13 @@
     rna2xml_node(root_xml, root_rna)
 
 
-
 # -----------------------------------------------------------------------------
 # Utility function used by presets.
 # The idea is you can run a preset like a script with a few args.
 #
 # This roughly matches the operator 'bpy.ops.script.python_file_run'
 
+
 def _get_context_val(context, path):
     path_full = "context." + path
     try:
@@ -328,6 +328,7 @@
 
     return value
 
+
 def xml_file_run(context, filepath, rna_map):
 
     import xml.dom.minidom

Modified: trunk/blender/release/scripts/startup/bl_operators/clip.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/clip.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_operators/clip.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -76,6 +76,7 @@
 
     return camera
 
+
 def CLIP_track_view_selected(sc, track):
     if track.select_anchor:
         return True
@@ -118,7 +119,7 @@
         constraint.track = track.name
         constraint.use_3d_position = False
         constraint.object = tracking_object.name
-        constraint.camera = CLIP_camera_for_clip(context, clip);
+        constraint.camera = CLIP_camera_for_clip(context, clip)
 
     def execute(self, context):
         sc = context.space_data
@@ -127,7 +128,7 @@
 
         for track in tracking_object.tracks:
             if CLIP_track_view_selected(sc, track):
-                self._link_track(context, clip, tracking_object ,track)
+                self._link_track(context, clip, tracking_object, track)
 
         return {'FINISHED'}
 

Modified: trunk/blender/release/scripts/startup/bl_operators/wm.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/wm.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_operators/wm.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -166,9 +166,10 @@
         if attr is None:
             return {'CANCELLED'}
 
+        toolsettings = context.tool_settings
         for i, brush in enumerate((cur for cur in bpy.data.brushes if getattr(cur, attr))):
             if i == self.index:
-                getattr(context.tool_settings, self.mode).brush = brush
+                getattr(toolsettings, self.mode).brush = brush
                 return {'FINISHED'}
 
         return {'CANCELLED'}
@@ -1768,4 +1769,3 @@
         info = addon_utils.module_bl_info(mod)
         info["show_expanded"] = not info["show_expanded"]
         return {'FINISHED'}
-

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_game.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_game.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_game.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -287,7 +287,7 @@
         col = row.column()
         col.prop(gs, "use_desktop")
         col.active = gs.show_fullscreen
-        
+
         col = layout.column()
         col.label(text="Quality:")
         col.prop(gs, "samples")

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_render.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_render.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_render.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -418,9 +418,9 @@
         rd = context.scene.render
 
         layout.active = rd.use_stamp
-        
+
         layout.prop(rd, "stamp_font_size", text="Font Size")
-        
+
         row = layout.row()
         row.column().prop(rd, "stamp_foreground", slider=True)
         row.column().prop(rd, "stamp_background", slider=True)
@@ -433,7 +433,7 @@
         col.prop(rd, "use_stamp_render_time", text="RenderTime")
         col.prop(rd, "use_stamp_frame", text="Frame")
         col.prop(rd, "use_stamp_scene", text="Scene")
-        
+
         col = split.column()
         col.prop(rd, "use_stamp_camera", text="Camera")
         col.prop(rd, "use_stamp_lens", text="Lens")

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -706,8 +706,8 @@
 
     def draw(self, context):
         layout = self.layout
-        settings = context.tool_settings.image_paint
-        brush = settings.brush
+        toolsettings = context.tool_settings.image_paint
+        brush = toolsettings.brush
 
         layout.prop(brush, "image_tool", text="")
 
@@ -823,19 +823,17 @@
         split = layout.split()
         col = split.column()
 
-        col.prop(context.tool_settings, "uv_sculpt_lock_borders");
-        col.prop(context.tool_settings, "uv_sculpt_all_islands");
-        
+        col.prop(toolsettings, "uv_sculpt_lock_borders")
+        col.prop(toolsettings, "uv_sculpt_all_islands")
+
         split = layout.split()
         col = split.column()
 
-        col.prop(context.tool_settings, "uv_sculpt_tool");
-        
-        if context.tool_settings.uv_sculpt_tool == 'RELAX':
-            col.prop(context.tool_settings, "uv_relax_method");
- 
-        
+        col.prop(toolsettings, "uv_sculpt_tool")
 
+        if toolsettings.uv_sculpt_tool == 'RELAX':
+            col.prop(toolsettings, "uv_relax_method")
 
+
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)

Modified: trunk/blender/release/scripts/startup/bl_ui/space_time.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_time.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_ui/space_time.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -28,7 +28,7 @@
         layout = self.layout
 
         scene = context.scene
-        tools = context.tool_settings
+        toolsettings = context.tool_settings
         screen = context.screen
 
         row = layout.row(align=True)
@@ -80,11 +80,11 @@
         layout.separator()
 
         row = layout.row(align=True)
-        row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True)
-        row.prop(tools, "use_keyframe_insert_keyingset", text="", toggle=True)
-        if screen.is_animation_playing and tools.use_keyframe_insert_auto:
+        row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True)
+        row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True)
+        if screen.is_animation_playing and toolsettings.use_keyframe_insert_auto:
             subsub = row.row()
-            subsub.prop(tools, "use_record_with_nla", toggle=True)
+            subsub.prop(toolsettings, "use_record_with_nla", toggle=True)
 
         row = layout.row(align=True)
         row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", text="")
@@ -193,10 +193,10 @@
 
     def draw(self, context):
         layout = self.layout
-        tools = context.tool_settings
+        toolsettings = context.tool_settings
 
-        layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS')
-        layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS')
+        layout.prop_enum(toolsettings, "auto_keying_mode", 'ADD_REPLACE_KEYS')
+        layout.prop_enum(toolsettings, "auto_keying_mode", 'REPLACE_KEYS')
 
 
 def marker_menu_generic(layout):

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2012-01-17 17:27:18 UTC (rev 43466)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2012-01-17 17:57:20 UTC (rev 43467)
@@ -761,7 +761,7 @@
         layout.operator("object.location_clear", text="Location")
         layout.operator("object.rotation_clear", text="Rotation")
         layout.operator("object.scale_clear", text="Scale")
-        layout ("object.origin_clear", text="Origin")
+        layout.operator("object.origin_clear", text="Origin")
 
 
 class VIEW3D_MT_object_specials(Menu):
@@ -1110,9 +1110,9 @@
     def draw(self, context):
         layout = self.layout
 
-        tool_settings = context.tool_settings
-        sculpt = tool_settings.sculpt
-        brush = tool_settings.sculpt.brush
+        toolsettings = context.tool_settings
+        sculpt = toolsettings.sculpt
+        brush = toolsettings.sculpt.brush
 
         layout.operator("ed.undo")
         layout.operator("ed.redo")
@@ -1148,8 +1148,8 @@
         layout.prop(sculpt, "show_brush")
 
         # TODO, make available from paint menu!
-        layout.prop(tool_settings, "sculpt_paint_use_unified_size", text="Unify Size")
-        layout.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Unify Strength")
+        layout.prop(toolsettings, "sculpt_paint_use_unified_size", text="Unify Size")
+        layout.prop(toolsettings, "sculpt_paint_use_unified_strength", text="Unify Strength")
 
 # ********** Particle menu **********
 
@@ -1453,7 +1453,7 @@
     def draw(self, context):
         layout = self.layout
 
-        settings = context.tool_settings
+        toolsettings = context.tool_settings
 
         layout.operator("ed.undo")
         layout.operator("ed.redo")
@@ -1485,9 +1485,9 @@
 
         layout.separator()
 
-        layout.prop(settings, "use_mesh_automerge")

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list