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/node.py | |
parent | bb42703ea34e539e441dd90f5cbba16599e91506 (diff) |
pep8 cleanup
Diffstat (limited to 'release/scripts/startup/bl_operators/node.py')
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 23 |
1 files changed, 16 insertions, 7 deletions
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(): |