From e3114d85b8372d8b03e31920a1fa1aea2d77f8f9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:46:05 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Samohel <33513211+antirotor@users.noreply.github.com> --- client/ayon_core/host/interfaces/workfiles.py | 6 +++--- client/ayon_core/pipeline/workfile/utils.py | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/client/ayon_core/host/interfaces/workfiles.py b/client/ayon_core/host/interfaces/workfiles.py index 73f5c2ba37..096f39a9f3 100644 --- a/client/ayon_core/host/interfaces/workfiles.py +++ b/client/ayon_core/host/interfaces/workfiles.py @@ -74,7 +74,7 @@ class WorkfileInfo: Attributes: filepath (str): Path to the workfile. - rootless_path (str): Path to the workfile without root. And without + rootless_path (str): Path to the workfile without the root. And without backslashes on Windows. file_size (Optional[float]): Size of the workfile in bytes. file_created (Optional[float]): Timestamp when the workfile was @@ -256,7 +256,7 @@ class IWorkfileHost: """ @abstractmethod - def save_workfile(self, dst_path: Optional[str] = None): + def save_workfile(self, dst_path: Optional[str] = None) -> None: """Save the currently opened scene. Args: @@ -267,7 +267,7 @@ class IWorkfileHost: pass @abstractmethod - def open_workfile(self, filepath: str): + def open_workfile(self, filepath: str) -> None: """Open passed filepath in the host. Args: diff --git a/client/ayon_core/pipeline/workfile/utils.py b/client/ayon_core/pipeline/workfile/utils.py index 1a862d7d92..570d1a1259 100644 --- a/client/ayon_core/pipeline/workfile/utils.py +++ b/client/ayon_core/pipeline/workfile/utils.py @@ -247,14 +247,15 @@ def save_workfile_info( description, ) - data = {} - for key, value in ( - ("host_name", host_name), - ("version", version), - ("comment", comment), - ): - if value is not None: - data[key] = value + data = { + key: value + for key, value in ( + ("host_name", host_name), + ("version", version), + ("comment", comment), + ) + if value is not None + } old_data = workfile_entity["data"]