add -p option for support to open PW_OPEN folder.
This commit is contained in:
@ -35,13 +35,17 @@ class BaseCommand(ABC):
|
||||
raise IllegalArgumentException(f"Laboratory `{name}` not found.")
|
||||
return laboratory
|
||||
|
||||
def _find_folder(self, connection: MDRSConnection, laboratory: Laboratory, path: str) -> Folder:
|
||||
def _find_folder(
|
||||
self, connection: MDRSConnection, laboratory: Laboratory, path: str, password: str | None = None
|
||||
) -> Folder:
|
||||
folder_api = FolderApi(connection)
|
||||
folders = folder_api.list(laboratory.id, path)
|
||||
if len(folders) != 1:
|
||||
raise UnexpectedException(f"Folder `{path}` not found.")
|
||||
if folders[0].lock:
|
||||
raise UnauthorizedException(f"Folder `{path}` is locked.")
|
||||
if password is None:
|
||||
raise UnauthorizedException(f"Folder `{path}` is locked.")
|
||||
folder_api.auth(folders[0].id, password)
|
||||
return folder_api.retrieve(folders[0].id)
|
||||
|
||||
def _parse_remote_host(self, path: str) -> str:
|
||||
|
Reference in New Issue
Block a user