Cleanup: use percentage formatting

`str.format` and `f-string` use was minimal.
Prefer using a single style of string formatting
unless an alternative is more widely adopted.
This commit is contained in:
2020-06-26 12:30:03 +10:00
parent 2db4a81fe4
commit 646ef49e19
13 changed files with 44 additions and 40 deletions

View File

@@ -172,8 +172,8 @@ def modules_refresh(module_cache=addons_fake_modules):
if mod.__file__ != mod_path:
print(
"multiple addons with the same name:\n"
" " f"{mod.__file__!r}" "\n"
" " f"{mod_path!r}"
" %r\n"
" %r" % (mod.__file__, mod_path)
)
error_duplicates.append((mod.bl_info["name"], mod.__file__, mod_path))
@@ -241,7 +241,7 @@ def check(module_name):
if loaded_state is Ellipsis:
print(
"Warning: addon-module " f"{module_name:s}" " found module "
"Warning: addon-module", module_name, "found module "
"but without '__addon_enabled__' field, "
"possible name collision from file:",
repr(getattr(mod, "__file__", "<unknown>")),
@@ -439,8 +439,9 @@ def disable(module_name, *, default_set=False, handle_error=None):
handle_error(ex)
else:
print(
"addon_utils.disable: " f"{module_name:s}" " not",
("disabled" if mod is None else "loaded")
"addon_utils.disable: %s not %s" % (
module_name,
"disabled" if mod is None else "loaded")
)
# could be in more than once, unlikely but better do this just in case.
@@ -502,7 +503,7 @@ def _blender_manual_url_prefix():
else:
manual_version = "dev"
return f"https://docs.blender.org/manual/en/{manual_version}"
return "https://docs.blender.org/manual/en/" + manual_version
def module_bl_info(mod, info_basis=None):
@@ -544,11 +545,11 @@ def module_bl_info(mod, info_basis=None):
addon_info["doc_url"] = doc_url
if _bpy.app.debug:
print(
"Warning: add-on \"{addon_name}\": 'wiki_url' in 'bl_info' "
"Warning: add-on \"%s\": 'wiki_url' in 'bl_info' "
"is deprecated please use 'doc_url' instead!\n"
" {addon_path}".format(
addon_name=addon_info['name'],
addon_path=getattr(mod, "__file__", None),
" %s" % (
addon_info['name'],
getattr(mod, "__file__", None),
)
)