fixed compatibility with python 3.10.

This commit is contained in:
2024-10-23 18:33:12 +09:00
parent ab7cd1b885
commit d5ac5cd427
2 changed files with 14 additions and 8 deletions

View File

@ -59,8 +59,13 @@ class DownloadCommand(BaseCommand):
@classmethod
def download(
cls, remote_path: str, local_path: str, is_recursive: bool, is_skip_if_exists: bool, password: str | None,
excludes: list[str]
cls,
remote_path: str,
local_path: str,
is_recursive: bool,
is_skip_if_exists: bool,
password: str | None,
excludes: list[str],
) -> None:
(remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path)
r_path = r_path.rstrip("/")
@ -100,7 +105,7 @@ class DownloadCommand(BaseCommand):
folder_id: str,
basedir: str,
excludes: list[str],
is_skip_if_exists: bool
is_skip_if_exists: bool,
) -> None:
context = DownloadContext(False, is_skip_if_exists, [])
folder = folder_api.retrieve(folder_id)
@ -146,5 +151,5 @@ class DownloadCommand(BaseCommand):
@classmethod
def __check_excludes(cls, excludes: list[str], laboratory: Laboratory, folder: Folder, file: File | None) -> bool:
path = f"/{laboratory.name}{folder.path}{file.name if file is not None else ""}".rstrip("/").lower()
path = f"/{laboratory.name}{folder.path}{file.name if file is not None else ''}".rstrip("/").lower()
return path in excludes