Skip to content

Commit

Permalink
applied changes from "SIM910" rule
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Oct 3, 2024
1 parent 64d2fd6 commit 25d87a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nc_py_api/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def _response_event(self, response: Response) -> None:

def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs):
adapter = self.adapter_dav if dav else self.adapter
with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers", None)) as response:
with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response:
check_error(response)
for data_chunk in response.iter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)):
fp.write(data_chunk)
Expand Down Expand Up @@ -425,7 +425,7 @@ async def _response_event(self, response: Response) -> None:

async def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs):
adapter = self.adapter_dav if dav else self.adapter
async with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers", None)) as response:
async with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response:
check_error(response)
async for data_chunk in response.aiter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)):
fp.write(data_chunk)
Expand Down
4 changes: 2 additions & 2 deletions nc_py_api/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ async def get_avatar(


def _create(user_id: str, display_name: str | None, **kwargs) -> dict[str, typing.Any]:
password = kwargs.get("password", None)
email = kwargs.get("email", None)
password = kwargs.get("password")
email = kwargs.get("email")
if not password and not email:
raise ValueError("Either password or email must be set")
data = {"userid": user_id}
Expand Down

0 comments on commit 25d87a1

Please sign in to comment.