Cleanup: add-on, reformat with black
No functional changes.
This commit is contained in:
parent
32a3e48e24
commit
074c60df9d
@ -506,6 +506,7 @@ def _root_path() -> PurePath:
|
|||||||
return PureWindowsPath("X:/")
|
return PureWindowsPath("X:/")
|
||||||
return PurePosixPath("/")
|
return PurePosixPath("/")
|
||||||
|
|
||||||
|
|
||||||
def _root_path_strip(path: PurePath) -> PurePosixPath:
|
def _root_path_strip(path: PurePath) -> PurePosixPath:
|
||||||
"""Strip off the leading / (POSIX) and drive letter (Windows).
|
"""Strip off the leading / (POSIX) and drive letter (Windows).
|
||||||
|
|
||||||
|
@ -3,5 +3,6 @@ from .. import wheels
|
|||||||
# Load all the submodules we need from BAT in one go.
|
# Load all the submodules we need from BAT in one go.
|
||||||
_bat_modules = wheels.load_wheel(
|
_bat_modules = wheels.load_wheel(
|
||||||
"blender_asset_tracer",
|
"blender_asset_tracer",
|
||||||
("blendfile", "pack", "pack.progress", "pack.transfer", "pack.shaman", "bpathlib"))
|
("blendfile", "pack", "pack.progress", "pack.transfer", "pack.shaman", "bpathlib"),
|
||||||
|
)
|
||||||
bat_toplevel, blendfile, pack, progress, transfer, shaman, bpathlib = _bat_modules
|
bat_toplevel, blendfile, pack, progress, transfer, shaman, bpathlib = _bat_modules
|
||||||
|
@ -128,7 +128,8 @@ def ping_manager(
|
|||||||
try:
|
try:
|
||||||
version: FlamencoVersion = meta_api.get_version()
|
version: FlamencoVersion = meta_api.get_version()
|
||||||
storage: SharedStorageLocation = meta_api.get_shared_storage(
|
storage: SharedStorageLocation = meta_api.get_shared_storage(
|
||||||
"users", platform.system().lower())
|
"users", platform.system().lower()
|
||||||
|
)
|
||||||
except ApiException as ex:
|
except ApiException as ex:
|
||||||
error = "Manager cannot be reached: %s" % ex
|
error = "Manager cannot be reached: %s" % ex
|
||||||
except MaxRetryError as ex:
|
except MaxRetryError as ex:
|
||||||
|
@ -30,6 +30,7 @@ BLENDFILE_SETTING_KEY = "blendfile"
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
||||||
from flamenco.manager.models import SubmittedJob, JobMetadata
|
from flamenco.manager.models import SubmittedJob, JobMetadata
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ from typing import Iterator, Iterable
|
|||||||
_my_dir = Path(__file__).parent
|
_my_dir = Path(__file__).parent
|
||||||
_log = logging.getLogger(__name__)
|
_log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def load_wheel(module_name: str, submodules: Iterable[str]) -> list[ModuleType]:
|
def load_wheel(module_name: str, submodules: Iterable[str]) -> list[ModuleType]:
|
||||||
"""Loads modules from a wheel file 'module_name*.whl'.
|
"""Loads modules from a wheel file 'module_name*.whl'.
|
||||||
|
|
||||||
@ -46,8 +47,9 @@ def load_wheel(module_name: str, submodules: Iterable[str]) -> list[ModuleType]:
|
|||||||
loaded_modules.append(module)
|
loaded_modules.append(module)
|
||||||
_log.info("Loaded %s from %s", modname, module.__file__)
|
_log.info("Loaded %s from %s", modname, module.__file__)
|
||||||
|
|
||||||
assert len(loaded_modules) == len(to_load), \
|
assert len(loaded_modules) == len(
|
||||||
f"expecting to load {len(to_load)} modules, but only have {len(loaded_modules)}: {loaded_modules}"
|
to_load
|
||||||
|
), f"expecting to load {len(to_load)} modules, but only have {len(loaded_modules)}: {loaded_modules}"
|
||||||
return loaded_modules
|
return loaded_modules
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user