From 9bc0fa9f003f58f554356228fc998635315ff573 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Tue, 12 Mar 2024 09:21:02 +0100 Subject: [PATCH] Fix return type `is_in_edit_mode`, cosmetics + type hints --- client/ayon_core/hosts/zbrush/api/lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/zbrush/api/lib.py b/client/ayon_core/hosts/zbrush/api/lib.py index a8ed05bb7b..b3bb24c458 100644 --- a/client/ayon_core/hosts/zbrush/api/lib.py +++ b/client/ayon_core/hosts/zbrush/api/lib.py @@ -82,7 +82,8 @@ def execute_zscript_and_wait(zscript, ) -def get_workdir(): +def get_workdir() -> str: + """Return the currently active work directory""" return os.environ["AYON_WORKDIR"] @@ -109,7 +110,7 @@ def export_tool(filepath: str, sub_level: int): sub_level=sub_level) -def is_in_edit_mode(): +def is_in_edit_mode() -> bool: """Return whether transform edit mode is currently enabled. Certain actions can't be performed if Zbrush is currently not within @@ -135,7 +136,7 @@ def is_in_edit_mode(): content = str(mode.read()) bool_mode = content.rstrip('\x00') - return bool_mode + return bool(int(bool_mode)) def remove_subtool(basename):