Merge branch 'blender-v4.2-release'
This commit is contained in:
commit
7f2d0f7b14
@ -1942,7 +1942,7 @@ class EXTENSIONS_OT_package_install_files(Operator, _ExtCmdMixIn):
|
||||
def exec_command_iter(self, is_modal):
|
||||
from . import bl_extension_utils
|
||||
from .bl_extension_utils import (
|
||||
pkg_manifest_dict_from_file_or_error,
|
||||
pkg_manifest_dict_from_archive_or_error,
|
||||
pkg_is_legacy_addon,
|
||||
)
|
||||
|
||||
@ -1999,7 +1999,7 @@ class EXTENSIONS_OT_package_install_files(Operator, _ExtCmdMixIn):
|
||||
continue
|
||||
pkg_files.append(source_filepath)
|
||||
|
||||
result = pkg_manifest_dict_from_file_or_error(source_filepath)
|
||||
result = pkg_manifest_dict_from_archive_or_error(source_filepath)
|
||||
if isinstance(result, str):
|
||||
continue
|
||||
pkg_id = result["id"]
|
||||
@ -2205,13 +2205,13 @@ class EXTENSIONS_OT_package_install_files(Operator, _ExtCmdMixIn):
|
||||
self._drop_variables = True
|
||||
self._legacy_drop = None
|
||||
|
||||
from .bl_extension_utils import pkg_manifest_dict_from_file_or_error
|
||||
from .bl_extension_utils import pkg_manifest_dict_from_archive_or_error
|
||||
|
||||
if not self._repos_valid_for_install(context):
|
||||
self.report({'ERROR'}, "No user repositories")
|
||||
return {'CANCELLED'}
|
||||
|
||||
if isinstance(result := pkg_manifest_dict_from_file_or_error(filepath), str):
|
||||
if isinstance(result := pkg_manifest_dict_from_archive_or_error(filepath), str):
|
||||
self.report({'ERROR'}, "Error in manifest {:s}".format(result))
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
@ -39,7 +39,7 @@ __all__ = (
|
||||
"json_to_filepath",
|
||||
|
||||
"pkg_manifest_dict_is_valid_or_error",
|
||||
"pkg_manifest_dict_from_file_or_error",
|
||||
"pkg_manifest_dict_from_archive_or_error",
|
||||
"pkg_manifest_archive_url_abs_from_remote_url",
|
||||
|
||||
"CommandBatch",
|
||||
@ -201,11 +201,13 @@ def rmtree_with_fallback_or_error(
|
||||
remove_link: bool = True,
|
||||
) -> Optional[str]:
|
||||
from .cli.blender_ext import rmtree_with_fallback_or_error as fn
|
||||
return fn(
|
||||
result = fn(
|
||||
path,
|
||||
remove_file=remove_file,
|
||||
remove_link=remove_link,
|
||||
)
|
||||
assert result is None or isinstance(result, str)
|
||||
return result
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
@ -700,7 +702,7 @@ def pkg_manifest_dict_is_valid_or_error(
|
||||
return None
|
||||
|
||||
|
||||
def pkg_manifest_dict_from_file_or_error(
|
||||
def pkg_manifest_dict_from_archive_or_error(
|
||||
filepath: str,
|
||||
) -> Union[Dict[str, Any], str]:
|
||||
from .cli.blender_ext import pkg_manifest_from_archive_and_validate
|
||||
|
Loading…
Reference in New Issue
Block a user