add -p option for support to open PW_OPEN folder.

This commit is contained in:
2023-05-10 20:10:43 +09:00
parent 97007233c6
commit 995e4cc467
7 changed files with 34 additions and 8 deletions

View File

@ -26,6 +26,7 @@ class DownloadCommand(BaseCommand):
download_parser.add_argument(
"-r", "--recursive", help="download folders and their contents recursive", action="store_true"
)
download_parser.add_argument("-p", "--password", help="password to use when open locked folder")
download_parser.add_argument("remote_path", help="remote file path (remote:/lab/path/file)")
download_parser.add_argument("local_path", help="local folder path (/foo/bar/)")
download_parser.set_defaults(func=command.download)
@ -40,7 +41,7 @@ class DownloadCommand(BaseCommand):
if not os.path.isdir(l_dirname):
raise IllegalArgumentException(f"Local directory `{args.local_path}` not found.")
laboratory = self._find_laboratory(connection, laboratory_name)
r_parent_folder = self._find_folder(connection, laboratory, r_dirname)
r_parent_folder = self._find_folder(connection, laboratory, r_dirname, args.password)
file = r_parent_folder.find_file(r_basename)
download_files: list[DownloadFileInfo] = []
if file is not None: