Compare commits

..

No commits in common. "main" and "v1.3.8" have entirely different histories.
main ... v1.3.8

7 changed files with 17 additions and 33 deletions

View File

@ -16,11 +16,7 @@
"mdrsclient", "mdrsclient",
"neurodata", "neurodata",
"Neuroinformatics", "Neuroinformatics",
"orcid",
"RIKEN" "RIKEN"
], ],
"ignorePaths": [ "ignorePaths": [".env", "__pycache__"]
".env",
"__pycache__"
]
} }

3
.gitignore vendored
View File

@ -160,5 +160,4 @@ cython_debug/
.idea/ .idea/
# mdrs-cli # mdrs-cli
.neurodatacli.config .neurodatacli.config
poetry.toml

View File

@ -1 +1 @@
1.3.11 1.3.7

View File

@ -20,10 +20,8 @@ class UsersCurrentResponseLaboratory:
class UsersApiCurrentResponse: class UsersApiCurrentResponse:
id: int id: int
username: str username: str
first_name: str full_name: str
last_name: str
email: str email: str
orcid_id: str
laboratories: list[UsersCurrentResponseLaboratory] laboratories: list[UsersCurrentResponseLaboratory]
is_staff: bool is_staff: bool
is_active: bool is_active: bool

View File

@ -59,13 +59,8 @@ class DownloadCommand(BaseCommand):
@classmethod @classmethod
def download( def download(
cls, cls, remote_path: str, local_path: str, is_recursive: bool, is_skip_if_exists: bool, password: str | None,
remote_path: str, excludes: list[str]
local_path: str,
is_recursive: bool,
is_skip_if_exists: bool,
password: str | None,
excludes: list[str],
) -> None: ) -> None:
(remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path) (remote, laboratory_name, r_path) = cls._parse_remote_host_with_path(remote_path)
r_path = r_path.rstrip("/") r_path = r_path.rstrip("/")
@ -105,7 +100,7 @@ class DownloadCommand(BaseCommand):
folder_id: str, folder_id: str,
basedir: str, basedir: str,
excludes: list[str], excludes: list[str],
is_skip_if_exists: bool, is_skip_if_exists: bool
) -> None: ) -> None:
context = DownloadContext(False, is_skip_if_exists, []) context = DownloadContext(False, is_skip_if_exists, [])
folder = folder_api.retrieve(folder_id) folder = folder_api.retrieve(folder_id)
@ -145,14 +140,11 @@ class DownloadCommand(BaseCommand):
try: try:
file_api.download(info.file, info.path) file_api.download(info.file, info.path)
except Exception: except Exception:
print(f"Failed: ${info.path}")
if os.path.isfile(info.path):
os.remove(info.path)
return False return False
print(info.path) print(info.path)
return True return True
@classmethod @classmethod
def __check_excludes(cls, excludes: list[str], laboratory: Laboratory, folder: Folder, file: File | None) -> bool: 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 return path in excludes

View File

@ -2,7 +2,7 @@ import configparser
import os import os
from typing import Final from typing import Final
import validators import validators # type: ignore
from mdrsclient.exceptions import IllegalArgumentException from mdrsclient.exceptions import IllegalArgumentException
from mdrsclient.settings import CONFIG_DIRNAME from mdrsclient.settings import CONFIG_DIRNAME
@ -41,7 +41,7 @@ class ConfigFile:
@url.setter @url.setter
def url(self, url: str) -> None: def url(self, url: str) -> None:
if not validators.url(url): if not validators.url(url): # type: ignore
raise IllegalArgumentException("malformed URI sequence") raise IllegalArgumentException("malformed URI sequence")
self.__load() self.__load()
if self.__config.has_section(self.remote): if self.__config.has_section(self.remote):

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "mdrs-client-python" name = "mdrs-client-python"
version = "1.3.11" version = "1.3.8"
description = "The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository." description = "The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository."
authors = ["Yoshihiro OKUMURA <yoshihiro.okumura@riken.jp>"] authors = ["Yoshihiro OKUMURA <yoshihiro.okumura@riken.jp>"]
license = "MIT" license = "MIT"
@ -13,7 +13,6 @@ classifiers=[
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"OSI Approved :: MIT License", "OSI Approved :: MIT License",
"Topic :: Utilities", "Topic :: Utilities",
] ]
@ -26,17 +25,17 @@ python = "^3.10"
requests = "^2.32.3" requests = "^2.32.3"
requests-toolbelt = "^1.0.0" requests-toolbelt = "^1.0.0"
python-dotenv = "^1.0.1" python-dotenv = "^1.0.1"
pydantic = "^2.10.5" pydantic = "^2.9.2"
pydantic-settings = "^2.7.1" pydantic-settings = "^2.5.2"
PyJWT = "^2.10.1" PyJWT = "^2.9.0"
validators = "^0.34.0" validators = "^0.33.0"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
black = "^24.10.0" black = "^24.8.0"
flake8 = "^7.1.1" flake8 = "^7.1.1"
Flake8-pyproject = "^1.2.3" Flake8-pyproject = "^1.2.3"
isort = "^5.13.2" isort = "^5.13.2"
pyright = "^1.1.391" pyright = "^1.1.380"
[tool.poetry.scripts] [tool.poetry.scripts]
mdrs = 'mdrsclient.__main__:main' mdrs = 'mdrsclient.__main__:main'