diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-01 06:41:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-01 06:41:15 +0400 |
commit | c8652b301fb59eead1f76bf34215af5413ffa4aa (patch) | |
tree | c80cb73435621bce2c473c5063ab9e2c266be5c8 /release | |
parent | 14e94d742e985488490cbbb74e6e1dc9923bc4c2 (diff) |
pep8 checker, mostly pedantic style changes but also found an error in mesh_utils.mesh_linked_faces()
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/addon_utils.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 1 | ||||
-rw-r--r-- | release/scripts/modules/bpyml_ui.py | 4 | ||||
-rw-r--r-- | release/scripts/modules/mesh_utils.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/object_quick_effects.py | 13 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/object_randomize_transform.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/presets.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 19 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_animviz.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_particle.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 4 | ||||
-rw-r--r-- | release/scripts/templates/operator_modal_timer.py | 1 |
12 files changed, 28 insertions, 27 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 62a9f691acf..3877f711b7f 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -107,7 +107,7 @@ def modules(module_cache): import traceback traceback.print_exc() raise - + return mod else: return None @@ -246,7 +246,6 @@ def disable(module_name, default_set=True): :type module_name: string """ import sys - import traceback import bpy_types as _bpy_types mod = sys.modules.get(module_name) @@ -259,6 +258,7 @@ def disable(module_name, default_set=True): try: mod.unregister() except: + import traceback traceback.print_exc() else: print("addon_utils.disable", module_name, "not loaded") diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index cb2349eab1d..b7c52a35fdf 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -347,7 +347,6 @@ def keyconfig_set(filepath): print("loading preset:", filepath) keyconfigs = _bpy.context.window_manager.keyconfigs - kc_orig = keyconfigs.active keyconfigs_old = keyconfigs[:] diff --git a/release/scripts/modules/bpyml_ui.py b/release/scripts/modules/bpyml_ui.py index 2462dd60e3e..1e0522974d1 100644 --- a/release/scripts/modules/bpyml_ui.py +++ b/release/scripts/modules/bpyml_ui.py @@ -65,7 +65,7 @@ def _parse_rna_args(base, py_node): def _call_recursive(context, base, py_node): - prop = base.bl_rna.properties.get(py_node[TAG]) + # prop = base.bl_rna.properties.get(py_node[TAG]) if py_node[TAG] in base.bl_rna.properties: value = py_node[ARGS].get("expr") if value: @@ -73,7 +73,7 @@ def _call_recursive(context, base, py_node): setattr(base, py_node[TAG], value) else: value = py_node[ARGS]['value'] # have to have this - setattr(base, name, value) + setattr(base, py_node[TAG], value) else: args = _parse_rna_args(base, py_node) func_new = getattr(base, py_node[TAG]) diff --git a/release/scripts/modules/mesh_utils.py b/release/scripts/modules/mesh_utils.py index f65aa8b306f..5bacff7b0cc 100644 --- a/release/scripts/modules/mesh_utils.py +++ b/release/scripts/modules/mesh_utils.py @@ -19,7 +19,7 @@ # <pep8 compliant> -def mesh_linked_faces(me): +def mesh_linked_faces(mesh): ''' Splits the mesh into connected parts, these parts are returned as lists of faces. diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py index 73119a6e216..b50bb2dc3cc 100644 --- a/release/scripts/startup/bl_operators/object_quick_effects.py +++ b/release/scripts/startup/bl_operators/object_quick_effects.py @@ -18,7 +18,6 @@ # <pep8 compliant> -import mathutils from mathutils import Vector import bpy from bpy.props import BoolProperty, EnumProperty, IntProperty, FloatProperty, FloatVectorProperty @@ -80,6 +79,7 @@ class MakeFur(bpy.types.Operator): return {'FINISHED'} + def obj_bb_minmax(obj, min_co, max_co): for i in range(0, 8): bb_vec = Vector((obj.bound_box[i][0], obj.bound_box[i][1], obj.bound_box[i][2])) * obj.matrix_world @@ -91,6 +91,7 @@ def obj_bb_minmax(obj, min_co, max_co): max_co[1] = max(bb_vec[1], max_co[1]) max_co[2] = max(bb_vec[2], max_co[2]) + class MakeSmoke(bpy.types.Operator): bl_idname = "object.make_smoke" bl_label = "Make Smoke" @@ -148,8 +149,8 @@ class MakeSmoke(bpy.types.Operator): obj.name = "Smoke Domain" # give the smoke some room above the flows - obj.location = 0.5 * (max_co + min_co) + Vector((0,0,1)) - obj.scale = 0.5 * (max_co - min_co) + Vector((1,1,2)) + obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, 1.0)) + obj.scale = 0.5 * (max_co - min_co) + Vector((1.0, 1.0, 2.0)) # setup smoke domain bpy.ops.object.modifier_add({"object": obj}, type='SMOKE') @@ -261,8 +262,8 @@ class MakeFluid(bpy.types.Operator): # give the fluid some room below the flows and scale with initial velocity v = 0.5 * self.initial_velocity - obj.location = 0.5 * (max_co + min_co) + Vector((0,0,-1)) + v - obj.scale = 0.5 * (max_co - min_co) + Vector((1,1,2)) + Vector((abs(v[0]), abs(v[1]), abs(v[2]))) + obj.location = 0.5 * (max_co + min_co) + Vector((0.0, 0.0, -1.0)) + v + obj.scale = 0.5 * (max_co - min_co) + Vector((1.0, 1.0, 2.0)) + Vector((abs(v[0]), abs(v[1]), abs(v[2]))) # setup smoke domain bpy.ops.object.modifier_add({"object": obj}, type='FLUID_SIMULATION') @@ -279,7 +280,7 @@ class MakeFluid(bpy.types.Operator): mat.specular_intensity = 1 mat.specular_hardness = 100 mat.use_transparency = True - mat.alpha = 0 + mat.alpha = 0.0 mat.transparency_method = 'RAYTRACE' mat.raytrace_transparency.ior = 1.33 mat.raytrace_transparency.depth = 4 diff --git a/release/scripts/startup/bl_operators/object_randomize_transform.py b/release/scripts/startup/bl_operators/object_randomize_transform.py index d72c600ef78..9dc5086086f 100644 --- a/release/scripts/startup/bl_operators/object_randomize_transform.py +++ b/release/scripts/startup/bl_operators/object_randomize_transform.py @@ -84,7 +84,7 @@ def randomize_selected(seed, delta, loc, rot, scale, scale_even): uniform(0.0, 0.0), uniform(0.0, 0.0), uniform(0.0, 0.0) -from bpy.props import IntProperty, BoolProperty, FloatProperty, FloatVectorProperty +from bpy.props import IntProperty, BoolProperty, FloatVectorProperty class RandomizeLocRotSize(bpy.types.Operator): diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index e6f71ef9573..1cef67dc710 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -19,7 +19,6 @@ # <pep8 compliant> import bpy -import os class AddPresetBase(): diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 6ed46191099..a77ff0ce5e3 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -859,6 +859,7 @@ class WM_OT_keyconfig_activate(bpy.types.Operator): bpy.utils.keyconfig_set(self.filepath) return {'FINISHED'} + class WM_OT_appconfig_default(bpy.types.Operator): bl_idname = "wm.appconfig_default" bl_label = "Default Application Configuration" @@ -868,13 +869,14 @@ class WM_OT_appconfig_default(bpy.types.Operator): context.window_manager.keyconfigs.active = context.window_manager.keyconfigs.default - filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py") - + filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py") + if os.path.exists(filepath): - bpy.ops.script.execute_preset(filepath = filepath, menu_idname = "USERPREF_MT_interaction_presets") - + bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets") + return {'FINISHED'} + class WM_OT_appconfig_activate(bpy.types.Operator): bl_idname = "wm.appconfig_activate" bl_label = "Activate Application Configuration" @@ -884,14 +886,15 @@ class WM_OT_appconfig_activate(bpy.types.Operator): def execute(self, context): import os bpy.utils.keyconfig_set(self.filepath) - + filepath = self.filepath.replace("keyconfig", "interaction") - + if os.path.exists(filepath): - bpy.ops.script.execute_preset(filepath = filepath, menu_idname = "USERPREF_MT_interaction_presets") - + bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets") + return {'FINISHED'} + class WM_OT_sysinfo(bpy.types.Operator): '''Generate System Info''' bl_idname = "wm.sysinfo" diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py index ac25c643cab..cebe58291d8 100644 --- a/release/scripts/startup/bl_ui/properties_animviz.py +++ b/release/scripts/startup/bl_ui/properties_animviz.py @@ -17,8 +17,6 @@ # ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> -import bpy - # Generic Panels (Independent of DataType) diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 09915b03926..014aead3c08 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -889,7 +889,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel): split = layout.split(percentage=0.33) split.label(text="Split uv's:") split.prop(part, "billboard_uv_split", text="Number of splits") - + if psys: col = layout.column() col.active = part.billboard_uv_split > 1 diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 69fe7c3d948..a81561de93f 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -21,7 +21,7 @@ import bpy import os import addon_utils -from bpy.props import StringProperty, BoolProperty, EnumProperty +from bpy.props import StringProperty, BoolProperty def ui_items_general(col, context): @@ -119,6 +119,7 @@ class USERPREF_MT_interaction_presets(bpy.types.Menu): preset_operator = "script.execute_preset" draw = bpy.types.Menu.draw_preset + class USERPREF_MT_appconfigs(bpy.types.Menu): bl_label = "AppPresets" preset_subdir = "keyconfig" @@ -130,6 +131,7 @@ class USERPREF_MT_appconfigs(bpy.types.Menu): # now draw the presets bpy.types.Menu.draw_preset(self, context) + class USERPREF_MT_splash(bpy.types.Menu): bl_label = "Splash" diff --git a/release/scripts/templates/operator_modal_timer.py b/release/scripts/templates/operator_modal_timer.py index d8c218f67ea..d2267191cf5 100644 --- a/release/scripts/templates/operator_modal_timer.py +++ b/release/scripts/templates/operator_modal_timer.py @@ -1,5 +1,4 @@ import bpy -from bpy.props import IntProperty, FloatProperty class ModalTimerOperator(bpy.types.Operator): |