diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 07:05:19 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-27 07:05:19 +0400 |
commit | 2085a42e52f5b0d18a4516af15132d112b11a8c1 (patch) | |
tree | 1cc22295204861157183fe73a6220734e25c6f42 /release/scripts/startup/bl_operators | |
parent | bb42703ea34e539e441dd90f5cbba16599e91506 (diff) |
pep8 cleanup
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/anim.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 23 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/presets.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/vertexpaint_dirt.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/view3d.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 5 |
6 files changed, 27 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py index 943eed74b1d..ed20cb22297 100644 --- a/release/scripts/startup/bl_operators/anim.py +++ b/release/scripts/startup/bl_operators/anim.py @@ -261,8 +261,8 @@ class ClearUselessActions(Operator): for action in bpy.data.actions: # if only user is "fake" user... - if ((self.only_unused is False) or - (action.use_fake_user and action.users == 1)): + if ((self.only_unused is False) or + (action.use_fake_user and action.users == 1)): # if it has F-Curves, then it's a "action library" # (i.e. walk, wave, jump, etc.) diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index c9ce38e1c6f..a28c9bafe49 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -18,9 +18,17 @@ # <pep8-80 compliant> -import bpy, nodeitems_utils -from bpy.types import Operator, PropertyGroup -from bpy.props import BoolProperty, CollectionProperty, EnumProperty, IntProperty, StringProperty +import bpy +import nodeitems_utils +from bpy.types import (Operator, + PropertyGroup, + ) +from bpy.props import (BoolProperty, + CollectionProperty, + EnumProperty, + IntProperty, + StringProperty, + ) class NodeSetting(PropertyGroup): @@ -30,6 +38,7 @@ class NodeSetting(PropertyGroup): default="", ) + # Base class for node 'Add' operators class NodeAddOperator(): @@ -80,12 +89,12 @@ class NodeAddOperator(): for setting in self.settings: # XXX catch exceptions here? value = eval(setting.value) - + try: setattr(node, setting.name, value) except AttributeError as e: - self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute "+setting.name) - print (str(e)) + self.report({'ERROR_INVALID_INPUT'}, "Node has no attribute " + setting.name) + print(str(e)) # Continue despite invalid attribute if space.use_hidden_preview: @@ -198,7 +207,7 @@ class NODE_OT_add_search(NodeAddOperator, Operator): # no need to keep self._enum_item_hack.clear() - + if item: # apply settings from the node item for setting in item.settings.items(): diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index ed0943ac2e0..05dfd882180 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -30,7 +30,9 @@ class AddPresetBase(): - preset_subdir """ # bl_idname = "script.preset_base_add" # bl_label = "Add a Python Preset" - bl_options = {'REGISTER', 'INTERNAL'} # only because invoke_props_popup requires. Also do not add to search menu. + + # only because invoke_props_popup requires. Also do not add to search menu. + bl_options = {'REGISTER', 'INTERNAL'} name = StringProperty( name="Name", diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py index fbca4e1ac73..345d8d4d3a1 100644 --- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py +++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py @@ -23,6 +23,7 @@ # Contributor(s): Keith "Wahooney" Boshoff, Campbell Barton + def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only): from mathutils import Vector from math import acos diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index cfdb5dbe677..e0b5526e220 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -138,7 +138,7 @@ class VIEW3D_OT_select_or_deselect_all(Operator): x = event.mouse_region_x y = event.mouse_region_y - if self.extend == False and self.toggle == False and self.deselect == False: + if self.extend is False and self.toggle is False and self.deselect is False: active_object = context.active_object if active_object: diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index fba7672e846..5cb7a44267a 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1180,6 +1180,7 @@ class WM_OT_keyconfig_activate(Operator): else: return {'CANCELLED'} + class WM_OT_appconfig_default(Operator): bl_idname = "wm.appconfig_default" bl_label = "Default Application Configuration" @@ -1574,8 +1575,9 @@ class WM_OT_addon_enable(Operator): def execute(self, context): import addon_utils - + err_str = "" + def err_cb(): import traceback nonlocal err_str @@ -1618,6 +1620,7 @@ class WM_OT_addon_disable(Operator): import addon_utils err_str = "" + def err_cb(): import traceback nonlocal err_str |