diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-26 13:57:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-26 13:57:17 +0400 |
commit | 7a7c13e2e7118304a7fe936d0b6c2f8e9a8cad53 (patch) | |
tree | 23a90d13d5034a7baeb1eba1f597eabf3a029911 | |
parent | 56a8c5f8a4da28b3e808e28c6875043a573b5d9b (diff) |
patch [#31578] Standard-conformal sets for .report() and operator return values
from Sebastian Nell (codemanx)
-rw-r--r-- | add_mesh_extra_objects/add_mesh_teapot.py | 4 | ||||
-rw-r--r-- | add_mesh_extra_objects/add_mesh_torusknot.py | 2 | ||||
-rw-r--r-- | io_export_directx_x.py | 2 | ||||
-rw-r--r-- | mesh_bsurfaces.py | 6 | ||||
-rw-r--r-- | mocap/__init__.py | 40 | ||||
-rw-r--r-- | paint_palette.py | 12 | ||||
-rw-r--r-- | render_copy_settings/__init__.py | 4 | ||||
-rw-r--r-- | render_copy_settings/operator.py | 6 |
8 files changed, 38 insertions, 38 deletions
diff --git a/add_mesh_extra_objects/add_mesh_teapot.py b/add_mesh_extra_objects/add_mesh_teapot.py index 2eb9905a..7530735b 100644 --- a/add_mesh_extra_objects/add_mesh_teapot.py +++ b/add_mesh_extra_objects/add_mesh_teapot.py @@ -53,9 +53,9 @@ class AddTeapot(bpy.types.Operator): def execute(self, context): verts, faces = make_teapot(self.objecttype, self.resolution) - # Actually create the mesh object from this geometry data. + # Actually create the mesh object from this geometry data. obj = create_mesh_object(context, verts, [], faces, "Teapot") - return {"FINISHED"} + return {'FINISHED'} def menu_func(self, context): self.layout.operator(AddTeapot.bl_idname, text="Teapot+", icon="MESH_CUBE") diff --git a/add_mesh_extra_objects/add_mesh_torusknot.py b/add_mesh_extra_objects/add_mesh_torusknot.py index b3ae6518..7174c657 100644 --- a/add_mesh_extra_objects/add_mesh_torusknot.py +++ b/add_mesh_extra_objects/add_mesh_torusknot.py @@ -132,7 +132,7 @@ class AddTorusKnot(bpy.types.Operator): verts, faces = make_knot(self.objecttype, self.resolution) obj = create_mesh_object(context, verts, [], faces, "Torus Knot") - return {"FINISHED"} + return {'FINISHED'} ''' def menu_func(self, context): self.layout.operator(AddTorusKnot.bl_idname, text="Torus Knot", icon="MESH_CUBE") diff --git a/io_export_directx_x.py b/io_export_directx_x.py index 9dbfba70..cf4c8776 100644 --- a/io_export_directx_x.py +++ b/io_export_directx_x.py @@ -1269,7 +1269,7 @@ class DirectXExporter(bpy.types.Operator): Verbose=self.Verbose) ExportDirectX(Config) - return {"FINISHED"} + return {'FINISHED'} def invoke(self, context, event): if not self.filepath: diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py index 4fae2644..1b1f2319 100644 --- a/mesh_bsurfaces.py +++ b/mesh_bsurfaces.py @@ -755,7 +755,7 @@ class GPENCIL_OT_SURFSK_add_surface(bpy.types.Operator): bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') - return {"FINISHED"} + return {'FINISHED'} def invoke (self, context, event): bpy.ops.object.editmode_toggle('INVOKE_REGION_WIN') @@ -764,7 +764,7 @@ class GPENCIL_OT_SURFSK_add_surface(bpy.types.Operator): self.execute(context) - return {"FINISHED"} + return {'FINISHED'} @@ -822,7 +822,7 @@ class GPENCIL_OT_SURFSK_strokes_to_curves(bpy.types.Operator): self.execute(context) - return {"FINISHED"} + return {'FINISHED'} def register(): diff --git a/mocap/__init__.py b/mocap/__init__.py index dd82019e..225a304e 100644 --- a/mocap/__init__.py +++ b/mocap/__init__.py @@ -454,7 +454,7 @@ class OBJECT_OT_RetargetButton(bpy.types.Operator): enduser_obj.data.advancedRetarget = True else: retarget.totalRetarget(performer_obj, enduser_obj, scene, s_frame, e_frame) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -477,7 +477,7 @@ class OBJECT_OT_SaveMappingButton(bpy.types.Operator): enduser_obj = bpy.context.active_object performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj][0] retarget.createDictionary(performer_obj.data, enduser_obj.data) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -500,7 +500,7 @@ class OBJECT_OT_LoadMappingButton(bpy.types.Operator): enduser_obj = bpy.context.active_object performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj][0] retarget.loadMapping(performer_obj.data, enduser_obj.data) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -532,7 +532,7 @@ class OBJECT_OT_SelectMapBoneButton(bpy.types.Operator): selectedBone = bone.name break performer_obj.data.bones[self.perf_bone].map = selectedBone - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -553,7 +553,7 @@ class OBJECT_OT_ConvertSamplesButton(bpy.types.Operator): def execute(self, context): mocap_tools.fcurves_simplify(context, context.active_object) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -568,7 +568,7 @@ class OBJECT_OT_LooperButton(bpy.types.Operator): def execute(self, context): mocap_tools.autoloop_anim() - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -583,7 +583,7 @@ class OBJECT_OT_DenoiseButton(bpy.types.Operator): def execute(self, context): mocap_tools.denoise_median() - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -599,7 +599,7 @@ class OBJECT_OT_LimitDOFButton(bpy.types.Operator): def execute(self, context): performer_obj = [obj for obj in context.selected_objects if obj != context.active_object][0] mocap_tools.limit_dof(context, performer_obj, context.active_object) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -620,7 +620,7 @@ class OBJECT_OT_RemoveLimitDOFButton(bpy.types.Operator): def execute(self, context): mocap_tools.limit_dof_toggle_off(context, context.active_object) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -638,7 +638,7 @@ class OBJECT_OT_RotateFixArmature(bpy.types.Operator): def execute(self, context): mocap_tools.rotate_fix_armature(context.active_object.data) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -656,7 +656,7 @@ class OBJECT_OT_ScaleFixArmature(bpy.types.Operator): enduser_obj = bpy.context.active_object performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj][0] mocap_tools.scale_fix_armature(performer_obj, enduser_obj) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -686,7 +686,7 @@ class MOCAP_OT_AddMocapFix(bpy.types.Operator): enduser_arm = enduser_obj.data new_mcon = enduser_arm.mocap_constraints.add() new_mcon.type = self.type - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -711,7 +711,7 @@ class OBJECT_OT_RemoveMocapConstraint(bpy.types.Operator): cons_obj = mocap_constraints.getConsObj(bone) mocap_constraints.removeConstraint(m_constraint, cons_obj) m_constraints.remove(self.constraint) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -727,7 +727,7 @@ class OBJECT_OT_BakeMocapConstraints(bpy.types.Operator): def execute(self, context): mocap_constraints.bakeConstraints(context) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -743,7 +743,7 @@ class OBJECT_OT_UnbakeMocapConstraints(bpy.types.Operator): def execute(self, context): mocap_constraints.unbakeConstraints(context) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -760,7 +760,7 @@ class OBJECT_OT_UpdateMocapConstraints(bpy.types.Operator): def execute(self, context): mocap_constraints.updateConstraints(context.active_object, context) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -778,7 +778,7 @@ class OBJECT_OT_GuessHierachyMapping(bpy.types.Operator): enduser_obj = bpy.context.active_object performer_obj = [obj for obj in bpy.context.selected_objects if obj != enduser_obj][0] mocap_tools.guessMapping(performer_obj, enduser_obj) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -800,7 +800,7 @@ class OBJECT_OT_PathEditing(bpy.types.Operator): def execute(self, context): path = [obj for obj in context.selected_objects if obj != context.active_object][0] mocap_tools.path_editing(context, context.active_object, path) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -819,7 +819,7 @@ class OBJECT_OT_AnimationStitchingButton(bpy.types.Operator): def execute(self, context): mocap_tools.anim_stitch(context, context.active_object) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): @@ -840,7 +840,7 @@ class OBJECT_OT_GuessAnimationStitchingButton(bpy.types.Operator): def execute(self, context): mocap_tools.guess_anim_stitch(context, context.active_object) - return {"FINISHED"} + return {'FINISHED'} @classmethod def poll(cls, context): diff --git a/paint_palette.py b/paint_palette.py index 8cdc0e14..5cd86a0d 100644 --- a/paint_palette.py +++ b/paint_palette.py @@ -328,7 +328,7 @@ class PALETTE_OT_add_color(bpy.types.Operator): pp.current_color_index = new_index sample() update_panels() - return {"FINISHED"} + return {'FINISHED'} class PALETTE_OT_remove_color(bpy.types.Operator): @@ -349,7 +349,7 @@ class PALETTE_OT_remove_color(bpy.types.Operator): if pp.current_color_index >= pp.colors.__len__(): pp.index = pp.current_color_index = pp.colors.__len__() - 1 - return {"FINISHED"} + return {'FINISHED'} class PALETTE_OT_sample_tool_color(bpy.types.Operator): @@ -361,7 +361,7 @@ class PALETTE_OT_sample_tool_color(bpy.types.Operator): pp = bpy.context.scene.palette_props brush = current_brush() pp.colors[pp.current_color_index].color = brush.color - return {"FINISHED"} + return {'FINISHED'} class IMAGE_OT_select_color(bpy.types.Operator): @@ -377,7 +377,7 @@ class IMAGE_OT_select_color(bpy.types.Operator): palette_props.current_color_index = self.color_index update_panels() - return {"FINISHED"} + return {'FINISHED'} def color_palette_draw(self, context): @@ -543,7 +543,7 @@ class VIEW3D_OT_select_weight(bpy.types.Operator): weight = palette_props.weight_10 palette_props.weight = weight #bpy.context.tool_settings.vertex_group_weight = weight - return {"FINISHED"} + return {'FINISHED'} class VIEW3D_OT_reset_weight_palette(bpy.types.Operator): @@ -597,7 +597,7 @@ class VIEW3D_OT_reset_weight_palette(bpy.types.Operator): if palette_props.current_weight_index == 10: palette_props.weight = 1.0 palette_props.weight_10 = 1.0 - return {"FINISHED"} + return {'FINISHED'} class VIEW3D_PT_weight_palette(PaintPanel, bpy.types.Panel): bl_label = "Weight Palette" diff --git a/render_copy_settings/__init__.py b/render_copy_settings/__init__.py index 3a3e2738..f59432e0 100644 --- a/render_copy_settings/__init__.py +++ b/render_copy_settings/__init__.py @@ -61,7 +61,7 @@ class RenderCopySettingsScene(bpy.types.PropertyGroup): # A string of identifiers (colon delimited) which property’s controls # should be displayed in a template_list. template_list_controls = StringProperty(default="allowed", - options={"HIDDEN"}) + options={'HIDDEN'}) class RenderCopySettingsSetting(bpy.types.PropertyGroup): @@ -71,7 +71,7 @@ class RenderCopySettingsSetting(bpy.types.PropertyGroup): # A string of identifiers (colon delimited) which property’s controls # should be displayed in a template_list. template_list_controls = StringProperty(default="copy", - options={"HIDDEN"}) + options={'HIDDEN'}) class RenderCopySettings(bpy.types.PropertyGroup): diff --git a/render_copy_settings/operator.py b/render_copy_settings/operator.py index d503fffc..3b0da84f 100644 --- a/render_copy_settings/operator.py +++ b/render_copy_settings/operator.py @@ -94,12 +94,12 @@ class RenderCopySettingsPrepare(bpy.types.Operator): try: regex = re.compile(cp_sett.filter_scene) except Exception as e: - self.report('ERROR_INVALID_INPUT', "The filter-scene " + self.report({'ERROR_INVALID_INPUT'}, "The filter-scene " "regex did not compile:\n (%s)." % str(e)) return {'CANCELLED'} except: regex = None - self.report('WARNING', "Unable to import the re module. " + self.report({'WARNING'}, "Unable to import the re module. " "Regex scene filtering will be disabled!") scenes = set() for scene in bpy.data.scenes: @@ -137,7 +137,7 @@ class RenderCopySettingsPreset(bpy.types.Operator): presets = EnumProperty(items=(p.rna_enum for p in presets.presets), default=set(), - options={"ENUM_FLAG"}) + options={'ENUM_FLAG'}) @staticmethod def process_elements(settings, elts): |