Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-28 23:33:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-28 23:33:14 +0400
commit8e3d590b76222c332d40dfeca81d899e1df5c503 (patch)
tree84bc1ca0b6e645d463034594dd76814d9121c9f0 /release/scripts/modules/bpy_types.py
parent8fce915b6e6b008e89696c7ff96355d9a1f2ccf1 (diff)
code cleanup: python/pep8 and double-promotion warnings.
Diffstat (limited to 'release/scripts/modules/bpy_types.py')
-rw-r--r--release/scripts/modules/bpy_types.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index f42fd8e3107..85a532e9a27 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -729,6 +729,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
self.preset_operator,
filter_ext=lambda ext: ext.lower() in {".py", ".xml"})
+
class Region(StructRNA):
__slots__ = ()
@@ -782,9 +783,11 @@ def gen_valid_identifier(seq):
if ch == '_' or ch.isalpha() or ch.isdigit():
yield ch
+
def sanitize_identifier(name):
return ''.join(gen_valid_identifier(name))
+
def unique_identifier(name, identifier_list):
# First some basic sanitation, to make a usable identifier string from the name
base = sanitize_identifier(name)
@@ -796,6 +799,7 @@ def unique_identifier(name, identifier_list):
identifier = base + str(index)
return identifier
+
class RNAMetaNode(RNAMetaPropGroup):
def __new__(cls, name, bases, classdict, **args):
# Wrapper for node.init, to add sockets from templates
@@ -846,7 +850,7 @@ class Node(StructRNA, metaclass=RNAMetaNode):
@classmethod
def poll(cls, ntree):
- return True
+ return True
class NodeSocket(StructRNA, metaclass=RNAMetaPropGroup):
@@ -870,17 +874,18 @@ class CompositorNode(Node):
@classmethod
def poll(cls, ntree):
- return ntree.bl_idname == 'CompositorNodeTree'
+ return ntree.bl_idname == 'CompositorNodeTree'
def update(self):
self.tag_need_exec()
+
class ShaderNode(Node):
__slots__ = ()
@classmethod
def poll(cls, ntree):
- return ntree.bl_idname == 'ShaderNodeTree'
+ return ntree.bl_idname == 'ShaderNodeTree'
class TextureNode(Node):
@@ -888,5 +893,4 @@ class TextureNode(Node):
@classmethod
def poll(cls, ntree):
- return ntree.bl_idname == 'TextureNodeTree'
-
+ return ntree.bl_idname == 'TextureNodeTree'