From d5f837a8ee4a7bb0b1d97c69395c374ff7d811a6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Apr 2024 10:04:07 +1000 Subject: [PATCH] Cleanup: remove redundant string formatting --- scripts/modules/rna_info.py | 2 +- scripts/startup/bl_operators/screen_play_rendered_anim.py | 2 +- tests/python/collada/animation/test_animation_simple.py | 8 ++++---- tests/python/collada/mesh/test_mesh_simple.py | 2 +- tools/utils_maintenance/code_clean.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/modules/rna_info.py b/scripts/modules/rna_info.py index d13aadbaa18..9858594acf9 100644 --- a/scripts/modules/rna_info.py +++ b/scripts/modules/rna_info.py @@ -332,7 +332,7 @@ class InfoPropertyRNA: self.default_str = "\"%s\"" % self.default elif self.type == "enum": if self.is_enum_flag: - # self.default_str = "%r" % self.default # repr or set() + # self.default_str = repr(self.default) # repr or set() self.default_str = "{%s}" % repr(list(sorted(self.default)))[1:-1] else: self.default_str = "'%s'" % self.default diff --git a/scripts/startup/bl_operators/screen_play_rendered_anim.py b/scripts/startup/bl_operators/screen_play_rendered_anim.py index d870997f8af..c81ce02a12d 100644 --- a/scripts/startup/bl_operators/screen_play_rendered_anim.py +++ b/scripts/startup/bl_operators/screen_play_rendered_anim.py @@ -166,7 +166,7 @@ class PlayRenderedAnim(Operator): opts = ["-fps", str(rd.fps), "-play"] if scene.use_preview_range: opts += [ - "%s" % file.replace("#", "", file.count('#') - 1), + file.replace("#", "", file.count('#') - 1), "%d-%d" % (frame_start, frame_end), ] else: diff --git a/tests/python/collada/animation/test_animation_simple.py b/tests/python/collada/animation/test_animation_simple.py index 478d193ec12..f28a6542c9d 100644 --- a/tests/python/collada/animation/test_animation_simple.py +++ b/tests/python/collada/animation/test_animation_simple.py @@ -107,7 +107,7 @@ class MeshExportTest4(AbstractColladaTest): outfile = tempdir / Path("%s_out.dae" % test) bpy.ops.wm.collada_export( - filepath="%s" % str(outfile), + filepath=str(outfile), check_existing=True, filemode=8, display_type='DEFAULT', @@ -151,7 +151,7 @@ class MeshExportTest3(AbstractColladaTest): outfile = tempdir / Path("%s_out.dae" % test) bpy.ops.wm.collada_export( - filepath="%s" % str(outfile), + filepath=str(outfile), check_existing=True, filemode=8, display_type='DEFAULT', @@ -195,7 +195,7 @@ class MeshExportTest2(AbstractColladaTest): outfile = tempdir / Path("%s_out.dae" % test) bpy.ops.wm.collada_export( - filepath="%s" % str(outfile), + filepath=str(outfile), check_existing=True, filemode=8, display_type='DEFAULT', @@ -239,7 +239,7 @@ class MeshExportTest1(AbstractColladaTest): outfile = tempdir / Path("%s_out.dae" % test) bpy.ops.wm.collada_export( - filepath="%s" % str(outfile), + filepath=str(outfile), check_existing=True, filemode=8, display_type='DEFAULT', diff --git a/tests/python/collada/mesh/test_mesh_simple.py b/tests/python/collada/mesh/test_mesh_simple.py index 96fa233f2ef..bbf723f7819 100644 --- a/tests/python/collada/mesh/test_mesh_simple.py +++ b/tests/python/collada/mesh/test_mesh_simple.py @@ -107,7 +107,7 @@ class MeshExportTest(AbstractColladaTest): outfile = tempdir / Path("%s_out.dae" % test) bpy.ops.wm.collada_export( - filepath="%s" % str(outfile), + filepath=str(outfile), check_existing=True, filemode=8, display_type="DEFAULT", diff --git a/tools/utils_maintenance/code_clean.py b/tools/utils_maintenance/code_clean.py index 8f5b30b6f09..4ac2927c0e9 100755 --- a/tools/utils_maintenance/code_clean.py +++ b/tools/utils_maintenance/code_clean.py @@ -1638,7 +1638,7 @@ class edit_generators: ): edits.append(Edit( span=match.span(), - content='%s' % match.group(2), + content=match.group(2), content_fail='__ALWAYS_FAIL__', ))