Cleanup: pep8
authorCampbell Barton <ideasman42@gmail.com>
Wed, 17 Sep 2014 08:36:17 +0000 (18:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 17 Sep 2014 08:36:17 +0000 (18:36 +1000)
27 files changed:
doc/python_api/examples/bpy.props.5.py
doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py
doc/python_api/sphinx_doc_gen.py
doc/python_api/sphinx_doc_gen_monkeypatch.py
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/ui.py
release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
release/scripts/modules/bl_i18n_utils/utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/rna_xml.py
release/scripts/startup/bl_operators/__init__.py
release/scripts/startup/bl_operators/anim.py
release/scripts/startup/bl_operators/object_quick_effects.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_paint_common.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/templates_py/operator_modal_view3d_raycast.py
release/scripts/templates_py/script_stub.py
release/scripts/templates_py/ui_pie_menu.py
source/blender/python/rna_dump.py
tests/python/bl_mesh_modifiers.py

index d2ace54de27a3583fd6025198ba7d2610d282684..4e9d61d53852d67bb4ea7701760e6a66c85cae5f 100644 (file)
@@ -75,7 +75,7 @@ print(scene.test_float)
 scene.test_array = (True, False)
 print([x for x in scene.test_array])
 
-#scene.test_date = "blah"   # this would fail, property is read-only
+# scene.test_date = "blah"   # this would fail, property is read-only
 print(scene.test_date)
 
 scene.test_enum = 'BLUE'
index 05163b332a98f3247419f2226283fbf434b95aba..a83b23e84f9e01725941ba98d3ad30516996e309 100644 (file)
@@ -8,4 +8,3 @@ collection.foreach_get(attr, some_seq)
 # Python equivalent
 for i in range(len(seq)):
     some_seq[i] = getattr(collection[i], attr)
-
index 98bf6bf2eede70214b6b5908dbcc107a1128008c..9ec8f9ad2c20c4c05bf362b6ab161769acbdcea7 100644 (file)
@@ -1,22 +1,22 @@
- # ***** BEGIN GPL LICENSE BLOCK *****
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software Foundation,
- # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- # Contributor(s): Campbell Barton, Luca Bonavita
- #
- # #**** END GPL LICENSE BLOCK #****
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+#
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+#
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ##### END GPL LICENSE BLOCK #####
 
 # <pep8 compliant>
 
index 1167ece05b7fa57d37c9d54b2a316be616ce8107..9fdbf613d96ae47e00aea82473c11719818a0cbf 100644 (file)
@@ -1,22 +1,22 @@
- # ***** BEGIN GPL LICENSE BLOCK *****
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software Foundation,
- # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- # Contributor(s): Campbell Barton
- #
- # #**** END GPL LICENSE BLOCK #****
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+#
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+#
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ##### END GPL LICENSE BLOCK #####
 
 # <pep8 compliant>
 
index d1d27df8dc3743ff13224a09cd3b973c511ec629..8c60ea31053859dca19170daea7b4939c7e4d39a 100644 (file)
@@ -33,6 +33,7 @@ import bpy
 from . import engine
 from . import version_update
 
+
 class CyclesRender(bpy.types.RenderEngine):
     bl_idname = 'CYCLES'
     bl_label = "Cycles Render"
index 6e40c42fb2d97df4c7cef114f92d8656d8b3fc4b..9632b12c414b8a4db5d8867e11fb2aebd2d47b3d 100644 (file)
@@ -567,7 +567,7 @@ class CyclesObject_PT_motion_blur(CyclesButtonsPanel, Panel):
         layout = self.layout
 
         rd = context.scene.render
-        scene = context.scene
+        scene = context.scene
 
         layout.active = rd.use_motion_blur
 
@@ -580,7 +580,7 @@ class CyclesObject_PT_motion_blur(CyclesButtonsPanel, Panel):
         layout = self.layout
 
         rd = context.scene.render
-        scene = context.scene
+        scene = context.scene
 
         ob = context.object
         cob = ob.cycles
@@ -982,7 +982,7 @@ class CyclesMaterial_PT_volume(CyclesButtonsPanel, Panel):
         layout = self.layout
 
         mat = context.material
-        cmat = mat.cycles
+        cmat = mat.cycles
 
         panel_node_draw(layout, mat, 'OUTPUT_MATERIAL', 'Volume')
 
@@ -1209,7 +1209,6 @@ class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        scene = context.scene
         psys = context.particle_system
         return CyclesButtonsPanel.poll(context) and psys and psys.settings.type == 'HAIR'
 
@@ -1284,7 +1283,7 @@ class CyclesRender_PT_bake(CyclesButtonsPanel, Panel):
             box.prop(cbk, "normal_space", text="Space")
 
             row = box.row(align=True)
-            row.label(text = "Swizzle:")
+            row.label(text="Swizzle:")
             row.prop(cbk, "normal_r", text="")
             row.prop(cbk, "normal_g", text="")
             row.prop(cbk, "normal_b", text="")
index ad2a70b84e8780d9ede5e25d1732ea6ba2402629..8874ecceb774b3761f789f113b02003d80c6c20a 100644 (file)
@@ -343,10 +343,10 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
             process_msg(msgs, default_context, cls.__doc__, msgsrc, reports, check_ctxt_rna_tip, settings)
 
         # Panels' "tabs" system.
-        if hasattr(bl_rna, 'bl_category') and  bl_rna.bl_category:
+        if hasattr(bl_rna, 'bl_category') and bl_rna.bl_category:
             process_msg(msgs, default_context, bl_rna.bl_category, msgsrc, reports, check_ctxt_rna, settings)
 
-        if hasattr(bl_rna, 'bl_label') and  bl_rna.bl_label:
+        if hasattr(bl_rna, 'bl_label') and bl_rna.bl_label:
             process_msg(msgs, msgctxt, bl_rna.bl_label, msgsrc, reports, check_ctxt_rna, settings)
 
         walk_properties(cls)
index 85977642bbbbd3d1312a53042d20f5515fb9111b..911e1764698efd978887a7e4b44552b208e5861a 100644 (file)
@@ -1343,7 +1343,7 @@ class I18n:
         #key = self.settings.PO_HEADER_KEY
         #for uid, trans in self.trans.items():
             #if key not in trans.msgs:
-                #trans.msgs[key] 
+                #trans.msgs[key]
         self.unescape()
 
     def write(self, kind, langs=set()):
index bc2e9368b71cb1933b31e6a99fa140904dd52ef1..e19766310ec17cc9c6dd57dc328d4da5747097bb 100644 (file)
@@ -694,7 +694,7 @@ class _GenericUI:
         draw_funcs = cls._dyn_ui_initialize()
         try:
             draw_funcs.remove(draw_func)
-        except:
+        except ValueError:
             pass
 
 
index 9776993b74ba5b7ed93d9db8a2d443af1e3460e1..41f890de51f7fa7e0a8158f27413886698055291 100644 (file)
@@ -92,7 +92,6 @@ def rna2xml(fw=print_ln,
         bpy.types.Sequence,
         )
 
-
     def number_to_str(val, val_type):
         if val_type == int:
             return "%d" % val
@@ -245,13 +244,13 @@ def xml2rna(root_xml,
             ):
 
     def rna2xml_node(xml_node, value):
-#        print("evaluating:", xml_node.nodeName)
+        # print("evaluating:", xml_node.nodeName)
 
         # ---------------------------------------------------------------------
         # Simple attributes
 
         for attr in xml_node.attributes.keys():
-#            print("  ", attr)
+            # print("  ", attr)
             subvalue = getattr(value, attr, Ellipsis)
 
             if subvalue is Ellipsis:
index 4f6863a590c9b10bef2eb34922401424ee51f622..e44fce63acd05d22c13e3f95f5c9974d056f9ddd 100644 (file)
@@ -9,7 +9,7 @@
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #  GNU General Public License for more details.
-#,
+#
 #  You should have received a copy of the GNU General Public License
 #  along with this program; if not, write to the Free Software Foundation,
 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
index 42ab99ed399121f8f667dee89e4755a5a356f6ac..756b75b8d03cce9558c52cab1ff8e22362b08fd3 100644 (file)
@@ -306,7 +306,8 @@ class UpdateAnimatedTransformConstraint(Operator):
         paths = from_paths | to_paths
 
         def update_cb(base, class_name, old_path, fcurve, options):
-            print(options)
+            # print(options)
+
             def handle_deg2rad(fcurve):
                 if fcurve is not None:
                     if hasattr(fcurve, "keyframes"):
index 32688299b764ccf6394a8dcadc3c8e49d4457790..c79ff303dfb7862cbcf3aa3a949f84fa7c915eac 100644 (file)
@@ -289,8 +289,8 @@ def obj_bb_minmax(obj, min_co, max_co):
         max_co[0] = max(bb_vec[0], max_co[0])
         max_co[1] = max(bb_vec[1], max_co[1])
         max_co[2] = max(bb_vec[2], max_co[2])
-        
-        
+
+
 def grid_location(x, y):
     return (x * 200, y * 150)
 
index 5c3f94a8739c81bf5f969a490c297ab87eb67a0e..8d04cb132e6e7e4795a65b692a499265995ededd 100644 (file)
@@ -1934,7 +1934,6 @@ class WM_OT_addon_install(Operator):
             try:
                 os.makedirs(path_addons, exist_ok=True)
             except:
-                import traceback
                 traceback.print_exc()
 
         # Check if we are installing from a target path,
index 5dd1f94747c835b7d810de160bd6f082013e02cf..4789d1191924170569249bf3e364a1e35abf2d43 100644 (file)
@@ -47,4 +47,3 @@ class GreasePencilPanel():
 
             col.label(text="Measure:")
             col.operator("view3d.ruler")
-
index e6d6a3952ea14e85b46368c3fe9b31de9bd4ad56..25367a58a542c2162fd2c2e4a40bbed246f91235 100644 (file)
@@ -151,6 +151,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
             sub.prop_search(ob, "parent_bone", parent.data, "bones", text="")
         sub.active = (parent is not None)
 
+
 class GROUP_MT_specials(Menu):
     bl_label = "Group Specials"
 
index 5c758b6568b76a26609a76037255bc4ef568d4a2..113fee19e2cea4ef0619feda71c2ec2d0f9f7a04 100644 (file)
@@ -183,14 +183,10 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
                     col.template_ID(settings, "clone_image")
                     col.label("UV Map")
                     col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
-                    
-
         else:
             col.prop(brush, "clone_image", text="Image")
             col.prop(brush, "clone_alpha", text="Alpha")
 
-
-
     col.separator()
 
     if capabilities.has_radius:
index 13aad4c38881e01030b49abeb47a5a81dda646bf..3382633af600f78a4fa477d71ce574952d0f6a1e 100644 (file)
@@ -260,7 +260,7 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
     def draw(self, context):
         layout = self.layout
 
-        sc = context.space_data
+        sc = context.space_data
         # clip = sc.clip
 
         col = layout.column(align=True)
index bbb1e41beb14e4c09d6e6564165007e795774b1d..ce00d4eb8e7ca962571a35130f184ccba9a6c9ab 100644 (file)
@@ -215,7 +215,7 @@ class SEQUENCER_MT_select(Menu):
         op = layout.operator("sequencer.select", text="All strips to the Right")
         op.left_right = 'RIGHT'
         op.linked_time = True
-        
+
         layout.separator()
         layout.operator("sequencer.select_handles", text="Surrounding Handles").side = 'BOTH'
         layout.operator("sequencer.select_handles", text="Left Handle").side = 'LEFT'
@@ -259,6 +259,7 @@ class SEQUENCER_MT_frame(Menu):
         layout.operator("anim.previewrange_clear")
         layout.operator("anim.previewrange_set")
 
+
 class SEQUENCER_MT_add(Menu):
     bl_label = "Add"
 
@@ -607,7 +608,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         col = layout.column(align=True)
         if strip.type == 'SPEED':
             col.prop(strip, "multiply_speed")
-        elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER','ALPHA_UNDER','OVER_DROP'}:
+        elif strip.type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}:
             col.prop(strip, "use_default_fade", "Default fade")
             if not strip.use_default_fade:
                 col.prop(strip, "effect_fader", text="Effect fader")
index 999e41e17f7ab75c42578542662cadea980e8220..59b842a7a5b3c8e7782afdca40d30c84d474c304 100644 (file)
@@ -424,7 +424,6 @@ class USERPREF_PT_system(Panel):
         col.prop(system, "use_gpu_mipmap")
         col.prop(system, "use_16bit_textures")
 
-        
         if system.is_occlusion_query_supported():
             col.separator()
             col.label(text="Selection")
index 61d359ebdac401cbe65b73e7cb4de3b2768aaa92..1e2fac17e902458ae95069ff3a57add558fcc249 100644 (file)
@@ -2198,7 +2198,6 @@ class VIEW3D_MT_edit_mesh_edges(Menu):
         layout = self.layout
 
         with_freestyle = bpy.app.build_options.freestyle
-        scene = context.scene
 
         layout.operator_context = 'INVOKE_REGION_WIN'
 
@@ -2254,7 +2253,6 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
         layout = self.layout
 
         with_freestyle = bpy.app.build_options.freestyle
-        scene = context.scene
 
         layout.operator_context = 'INVOKE_REGION_WIN'
 
@@ -2951,7 +2949,7 @@ class VIEW3D_PT_view3d_meshdisplay(Panel):
 
         sub = row.row(align=True)
         sub.active = mesh.show_normal_vertex or mesh.show_normal_face or mesh.show_normal_loop
-        sub.prop(context.scene.tool_settings, "normal_size", text="Size")
+        sub.prop(scene.tool_settings, "normal_size", text="Size")
 
         col.separator()
         split = layout.split()
index 6b0c5b1e993b0dbe14c45d4d1dd56eae7d8c3ff0..a483a097e8f721d6bf3994566dcdc75a992234cc 100644 (file)
@@ -1027,7 +1027,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
         col = layout.column()
 
         col.label("Painting Mode")
-        col.prop(settings, "mode", text = "")
+        col.prop(settings, "mode", text="")
         col.separator()
 
         if settings.mode == 'MATERIAL':
@@ -1064,7 +1064,6 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
         col.operator("image.save_dirty", text="Save All Images")
 
 
-
 class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
     bl_context = "imagepaint"
     bl_label = "Stencil"
index 4d0355047f499f90e6959d5ee4f630963fab29ca..6c59603239b8fb3a32c6df8b390e504089a90e4c 100644 (file)
@@ -1,5 +1,4 @@
 import bpy
-from mathutils import Vector
 from bpy_extras import view3d_utils
 
 
@@ -106,4 +105,3 @@ def unregister():
 
 if __name__ == "__main__":
     register()
-
index 3f56749f3b3f15a20bd837c391d10cb69c4c2809..5505ca64078c1900d9737102aac08684b016d4fa 100644 (file)
@@ -11,4 +11,3 @@ filepath = os.path.join(os.path.dirname(bpy.data.filepath), filename)
 global_namespace = {"__file__": filepath, "__name__": "__main__"}
 with open(filepath, 'rb') as file:
     exec(compile(file.read(), filepath, 'exec'), global_namespace)
-
index 87500b682d626cb69851e7f2df8c5e4e28533437..0c431ca50ff0f61ce429b9d104a2fe0554af45cb 100644 (file)
@@ -29,4 +29,3 @@ if __name__ == "__main__":
     register()
 
     bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
-
index 15cc60d997e89749fb6e958f9d965c3bf9562b6c..7259ceb67a0cb383cee9ea41ddffcf5641aea130 100644 (file)
@@ -1,22 +1,22 @@
- # ***** BEGIN GPL LICENSE BLOCK *****
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software Foundation,
- # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- #
- # Contributor(s): Campbell Barton
- #
- # #**** END GPL LICENSE BLOCK #****
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+#
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+#
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributor(s): Campbell Barton
+#
+# ##### END GPL LICENSE BLOCK #####
 
 # <pep8 compliant>
 
index 1c05eaafa0d485ffd84bc58bf900c730d1271848..2db38895f9b504f51b2026ac6daf924f78b77da6 100644 (file)
@@ -851,7 +851,7 @@ if __name__ == "__main__":
                 import traceback
                 traceback.print_exc()
 
-                import sys
+                import sys
                 # sys.exit(1)  # comment to debug
 
         else: