Cleanup: remove f-string use in favor of percentage for formatting
This commit is contained in:
parent
618f31312c
commit
83e204702d
@ -367,7 +367,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
|
|||||||
|
|
||||||
if mod.bl_info.get("blender", (0, 0, 0)) < (2, 80, 0):
|
if mod.bl_info.get("blender", (0, 0, 0)) < (2, 80, 0):
|
||||||
if _bpy.app.debug:
|
if _bpy.app.debug:
|
||||||
print(f"Warning: Add-on '{module_name:s}' was not upgraded for 2.80, ignoring")
|
print("Warning: Add-on '%s' was not upgraded for 2.80, ignoring" % module_name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# 2) Try register collected modules.
|
# 2) Try register collected modules.
|
||||||
|
@ -789,7 +789,7 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
|
|||||||
|
|
||||||
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
||||||
if cls is None:
|
if cls is None:
|
||||||
raise Exception(f"Space type {space_type!r} has no toolbar")
|
raise Exception("Space type %r has no toolbar" % space_type)
|
||||||
tools = cls._tools[context_mode]
|
tools = cls._tools[context_mode]
|
||||||
|
|
||||||
# First sanity check
|
# First sanity check
|
||||||
@ -799,9 +799,9 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
|
|||||||
if item is not None
|
if item is not None
|
||||||
}
|
}
|
||||||
if not issubclass(tool_cls, WorkSpaceTool):
|
if not issubclass(tool_cls, WorkSpaceTool):
|
||||||
raise Exception(f"Expected WorkSpaceTool subclass, not {type(tool_cls)!r}")
|
raise Exception("Expected WorkSpaceTool subclass, not %r" % type(tool_cls))
|
||||||
if tool_cls.bl_idname in tools_id:
|
if tool_cls.bl_idname in tools_id:
|
||||||
raise Exception(f"Tool {tool_cls.bl_idname!r} already exists!")
|
raise Exception("Tool %r already exists!" % tool_cls.bl_idname)
|
||||||
del tools_id, WorkSpaceTool
|
del tools_id, WorkSpaceTool
|
||||||
|
|
||||||
# Convert the class into a ToolDef.
|
# Convert the class into a ToolDef.
|
||||||
@ -900,7 +900,7 @@ def unregister_tool(tool_cls):
|
|||||||
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
||||||
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
|
||||||
if cls is None:
|
if cls is None:
|
||||||
raise Exception(f"Space type {space_type!r} has no toolbar")
|
raise Exception("Space type %r has no toolbar" % space_type)
|
||||||
tools = cls._tools[context_mode]
|
tools = cls._tools[context_mode]
|
||||||
|
|
||||||
tool_def = tool_cls._bl_tool
|
tool_def = tool_cls._bl_tool
|
||||||
@ -952,7 +952,7 @@ def unregister_tool(tool_cls):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if not changed:
|
if not changed:
|
||||||
raise Exception(f"Unable to remove {tool_cls!r}")
|
raise Exception("Unable to remove %r" % tool_cls)
|
||||||
del tool_cls._bl_tool
|
del tool_cls._bl_tool
|
||||||
|
|
||||||
keymap_data = tool_def.keymap
|
keymap_data = tool_def.keymap
|
||||||
@ -963,7 +963,7 @@ def unregister_tool(tool_cls):
|
|||||||
for kc in (keyconfigs.default, keyconfigs.addon):
|
for kc in (keyconfigs.default, keyconfigs.addon):
|
||||||
km = kc.keymaps.get(keymap_data[0])
|
km = kc.keymaps.get(keymap_data[0])
|
||||||
if km is None:
|
if km is None:
|
||||||
print(f"Warning keymap {keymap_data[0]!r} not found in {kc.name!r}!")
|
print("Warning keymap %r not found in %r!" % (keymap_data[0], kc.name))
|
||||||
else:
|
else:
|
||||||
kc.keymaps.remove(km)
|
kc.keymaps.remove(km)
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class ImagePreviewCollection(dict):
|
|||||||
|
|
||||||
def new(self, name):
|
def new(self, name):
|
||||||
if name in self:
|
if name in self:
|
||||||
raise KeyError(f"key {name!r} already exists")
|
raise KeyError("key %r already exists" % name)
|
||||||
p = self[name] = _utils_previews.new(
|
p = self[name] = _utils_previews.new(
|
||||||
self._gen_key(name))
|
self._gen_key(name))
|
||||||
return p
|
return p
|
||||||
@ -93,7 +93,7 @@ class ImagePreviewCollection(dict):
|
|||||||
|
|
||||||
def load(self, name, path, path_type, force_reload=False):
|
def load(self, name, path, path_type, force_reload=False):
|
||||||
if name in self:
|
if name in self:
|
||||||
raise KeyError(f"key {name!r} already exists")
|
raise KeyError("key %r already exists" % name)
|
||||||
p = self[name] = _utils_previews.load(
|
p = self[name] = _utils_previews.load(
|
||||||
self._gen_key(name), path, path_type, force_reload)
|
self._gen_key(name), path, path_type, force_reload)
|
||||||
return p
|
return p
|
||||||
|
@ -143,10 +143,10 @@ class PlayRenderedAnim(Operator):
|
|||||||
]
|
]
|
||||||
cmd.extend(opts)
|
cmd.extend(opts)
|
||||||
elif preset == 'FRAMECYCLER':
|
elif preset == 'FRAMECYCLER':
|
||||||
opts = [file, f"{scene.frame_start:d}-{scene.frame_end:d}"]
|
opts = [file, "%d-%d" % (scene.frame_start, scene.frame_end)]
|
||||||
cmd.extend(opts)
|
cmd.extend(opts)
|
||||||
elif preset == 'RV':
|
elif preset == 'RV':
|
||||||
opts = ["-fps", str(rd.fps), "-play", f"[ {file:s} ]"]
|
opts = ["-fps", str(rd.fps), "-play", "[ %s ]" % file]
|
||||||
cmd.extend(opts)
|
cmd.extend(opts)
|
||||||
elif preset == 'MPLAYER':
|
elif preset == 'MPLAYER':
|
||||||
opts = []
|
opts = []
|
||||||
@ -156,7 +156,7 @@ class PlayRenderedAnim(Operator):
|
|||||||
opts += [
|
opts += [
|
||||||
("mf://" + file.replace("#", "?")),
|
("mf://" + file.replace("#", "?")),
|
||||||
"-mf",
|
"-mf",
|
||||||
f"fps={fps_final:4f}"
|
"fps=%.4f" % fps_final,
|
||||||
]
|
]
|
||||||
|
|
||||||
opts += ["-loop", "0", "-really-quiet", "-fs"]
|
opts += ["-loop", "0", "-really-quiet", "-fs"]
|
||||||
|
@ -1238,7 +1238,7 @@ class CLIP_MT_view_zoom(Menu):
|
|||||||
|
|
||||||
layout.operator(
|
layout.operator(
|
||||||
"clip.view_zoom_ratio",
|
"clip.view_zoom_ratio",
|
||||||
text=iface_(f"Zoom {a:d}:{b:d}"),
|
text=iface_("Zoom %d:%d") % (a, b),
|
||||||
translate=False,
|
translate=False,
|
||||||
).ratio = a / b
|
).ratio = a / b
|
||||||
|
|
||||||
|
@ -994,7 +994,7 @@ class USERPREF_PT_theme_bone_color_sets(ThemePanel, CenterAlignMixIn, Panel):
|
|||||||
layout.use_property_split = True
|
layout.use_property_split = True
|
||||||
|
|
||||||
for i, ui in enumerate(theme.bone_color_sets, 1):
|
for i, ui in enumerate(theme.bone_color_sets, 1):
|
||||||
layout.label(text=iface_(f"Color Set {i:d}"), translate=False)
|
layout.label(text=iface_("Color Set %d") % i, translate=False)
|
||||||
|
|
||||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||||
|
|
||||||
|
@ -1084,7 +1084,7 @@ class VIEW3D_MT_mirror(Menu):
|
|||||||
|
|
||||||
for (space_name, space_id) in (("Global", 'GLOBAL'), ("Local", 'LOCAL')):
|
for (space_name, space_id) in (("Global", 'GLOBAL'), ("Local", 'LOCAL')):
|
||||||
for axis_index, axis_name in enumerate("XYZ"):
|
for axis_index, axis_name in enumerate("XYZ"):
|
||||||
props = layout.operator("transform.mirror", text=f"{axis_name!s} {space_name!s}")
|
props = layout.operator("transform.mirror", text="%s %s" % (axis_name, space_name))
|
||||||
props.constraint_axis[axis_index] = True
|
props.constraint_axis[axis_index] = True
|
||||||
props.orient_type = space_id
|
props.orient_type = space_id
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user