Cleanup: remove f-string use in favor of percentage for formatting

This commit is contained in:
2020-07-16 23:50:33 +10:00
parent 618f31312c
commit 83e204702d
7 changed files with 15 additions and 15 deletions

View File

@@ -789,7 +789,7 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
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]
# First sanity check
@@ -799,9 +799,9 @@ def register_tool(tool_cls, *, after=None, separator=False, group=False):
if item is not None
}
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:
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
# Convert the class into a ToolDef.
@@ -900,7 +900,7 @@ def unregister_tool(tool_cls):
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type)
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]
tool_def = tool_cls._bl_tool
@@ -952,7 +952,7 @@ def unregister_tool(tool_cls):
break
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
keymap_data = tool_def.keymap
@@ -963,7 +963,7 @@ def unregister_tool(tool_cls):
for kc in (keyconfigs.default, keyconfigs.addon):
km = kc.keymaps.get(keymap_data[0])
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:
kc.keymaps.remove(km)