Cleanup: pep8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 31 Jan 2016 13:47:10 +0000 (00:47 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 31 Jan 2016 13:47:10 +0000 (00:47 +1100)
24 files changed:
build_files/buildbot/master.cfg
build_files/cmake/cmake_consistency_check.py
build_files/cmake/cmake_netbeans_project.py
doc/python_api/examples/gpu.offscreen.1.py
doc/python_api/rst_from_bmesh_opdefines.py
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
release/scripts/modules/bpy/path.py
release/scripts/modules/bpy_extras/image_utils.py
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/modules/bpy_types.py
release/scripts/modules/sys_info.py
release/scripts/startup/bl_ui/properties_constraint.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_view3d.py
tests/python/bl_mesh_modifiers.py
tests/python/bl_run_operators.py
tests/python/rst_to_doctree_mini.py

index c05472332aa4839285504be4455b99968f2646bd..2fc337a6ec13381d9815cf3bacfd9f03b51dc7be 100644 (file)
@@ -329,7 +329,7 @@ authz_cfg = authz.Authz(
 )
 
 c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
-#c['status'].append(html.WebStatus(http_port=8010))
+# c['status'].append(html.WebStatus(http_port=8010))
 
 # PROJECT IDENTITY
 
index d0bbdda1870c8c349cf36789baa591341cedc5d5..7ad47267239a468726edf5e8cad24134264cb2d9 100755 (executable)
@@ -278,7 +278,6 @@ def main():
         # Write a 'sed' script, useful if we get a lot of these
         # print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
 
-
     if is_err:
         raise Exception("CMake referenecs missing files, aborting!")
     del is_err
index d57bce770b42bec76b9f94ea9474aa1124620ae5..8d66c101c6a55619a7ff9546bee833aa12b69992 100755 (executable)
@@ -81,7 +81,6 @@ def create_nb_project_main():
             # be tricky, get the project name from git if we can!
             PROJECT_NAME = project_name_get()
 
-
         make_exe = cmake_cache_var("CMAKE_MAKE_PROGRAM")
         make_exe_basename = os.path.basename(make_exe)
 
index 06f0d915361b9a5b9217db7e05d00cceb9a251e8..75ddf804e7078143e143c62f674702627d4af5a0 100644 (file)
@@ -63,7 +63,6 @@ class OffScreenDraw(bpy.types.Operator):
                 render.pixel_aspect_y,
                 )
 
-
         offscreen.draw_view3d(
                 scene,
                 context.space_data,
index c93be662648765117765c51255c7f926fcc46362..ebcedbf71f15da206d114cfd8f4b786f0927a897 100644 (file)
@@ -180,8 +180,8 @@ def main():
                 l = "None,"
             b[i] = l
 
-        #for l in b:
-        #    print(l)
+        # for l in b:
+        #     print(l)
 
         text = "\n".join(b)
         global_namespace = {
index 7d3f084db18d9f0d762d9c51afbb426d8131c517..f22ac25c832d0a2ad0be8922e4c89cc26afa9e7b 100644 (file)
@@ -538,7 +538,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
         cls.rolling_shutter_duration = FloatProperty(
             name="Rolling Shutter Duration",
             description="Scanline \"exposure\" time for the rolling shutter effect",
-            default = 0.1,
+            default=0.1,
             min=0.0, max=1.0,
             )
 
index afdca7ba8f160a030bbf95002107685b0691c946..70497b66502357a62ec2f39a411d425df5048365 100644 (file)
@@ -168,7 +168,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
         sub.prop(cscene, "sample_clamp_direct")
         sub.prop(cscene, "sample_clamp_indirect")
 
-        if cscene.progressive == 'PATH' or use_branched_path(context) == False:
+        if cscene.progressive == 'PATH' or use_branched_path(context) is False:
             col = split.column()
             sub = col.column(align=True)
             sub.label(text="Samples:")
index db4c8da30f0762e32dad347b7ad79b7a709f53c1..99c46e4b03449c47b311530215d6fe7d195eab87 100644 (file)
@@ -69,19 +69,23 @@ def abspath(path, start=None, library=None):
     if isinstance(path, bytes):
         if path.startswith(b"//"):
             if library:
-                start = _os.path.dirname(abspath(_getattr_bytes(library, "filepath")))
-            return _os.path.join(_os.path.dirname(_getattr_bytes(_bpy.data, "filepath"))
-                                 if start is None else start,
-                                 path[2:],
-                                 )
+                start = _os.path.dirname(
+                        abspath(_getattr_bytes(library, "filepath")))
+            return _os.path.join(
+                    _os.path.dirname(_getattr_bytes(_bpy.data, "filepath"))
+                    if start is None else start,
+                    path[2:],
+                    )
     else:
         if path.startswith("//"):
             if library:
-                start = _os.path.dirname(abspath(library.filepath))
-            return _os.path.join(_os.path.dirname(_bpy.data.filepath)
-                                 if start is None else start,
-                                 path[2:],
-                                 )
+                start = _os.path.dirname(
+                        abspath(library.filepath))
+            return _os.path.join(
+                    _os.path.dirname(_bpy.data.filepath)
+                    if start is None else start,
+                    path[2:],
+                    )
 
     return path
 
index ad774cd1bda0a569ca3d72fed4fbaaffa92e967e..f197596fec03090659933dfcc7c85b74f2eb0ff8 100644 (file)
@@ -62,11 +62,13 @@ def load_image(imagepath,
     :type convert_callback: function
     :arg relpath: If not None, make the file relative to this path.
     :type relpath: None or string
-    :arg check_existing: If true, returns already loaded image datablock if possible
+    :arg check_existing: If true,
+       returns already loaded image datablock if possible
        (based on file path).
     :type check_existing: bool
-    :arg force_reload: If true, force reloading of image (only useful when `check_existing`
-        is also enabled).
+    :arg force_reload: If true,
+       force reloading of image (only useful when `check_existing`
+       is also enabled).
     :type force_reload: bool
     :return: an image or None
     :rtype: :class:`bpy.types.Image`
index 65ccc3f8dc3cf46ff04a8e16ac2cfdee2edabe39..a7ecd0b80c00053e5cbb5b0d6096324c95e64c18 100644 (file)
@@ -137,7 +137,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'):
 
     def _update_axis_forward(self, context):
         if self.axis_forward[-1] == self.axis_up[-1]:
-            self.axis_up = self.axis_up[0:-1] + 'XYZ'[('XYZ'.index(self.axis_up[-1]) + 1) % 3]
+            self.axis_up = (self.axis_up[0:-1] +
+                    'XYZ'[('XYZ'.index(self.axis_up[-1]) + 1) % 3])
 
     members['axis_forward'] = EnumProperty(
             name="Forward",
@@ -154,7 +155,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'):
 
     def _update_axis_up(self, context):
         if self.axis_up[-1] == self.axis_forward[-1]:
-            self.axis_forward = self.axis_forward[0:-1] + 'XYZ'[('XYZ'.index(self.axis_forward[-1]) + 1) % 3]
+            self.axis_forward = (self.axis_forward[0:-1] +
+                    'XYZ'[('XYZ'.index(self.axis_forward[-1]) + 1) % 3])
 
     members['axis_up'] = EnumProperty(
             name="Up",
index 830db976822c6062318c84c6ddc8d5cf8e064e06..e21b34adc4ebaa42997ce5efe53ab558ca2091a4 100644 (file)
@@ -208,7 +208,7 @@ class _GenericBone:
     @property
     def basename(self):
         """The name of this bone before any '.' character"""
-        #return self.name.rsplit(".", 1)[0]
+        # return self.name.rsplit(".", 1)[0]
         return self.name.split(".")[0]
 
     @property
index 382cb181d5f0b6a67cb8ee644d961ed9c3613bb9..49395dd48f02199e2fc798bedfbcbbccbd5cf1df 100644 (file)
@@ -40,7 +40,6 @@ def write_sysinfo(filepath):
             r = r[1:-1]
         return r
 
-
     output = open(filepath, 'w', encoding="utf-8")
 
     header = "= Blender %s System Information =\n" % bpy.app.version_string
index 7ade444d7ae1ea3c24139957697557f378e49c98..ef0fc9c7c9f3e000e50bfd1e0ae23b0b6b6e7f35 100644 (file)
@@ -440,7 +440,7 @@ class ConstraintButtonsPanel:
 
         self.space_template(layout, con)
 
-    #def SCRIPT(self, context, layout, con):
+    # def SCRIPT(self, context, layout, con):
 
     def ACTION(self, context, layout, con):
         self.target_template(layout, con)
index 98570ca5280d51887c49da4695c726ac48ace0fb..f26147e0673ff497c7753d9aa65cfbb6392d0d01 100644 (file)
@@ -293,7 +293,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
             row = col.split(percentage=0.75)
             row.prop(md, "use_symmetry")
             row.prop(md, "symmetry_axis", text="")
-            
 
         elif decimate_type == 'UNSUBDIV':
             layout.prop(md, "iterations")
index 4793537273fddb08f0864cd8fbc3e6c7ebad917f..90a172e5fbdfd4d0830e0ec12eebd783e2d97693 100644 (file)
@@ -89,7 +89,7 @@ class GreasePencilDrawingToolsPanel:
                 row.prop(context.tool_settings, "grease_pencil_source", expand=True)
             elif context.space_data.type == 'CLIP_EDITOR':
                 row.prop(context.space_data, "grease_pencil_source", expand=True)
-        
+
         col.separator()
         col.separator()
 
@@ -192,11 +192,11 @@ class GreasePencilStrokeSculptPanel:
     @staticmethod
     def draw(self, context):
         layout = self.layout
-        
+
         settings = context.tool_settings.gpencil_sculpt
         tool = settings.tool
         brush = settings.brush
-        
+
         layout.column().prop(settings, "tool", expand=True)
 
         col = layout.column()
@@ -394,7 +394,7 @@ class GPENCIL_PIE_sculpt(Menu):
 
         # W - Launch Sculpt Mode
         col = pie.column()
-        #col.label("Tool:")
+        # col.label("Tool:")
         col.prop(settings, "tool", text="")
         col.operator("gpencil.brush_paint", text="Sculpt", icon='SCULPTMODE_HLT')
 
@@ -403,7 +403,7 @@ class GPENCIL_PIE_sculpt(Menu):
         col.prop(brush, "size", slider=True)
         row = col.row(align=True)
         row.prop(brush, "strength", slider=True)
-       # row.prop(brush, "use_pressure_strength", text="", icon_only=True)
+        # row.prop(brush, "use_pressure_strength", text="", icon_only=True)
         col.prop(brush, "use_falloff")
 
         # S - Change Brush Type Shortcuts
index 78ea4fa6c3ff42bf28b5462f87becdfa1021e0c3..1f0107f2a0e90e77808f067f1b776e94e15e0e74 100644 (file)
@@ -242,7 +242,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel, Panel):
         else:
             layout.template_preview(tex, slot=slot)
 
-        #Show Alpha Button for Brush Textures, see #29502
+        # Show Alpha Button for Brush Textures, see #29502
         if context.space_data.texture_context == 'BRUSH':
             layout.prop(tex, "use_preview_alpha")
 
@@ -498,7 +498,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
 
         col = split.column()
 
-        #Only for Material based textures, not for Lamp/World...
+        # Only for Material based textures, not for Lamp/World...
         if slot and isinstance(idblock, Material):
             col.prop(tex, "use_normal_map")
             row = col.row()
@@ -533,7 +533,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
 
         col = split.column()
 
-        #Only for Material based textures, not for Lamp/World...
+        # Only for Material based textures, not for Lamp/World...
         if slot and isinstance(idblock, Material):
             col.prop(tex, "use_normal_map")
             row = col.row()
@@ -590,7 +590,7 @@ class TEXTURE_PT_image_mapping(TextureTypePanel, Panel):
         split = layout.split()
 
         col = split.column(align=True)
-        #col.prop(tex, "crop_rectangle")
+        # col.prop(tex, "crop_rectangle")
         col.label(text="Crop Minimum:")
         col.prop(tex, "crop_min_x", text="X")
         col.prop(tex, "crop_min_y", text="Y")
@@ -777,7 +777,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel, Panel):
         elif vd.file_format == 'IMAGE_SEQUENCE':
             layout.template_ID(tex, "image", open="image.open")
             layout.template_image(tex, "image", tex.image_user, compact=True)
-            #layout.prop(vd, "frame_duration")
+            # layout.prop(vd, "frame_duration")
 
         if vd.file_format in {'BLENDER_VOXEL', 'RAW_8BIT'}:
             layout.prop(vd, "use_still_frame")
index a730ab009dbe20e5472483b0ee7ce26438a35d2c..e809ef9ffde81f62c0b3bf9078dec648506d0c0d 100644 (file)
@@ -1135,6 +1135,7 @@ class CLIP_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel):
 class CLIP_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
     bl_space_type = 'CLIP_EDITOR'
 
+
 # Grease Pencil stroke sculpting tools
 class CLIP_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, Panel):
     bl_space_type = 'CLIP_EDITOR'
index 0f01956f2892383ddebc9f7052af5a7c85476456..d29cd18053f372206a608fbee94d5b97de3c0668 100644 (file)
@@ -728,6 +728,7 @@ class IMAGE_PT_paint(Panel, ImagePaintPanel):
         toolsettings = context.tool_settings.image_paint
         return sima.show_paint
 
+
 class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel):
     bl_label = "Overlay"
     bl_options = {'DEFAULT_CLOSED'}
index d0a2e094f0bcaef361cafd908406e9996f154d03..c648093ff1dcedf00848c49b62a9df8a937bf8ee 100644 (file)
@@ -489,6 +489,7 @@ class NODE_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel):
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'TOOLS'
 
+
 # Grease Pencil stroke sculpting tools
 class NODE_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, Panel):
     bl_space_type = 'NODE_EDITOR'
index eeb6a5063c8687f2fdd6a66962d1cdbe54ca3de6..3e4e6f2698579f60361d111ba28e9f91306c29c7 100644 (file)
@@ -279,11 +279,11 @@ class SEQUENCER_MT_change(Menu):
             stype = strip.type
 
             if stype == 'IMAGE':
-                prop.filter_image = True;
+                prop.filter_image = True
             elif stype == 'MOVIE':
-                prop.filter_movie = True;
+                prop.filter_movie = True
             elif stype == 'SOUND':
-                prop.filter_sound = True;
+                prop.filter_sound = True
 
 
 class SEQUENCER_MT_frame(Menu):
@@ -666,7 +666,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
         elif strip.type == 'GAUSSIAN_BLUR':
             col.prop(strip, "size_x")
             col.prop(strip, "size_y")
+
 
 class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
     bl_label = "Strip Input"
@@ -1142,6 +1142,7 @@ class SEQUENCER_PT_modifiers(SequencerButtonsPanel, Panel):
                         col.prop(mod, "offset")
                         col.prop(mod, "gamma")
 
+
 class SEQUENCER_PT_grease_pencil(GreasePencilDataPanel, SequencerButtonsPanel_Output, Panel):
     bl_space_type = 'SEQUENCE_EDITOR'
     bl_region_type = 'UI'
index 808909a38852f2648fb5c7802b13242f9e1abbcd..49840248e6512fe8501877e56a5218dcdea2c9ec 100644 (file)
@@ -971,7 +971,7 @@ class VIEW3D_MT_select_edit_armature(Menu):
 
 class VIEW3D_MT_select_gpencil(Menu):
     bl_label = "Select"
-    
+
     def draw(self, context):
         layout = self.layout
 
@@ -2936,7 +2936,7 @@ class VIEW3D_MT_edit_armature_delete(Menu):
 
 class VIEW3D_MT_edit_gpencil(Menu):
     bl_label = "GPencil"
-    
+
     def draw(self, context):
         toolsettings = context.tool_settings
 
index 0121be29dd6edff162f198b8c645ccc559bee8d1..526a54a49a212a0ca1e0cfe6d452ef60134951bb 100644 (file)
@@ -816,8 +816,8 @@ def test_cube_shell(context, test):
 
 def main():
     print("Calling main!")
-    #render_gl(bpy.context, "/testme")
-    #ctx_clear_scene()
+    # render_gl(bpy.context, "/testme")
+    # ctx_clear_scene()
 
     context = bpy.context
 
index f3c553cf3ef8c46f96980c14462d5c2322016fbb..7e92b424faad9d32b60c24843fc23850a8724b7c 100644 (file)
@@ -285,8 +285,8 @@ def run_ops(operators, setup_func=None, reset=True):
                 try:
                     op(mode)
                 except:
-                    #import traceback
-                    #traceback.print_exc()
+                    # import traceback
+                    # traceback.print_exc()
                     pass
 
                 if USE_ATTRSET:
@@ -445,7 +445,7 @@ def main():
     filter_op_list(operators)
 
     # for testing, mix the list up.
-    #operators.reverse()
+    # operators.reverse()
 
     if USE_RANDOM:
         import random
index dfc6cd57db6042fd42ca6f99a62874da0c9c0f4b..b5e643ac46d24a49b38e978ce0e30c55fad41efc 100644 (file)
@@ -54,7 +54,7 @@ def parse_rst_py(filepath):
     for i, line in enumerate(f):
         line_strip = line.lstrip()
         # ^\.\.\s[a-zA-Z09\-]+::.*$
-        #if line.startswith(".. "):
+        # if line.startswith(".. "):
         march = re_prefix.match(line_strip)
 
         if march: