Skip to content

Commit dd7908b

Browse files
authored
Merge pull request #772 from simvue-io/feature/set-folder-details
Add `read_only` parameter to `Client.get_folder`
2 parents df55280 + f29ebd0 commit dd7908b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

simvue/client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,9 @@ def get_artifacts_as_files(
631631
@prettify_pydantic
632632
@pydantic.validate_call
633633
def get_folder(
634-
self, folder_path: typing.Annotated[str, pydantic.Field(pattern=FOLDER_REGEX)]
634+
self,
635+
folder_path: typing.Annotated[str, pydantic.Field(pattern=FOLDER_REGEX)],
636+
read_only: bool = True,
635637
) -> Folder | None:
636638
"""Retrieve a folder by identifier
637639
@@ -640,6 +642,10 @@ def get_folder(
640642
folder_path : str
641643
the path of the folder to retrieve on the server.
642644
Paths are prefixed with `/`
645+
read_only : bool, optional
646+
whether the returned object should be editable or not,
647+
default is True, the object is a cached copy of data
648+
from the server.
643649
644650
Returns
645651
-------
@@ -657,6 +663,8 @@ def get_folder(
657663

658664
try:
659665
_, _folder = next(_folders)
666+
if not read_only:
667+
_folder.read_only(read_only)
660668
return _folder
661669
except StopIteration:
662670
return None

0 commit comments

Comments
 (0)