Cleanup: correct staticmethod, remove unused imports & formatting

This commit is contained in:
Campbell Barton 2024-06-26 00:31:59 +10:00
parent 69b22f73c2
commit 17951d12ed
4 changed files with 6 additions and 7 deletions

View file

@ -184,7 +184,6 @@ class OperatorNonBlockingSyncHelper:
from .bl_extension_notify import (
update_ui_region_register,
update_non_blocking,
update_in_progress,
)
repos_all = extension_repos_read()
@ -2410,7 +2409,6 @@ class EXTENSIONS_OT_package_install(Operator, _ExtCmdMixIn):
def _invoke_for_drop(self, context, _event):
from .bl_extension_utils import (
platform_from_this_system,
url_parse_for_blender,
)

View file

@ -255,13 +255,10 @@ def addon_draw_item_expanded(
if item_doc_url:
col_a.label(text="Website")
col_b.split(
factor=0.5).operator(
col_b.split(factor=0.5).operator(
"wm.url_open",
text=domain_extract_from_url(item_doc_url),
icon='HELP' if addon_type in {
ADDON_TYPE_LEGACY_CORE,
ADDON_TYPE_LEGACY_USER} else 'URL',
icon='HELP' if addon_type in {ADDON_TYPE_LEGACY_CORE, ADDON_TYPE_LEGACY_USER} else 'URL',
).url = item_doc_url
# Only add "Report a Bug" button if tracker_url is set
# or the add-on is bundled (use official tracker then).
@ -758,6 +755,7 @@ class notify_info:
notify_info._update_state = True
return in_progress
@staticmethod
def update_show_in_preferences():
"""
An update was triggered externally (not from the interface).

View file

@ -288,6 +288,8 @@ def repository_iter_package_dirs(
try:
dir_entries = os.scandir(directory)
except Exception as ex:
# The `isinstance` check is ignored, suppress warning.
# pylint: disable-next=no-member
if not (ignore_missing and isinstance(ex, FileNotFoundError) and ex.filename == directory):
error_fn(ex)
dir_entries = None

View file

@ -1099,6 +1099,7 @@ def filepath_retrieve_to_filepath_iter(
) -> Generator[Tuple[int, int], None, None]:
# TODO: `timeout_in_seconds`.
# Handle temporary file setup.
_ = timeout_in_seconds
with open(filepath_src, 'rb') as fh_input:
size = os.fstat(fh_input.fileno()).st_size
with open(filepath, 'wb') as fh_output: