Apply suggestions from code review

Co-authored-by: Ondřej Samohel <33513211+antirotor@users.noreply.github.com>
This commit is contained in:
Jakub Trllo 2025-06-12 11:46:05 +02:00 committed by GitHub
parent 0bf1e9a934
commit e3114d85b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View file

@ -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:

View file

@ -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"]