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>2012-09-27 01:19:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-27 01:19:51 +0400
commit8a51d235e608dc45c30338aaaa74f925c185c73a (patch)
treed62a750e88fb3ea7fb52fcb9f498c7e60134421d
parentdbeddcdbcef7d6622f08c4647e5253165dbebe07 (diff)
pep8 cleanup
-rw-r--r--intern/cycles/blender/addon/ui.py3
-rw-r--r--release/scripts/modules/addon_utils.py6
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_process_msg.py6
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/check_po.py6
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py2
-rw-r--r--release/scripts/modules/bpy/utils.py5
-rw-r--r--release/scripts/modules/console_python.py2
-rw-r--r--release/scripts/modules/rna_xml.py2
-rw-r--r--release/scripts/presets/tracking_settings/blurry_footage.py2
-rw-r--r--release/scripts/presets/tracking_settings/default.py2
-rw-r--r--release/scripts/presets/tracking_settings/fast_motion.py2
-rw-r--r--release/scripts/presets/tracking_settings/planar.py2
-rw-r--r--release/scripts/startup/bl_operators/node.py42
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py2
-rw-r--r--release/scripts/templates/addon_add_object.py1
-rw-r--r--source/tests/bl_rna_wiki_reference.py9
-rw-r--r--source/tests/bl_run_operators.py5
17 files changed, 62 insertions, 37 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 0080ff75ddd..de256796171 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -437,6 +437,7 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
layout.prop(cdata, "use_subdivision")
layout.prop(cdata, "dicing_rate")
+
class Cycles_PT_mesh_normals(CyclesButtonsPanel, Panel):
bl_label = "Normals"
bl_context = "data"
@@ -953,7 +954,7 @@ def draw_device(self, context):
layout.prop(cscene, "device")
elif device_type == 'OPENCL' and cscene.feature_set == 'EXPERIMENTAL':
layout.prop(cscene, "device")
-
+
if cscene.feature_set == 'EXPERIMENTAL' and cscene.device == 'CPU' and engine.with_osl():
layout.prop(cscene, "shading_system")
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 485b4829b71..ab68c9424cd 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -275,7 +275,8 @@ def enable(module_name, default_set=True, persistent=False):
try:
mod.register()
except:
- print("Exception in module register(): %r" % getattr(mod, "__file__", module_name))
+ print("Exception in module register(): %r" %
+ getattr(mod, "__file__", module_name))
handle_error()
del sys.modules[module_name]
return None
@@ -317,7 +318,8 @@ def disable(module_name, default_set=True):
try:
mod.unregister()
except:
- print("Exception in module unregister(): %r" % getattr(mod, "__file__", module_name))
+ print("Exception in module unregister(): %r" %
+ getattr(mod, "__file__", module_name))
import traceback
traceback.print_exc()
else:
diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
index b884423606d..33d3be63b0b 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
@@ -16,7 +16,7 @@
#
# ***** END GPL LICENSE BLOCK *****
-# <pep8-80 compliant>
+# <pep8 compliant>
# Write out messages.txt from Blender.
# XXX: This script is meant to be used from inside Blender!
@@ -43,6 +43,7 @@ UNDOC_OPS_STR = settings.UNDOC_OPS_STR
NC_ALLOWED = settings.WARN_MSGID_NOT_CAPITALIZED_ALLOWED
+
def check(check_ctxt, messages, key, msgsrc):
if check_ctxt is None:
return
@@ -78,7 +79,8 @@ def dump_messages_rna(messages, check_ctxt):
import bpy
def classBlackList():
- blacklist_rna_class = [# core classes
+ blacklist_rna_class = [
+ # core classes
"Context", "Event", "Function", "UILayout",
"BlendData",
# registerable classes
diff --git a/release/scripts/modules/bl_i18n_utils/check_po.py b/release/scripts/modules/bl_i18n_utils/check_po.py
index 03a933887c6..2e82047bb95 100755
--- a/release/scripts/modules/bl_i18n_utils/check_po.py
+++ b/release/scripts/modules/bl_i18n_utils/check_po.py
@@ -162,9 +162,9 @@ def main():
" {} specific context{} present:\n {}\n"
"".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
glob_stats["lvl_ttips"] / glob_stats["nbr"],
- glob_stats["lvl_trans_ttips"]/glob_stats["nbr"],
- glob_stats["lvl_ttips_in_trans"]/glob_stats["nbr"],
- glob_stats["lvl_comm"]/glob_stats["nbr"], glob_stats["nbr_signs"],
+ glob_stats["lvl_trans_ttips"] / glob_stats["nbr"],
+ glob_stats["lvl_ttips_in_trans"] / glob_stats["nbr"],
+ glob_stats["lvl_comm"] / glob_stats["nbr"], glob_stats["nbr_signs"],
glob_stats["nbr_trans_signs"], nbr_contexts, _ctx_txt,
"\n ".join(glob_stats["contexts"]-{""})))
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 3e5394d85a4..25b9daa99e5 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -95,7 +95,6 @@ def parse_messages(fname):
msgctxt_lines = []
comment_lines = []
-
def finalize_message():
nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
reading_comment, is_fuzzy, is_translated, is_commented, \
@@ -225,7 +224,6 @@ def parse_messages(fname):
if reading_msgstr:
finalize_message()
-
return (messages,
{"trans_msg": translated_messages,
"fuzzy_msg": fuzzy_messages,
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index e24b61a757d..573694ff08e 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -59,6 +59,7 @@ import addon_utils as _addon_utils
_script_module_dirs = "startup", "modules"
+
def _test_import(module_name, loaded_modules):
use_time = _bpy.app.debug_python
@@ -615,12 +616,15 @@ def _blender_default_map():
# hooks for doc lookups
_manual_map = [_blender_default_map]
+
def register_manual_map(manual_hook):
_manual_map.append(manual_hook)
+
def unregister_manual_map(manual_hook):
_manual_map.remove(manual_hook)
+
def manual_map():
# reverse so default is called last
for cb in reversed(_manual_map):
@@ -633,4 +637,3 @@ def manual_map():
continue
yield prefix, url_manual_mapping
-
diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py
index 6e8fee07c0f..582a1c6ae14 100644
--- a/release/scripts/modules/console_python.py
+++ b/release/scripts/modules/console_python.py
@@ -304,7 +304,7 @@ def copy_as_script(context):
for line in sc.scrollback:
text = line.body
type = line.type
-
+
if type == 'INFO': # ignore autocomp.
continue
if type == 'INPUT':
diff --git a/release/scripts/modules/rna_xml.py b/release/scripts/modules/rna_xml.py
index 2170c311d96..2ea978419b9 100644
--- a/release/scripts/modules/rna_xml.py
+++ b/release/scripts/modules/rna_xml.py
@@ -259,7 +259,7 @@ def xml2rna(root_xml,
except ValueError:
try:
value_xml_coerce = [float(v) for v in value_xml_split]
- except ValueError: # bool vector property
+ except ValueError: # bool vector property
value_xml_coerce = [{'TRUE': True, 'FALSE': False}[v] for v in value_xml_split]
del value_xml_split
tp_name = 'ARRAY'
diff --git a/release/scripts/presets/tracking_settings/blurry_footage.py b/release/scripts/presets/tracking_settings/blurry_footage.py
index 0423f7662a2..de6f085f53d 100644
--- a/release/scripts/presets/tracking_settings/blurry_footage.py
+++ b/release/scripts/presets/tracking_settings/blurry_footage.py
@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
-settings.default_correlation_min = 0.6 \ No newline at end of file
+settings.default_correlation_min = 0.6
diff --git a/release/scripts/presets/tracking_settings/default.py b/release/scripts/presets/tracking_settings/default.py
index 0aef22195e7..3c61ea7cd7f 100644
--- a/release/scripts/presets/tracking_settings/default.py
+++ b/release/scripts/presets/tracking_settings/default.py
@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
-settings.default_correlation_min = 0.75 \ No newline at end of file
+settings.default_correlation_min = 0.75
diff --git a/release/scripts/presets/tracking_settings/fast_motion.py b/release/scripts/presets/tracking_settings/fast_motion.py
index f7f6b37db74..6051f235b0c 100644
--- a/release/scripts/presets/tracking_settings/fast_motion.py
+++ b/release/scripts/presets/tracking_settings/fast_motion.py
@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
-settings.default_correlation_min = 0.6 \ No newline at end of file
+settings.default_correlation_min = 0.6
diff --git a/release/scripts/presets/tracking_settings/planar.py b/release/scripts/presets/tracking_settings/planar.py
index b25df1fc466..49a64046002 100644
--- a/release/scripts/presets/tracking_settings/planar.py
+++ b/release/scripts/presets/tracking_settings/planar.py
@@ -14,4 +14,4 @@ settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
-settings.default_correlation_min = 0.75 \ No newline at end of file
+settings.default_correlation_min = 0.75
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py
index ee005fcb8bb..fb264cb3429 100644
--- a/release/scripts/startup/bl_operators/node.py
+++ b/release/scripts/startup/bl_operators/node.py
@@ -22,12 +22,16 @@ import bpy
from bpy.types import Operator
from bpy.props import EnumProperty
-# XXX These node item lists should actually be generated by a callback at operator execution time (see node_type_items below),
-# using the active node tree from the context. Due to a difficult bug in bpy this is not possible (item list memory gets freed too early),
+# XXX These node item lists should actually be generated by a callback at
+# operator execution time (see node_type_items below),
+# using the active node tree from the context.
+# Due to a difficult bug in bpy this is not possible
+# (item list memory gets freed too early),
# so for now just copy the static item lists to these global variables.
#
-# In the custom_nodes branch, the static per-tree-type node items are replaced by a single independent type list anyway (with a poll function
-# to limit node types to the respective trees). So this workaround is only temporary.
+# In the custom_nodes branch, the static per-tree-type node items are replaced
+# by a single independent type list anyway (with a poll function to limit node
+# types to the respective trees). So this workaround is only temporary.
# lazy init
node_type_items_dict = {}
@@ -39,18 +43,21 @@ node_group_prefix = 'GROUP_'
# Generate a list of enum items for a given node class
# Copy existing type enum, adding a prefix to distinguish from node groups
-# Skip the base node group type, node groups will be added below for all existing group trees
+# Skip the base node group type,
+# node groups will be added below for all existing group trees
def node_type_items(node_class):
return [(node_type_prefix + item.identifier, item.name, item.description)
- for item in node_class.bl_rna.properties['type'].enum_items if item.identifier != 'GROUP']
+ for item in node_class.bl_rna.properties['type'].enum_items
+ if item.identifier != 'GROUP']
# Generate items for node group types
# Filter by the given tree_type
-# Node group trees don't have a description property yet (could add this as a custom property though)
+# Node group trees don't have a description property yet
+# (could add this as a custom property though)
def node_group_items(tree_type):
return [(node_group_prefix + group.name, group.name, '')
- for group in bpy.data.node_groups if group.type == tree_type]
+ for group in bpy.data.node_groups if group.type == tree_type]
# Returns the enum item list for the edited tree in the context
@@ -71,7 +78,11 @@ def node_type_items_cb(self, context):
})
# XXX Does not work correctly, see comment above
- #return [(item.identifier, item.name, item.description, item.value) for item in tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
+ '''
+ return [(item.identifier, item.name, item.description, item.value)
+ for item in
+ tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
+ '''
if tree.type in node_type_items_dict:
return node_type_items_dict[tree.type] + node_group_items(tree.type)
@@ -85,7 +96,8 @@ class NODE_OT_add_search(Operator):
bl_label = "Search and Add Node"
bl_options = {'REGISTER', 'UNDO'}
- # XXX this should be called 'node_type' but the operator search property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
+ # XXX this should be called 'node_type' but the operator search
+ # property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
type = EnumProperty(
name="Node Type",
description="Node type",
@@ -98,14 +110,17 @@ class NODE_OT_add_search(Operator):
space = context.space_data
tree = space.edit_tree
- # Enum item identifier has an additional prefix to distinguish base node types from node groups
+ # Enum item identifier has an additional prefix to
+ # distinguish base node types from node groups
item = self.type
if item.startswith(node_type_prefix):
# item means base node type
node = tree.nodes.new(type=item[len(node_type_prefix):])
elif item.startswith(node_group_prefix):
# item means node group type
- node = tree.nodes.new(type='GROUP', group=bpy.data.node_groups[item[len(node_group_prefix):]])
+ node = tree.nodes.new(
+ type='GROUP',
+ group=bpy.data.node_groups[item[len(node_group_prefix):]])
else:
return None
@@ -133,7 +148,8 @@ class NODE_OT_add_search(Operator):
v2d = context.region.view2d
# convert mouse position to the View2D for later node placement
- space.cursor_location = v2d.region_to_view(event.mouse_region_x, event.mouse_region_y)
+ space.cursor_location = v2d.region_to_view(event.mouse_region_x,
+ event.mouse_region_y)
context.window_manager.invoke_search_popup(self)
return {'CANCELLED'}
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index ae0c4d4161c..ed390be49f5 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -216,7 +216,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)
-
+
split = layout.split()
col = split.column()
diff --git a/release/scripts/templates/addon_add_object.py b/release/scripts/templates/addon_add_object.py
index d7fc23f9242..931f7d51aad 100644
--- a/release/scripts/templates/addon_add_object.py
+++ b/release/scripts/templates/addon_add_object.py
@@ -82,6 +82,7 @@ def register():
bpy.utils.register_manual_map(add_object_manual_map)
bpy.types.INFO_MT_mesh_add.append(add_object_button)
+
def unregister():
bpy.utils.unregister_class(OBJECT_OT_add_object)
bpy.utils.unregister_manual_map(add_object_manual_map)
diff --git a/source/tests/bl_rna_wiki_reference.py b/source/tests/bl_rna_wiki_reference.py
index a4019214138..cfe7f22f7dd 100644
--- a/source/tests/bl_rna_wiki_reference.py
+++ b/source/tests/bl_rna_wiki_reference.py
@@ -29,9 +29,10 @@
import bpy
+
def test_data():
import rna_wiki_reference
-
+
assert(isinstance(rna_wiki_reference.url_manual_mapping, tuple))
for i, value in enumerate(rna_wiki_reference.url_manual_mapping):
try:
@@ -44,12 +45,11 @@ def test_data():
traceback.print_exc()
raise
-# a stripped down version of api_dump() in rna_info_dump.py
+# a stripped down version of api_dump() in rna_info_dump.py
def test_lookup_coverage():
def rna_ids():
-
import rna_info
struct = rna_info.BuildRNAInfo()[0]
for struct_id, v in sorted(struct.items()):
@@ -81,11 +81,12 @@ def test_lookup_coverage():
print("")
print("---------------------")
print("Undocumented Sections")
-
+
for rna_group in sorted(set_group_all):
if rna_group not in set_group_doc:
print("%s.*" % rna_group)
+
def test_urls():
pass # TODO
diff --git a/source/tests/bl_run_operators.py b/source/tests/bl_run_operators.py
index 146b60b8f28..f792b83a8cd 100644
--- a/source/tests/bl_run_operators.py
+++ b/source/tests/bl_run_operators.py
@@ -89,6 +89,7 @@ def run_ops(operators, setup_func=None, reset=True):
bpy.ops.wm.read_factory_settings()
setup_func()
+
# contexts
def ctx_clear_scene(): # copied from batch_import.py
unique_obs = set()
@@ -231,7 +232,7 @@ def main():
#import random
#random.shuffle(operators)
-
+
# 2 passes, first just run setup_func to make sure they are ok
for operators_test in ((), operators):
# Run the operator tests in different contexts
@@ -259,7 +260,7 @@ def main():
run_ops(operators_test, setup_func=ctx_editmode_mball)
run_ops(operators_test, setup_func=ctx_editmode_text)
run_ops(operators_test, setup_func=ctx_editmode_lattice)
-
+
if not operators_test:
print("All setup functions run fine!")