From d924998d3e65334c5db2257c5dc4335261adc288 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 1 Feb 2016 00:47:10 +1100 Subject: Cleanup: pep8 --- release/scripts/modules/bpy/path.py | 24 +++++++++++++--------- release/scripts/modules/bpy_extras/image_utils.py | 8 +++++--- release/scripts/modules/bpy_extras/io_utils.py | 6 ++++-- release/scripts/modules/bpy_types.py | 2 +- release/scripts/modules/sys_info.py | 1 - .../scripts/startup/bl_ui/properties_constraint.py | 2 +- .../startup/bl_ui/properties_data_modifier.py | 1 - .../bl_ui/properties_grease_pencil_common.py | 10 ++++----- .../scripts/startup/bl_ui/properties_texture.py | 10 ++++----- release/scripts/startup/bl_ui/space_clip.py | 1 + release/scripts/startup/bl_ui/space_image.py | 1 + release/scripts/startup/bl_ui/space_node.py | 1 + release/scripts/startup/bl_ui/space_sequencer.py | 9 ++++---- release/scripts/startup/bl_ui/space_view3d.py | 4 ++-- 14 files changed, 45 insertions(+), 35 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py index db4c8da30f0..99c46e4b034 100644 --- a/release/scripts/modules/bpy/path.py +++ b/release/scripts/modules/bpy/path.py @@ -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 diff --git a/release/scripts/modules/bpy_extras/image_utils.py b/release/scripts/modules/bpy_extras/image_utils.py index ad774cd1bda..f197596fec0 100644 --- a/release/scripts/modules/bpy_extras/image_utils.py +++ b/release/scripts/modules/bpy_extras/image_utils.py @@ -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` diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py index 65ccc3f8dc3..a7ecd0b80c0 100644 --- a/release/scripts/modules/bpy_extras/io_utils.py +++ b/release/scripts/modules/bpy_extras/io_utils.py @@ -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", diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 830db976822..e21b34adc4e 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -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 diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 382cb181d5f..49395dd48f0 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -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 diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 7ade444d7ae..ef0fc9c7c9f 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -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) diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 98570ca5280..f26147e0673 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -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") diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 4793537273f..90a172e5fbd 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -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 diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 78ea4fa6c3f..1f0107f2a0e 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -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") diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index a730ab009db..e809ef9ffde 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -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' diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 0f01956f289..d29cd18053f 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -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'} diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index d0a2e094f0b..c648093ff1d 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -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' diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index eeb6a5063c8..3e4e6f26985 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -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' diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 808909a3885..49840248e65 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -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 -- cgit v1.2.3