code cleanup: pep8 & minor changes
authorCampbell Barton <ideasman42@gmail.com>
Mon, 11 Mar 2013 02:19:58 +0000 (02:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 11 Mar 2013 02:19:58 +0000 (02:19 +0000)
release/scripts/modules/console/complete_import.py
release/scripts/presets/keyconfig/3dsmax.py
release/scripts/startup/bl_ui/properties_constraint.py
release/scripts/startup/bl_ui/properties_physics_rigidbody.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_userpref_keymap.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/space_view3d/view3d_ruler.c

index 8f2b532..9277e04 100644 (file)
@@ -111,10 +111,10 @@ def module_list(path):
     else:
         folder_list = []
     #folder_list = glob.glob(os.path.join(path,'*'))
-    folder_list = [p for p in folder_list  \
-       if os.path.exists(os.path.join(path, p, '__init__.py'))\
-           or p[-3:] in ('.py', '.so')\
-           or p[-4:] in ('.pyc', '.pyo', '.pyd')]
+    folder_list = [p for p in folder_list \
+       if os.path.exists(os.path.join(path, p, '__init__.py')) \
+           or p[-3:] in {'.py', '.so'} \
+           or p[-4:] in {'.pyc', '.pyo', '.pyd'}]
 
     folder_list = [os.path.basename(p).split('.')[0] for p in folder_list]
     return folder_list
index 2c39689..6a719c2 100644 (file)
@@ -1357,4 +1357,3 @@ kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_UP', 'PAGE_UP', 'PRESS', shift
 kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_DOWN', 'PAGE_DOWN', 'PRESS', shift=True)
 kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_UP', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
 kmi = km.keymap_items.new_modal('AUTOIK_CHAIN_LEN_DOWN', 'WHEELUPMOUSE', 'PRESS', shift=True)
-
index 0dfb307..0739052 100644 (file)
@@ -851,16 +851,16 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
     def draw(self, context):
         layout = self.layout
 
-        ob = context.object
+        obj = context.object
 
-        if ob.type == 'ARMATURE' and ob.mode in ('EDIT', 'POSE'):
+        if obj.type == 'ARMATURE' and obj.mode in {'EDIT', 'POSE'}:
             box = layout.box()
             box.alert = True
             box.label(icon='INFO', text="See Bone Constraints tab to Add Constraints to active bone")
         else:
             layout.operator_menu_enum("object.constraint_add", "type", text="Add Object Constraint")
 
-        for con in ob.constraints:
+        for con in obj.constraints:
             self.draw_constraint(context, con)
 
 
index d7ed7bb..77ea5a9 100644 (file)
@@ -109,7 +109,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
 
         #col = layout.column(align=1)
         #col.label(text="Activation:")
-        # XXX: settings such as activate on collison/etc. 
+        # XXX: settings such as activate on collison/etc.
 
         split = layout.split()
 
index 2ad5724..8a45298 100644 (file)
@@ -36,7 +36,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 
     if is_nla:
         row.prop(dopesheet, "show_missing_nla", text="")
-    else: # graph and dopesheet editors - F-Curves and drivers only
+    else:  # graph and dopesheet editors - F-Curves and drivers only
         row.prop(dopesheet, "show_only_errors", text="")
 
     if not genericFiltersOnly:
index c5486dd..e935872 100644 (file)
@@ -699,11 +699,11 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
 
             row = col.row(align=True)
             if(brush.use_relative_jitter):
-               row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
-               row.prop(brush, "jitter", slider=True)
+                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
+                row.prop(brush, "jitter", slider=True)
             else:
-               row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
-               row.prop(brush, "jitter_absolute")
+                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
+                row.prop(brush, "jitter_absolute")
             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
             col.prop(brush, "blend", text="Blend")
@@ -726,7 +726,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
 
         col = layout.column()
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-        
+
         brush_texture_settings(col, brush, 0)
 
 
index e800171..4c63437 100644 (file)
@@ -215,13 +215,13 @@ class InputKeyMapPanel:
 
     _EVENT_TYPES = set()
     _EVENT_TYPE_MAP = {}
+
     def draw_filtered(self, display_keymaps, filter_type, filter_text, layout):
 
         if filter_type == 'NAME':
             def filter_func(kmi):
                 return (filter_text in kmi.idname.lower() or
                         filter_text in kmi.name.lower())
-                
         else:
             if not self._EVENT_TYPES:
                 enum = bpy.types.Event.bl_rna.properties["type"].enum_items
@@ -272,13 +272,13 @@ class InputKeyMapPanel:
                 return False
             elif filter_text_split:
                 kmi_type = filter_text_split[0].upper()
-                
+
                 if kmi_type not in self._EVENT_TYPES:
                     # replacement table
                     kmi_type_test = self._EVENT_TYPE_MAP.get(kmi_type)
                     if kmi_type_test is None:
                         # print("Unknown Type:", kmi_type)
-                        
+
                         # Partial match
                         for k, v in self._EVENT_TYPE_MAP.items():
                             if kmi_type in k:
@@ -293,7 +293,7 @@ class InputKeyMapPanel:
 
                     kmi_type = kmi_type_test
                     del kmi_type_test
-                    
+
                 kmi_test_dict["type"] = kmi_type
 
             # main filter func, runs many times
index 37f7cf6..29d1409 100644 (file)
@@ -2520,29 +2520,29 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
         mesh = context.active_object.data
 
         split = layout.split()
-        
+
         col = split.column()
         col.label(text="Overlays:")
         col.prop(mesh, "show_faces", text="Faces")
         col.prop(mesh, "show_edges", text="Edges")
         col.prop(mesh, "show_edge_crease", text="Creases")
-        
+
         col = split.column()
         col.label()
         col.prop(mesh, "show_edge_seams", text="Seams")
         col.prop(mesh, "show_edge_sharp", text="Sharp")
         col.prop(mesh, "show_edge_bevel_weight", text="Weights")
-        
+
         col = layout.column()
 
         col.separator()
         col.label(text="Normals:")
         row = col.row()
-        
+
         sub = row.row(align=True)
         sub.prop(mesh, "show_normal_vertex", text="", icon='VERTEXSEL')
         sub.prop(mesh, "show_normal_face", text="", icon='FACESEL')
-        
+
         sub = row.row(align=True)
         sub.active = mesh.show_normal_vertex or mesh.show_normal_face
         sub.prop(context.scene.tool_settings, "normal_size", text="Size")
index 3bd2f64..54e5741 100644 (file)
@@ -685,7 +685,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
                 row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
                 row.prop(brush, "jitter_absolute")
             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
-           
+
             col.prop(brush, "blend", text="Blend")
 
             col = layout.column()
@@ -712,11 +712,11 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
             row = col.row(align=True)
             if(brush.use_relative_jitter):
-               row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
-               row.prop(brush, "jitter", slider=True)
+                row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
+                row.prop(brush, "jitter", slider=True)
             else:
-               row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
-               row.prop(brush, "jitter_absolute")
+                row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
+                row.prop(brush, "jitter_absolute")
             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
 
             col.prop(brush, "vertex_tool", text="Blend")
index 43b2867..e986077 100644 (file)
@@ -715,14 +715,12 @@ static void view3d_ruler_header_update(ScrArea *sa)
 /* -------------------------------------------------------------------- */
 /* Operator callbacks */
 
-static int view3d_ruler_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int view3d_ruler_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
        wmWindow *win = CTX_wm_window(C);
        ScrArea *sa = CTX_wm_area(C);
        ARegion *ar = CTX_wm_region(C);
-//     RegionView3D *rv3d = CTX_wm_region_view3d(C);
        RulerInfo *ruler_info;
-       (void)event;
 
        ruler_info = MEM_callocN(sizeof(RulerInfo), "RulerInfo");