Skip to content

Commit

Permalink
format with black
Browse files Browse the repository at this point in the history
  • Loading branch information
gridvm1 committed Nov 1, 2023
1 parent 44a85d7 commit f4f2462
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions cloudpathlib/cloudpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,24 +532,24 @@ def walk(

def open(
self,
mode: str = "r",
buffering: int = -1,
encoding: Optional[str] = None,
errors: Optional[str] = None,
newline: Optional[str] = None,
force_overwrite_from_cloud: bool = False, # extra kwarg not in pathlib
force_overwrite_to_cloud: bool = False, # extra kwarg not in pathlib
closefd=True,
opener=None,
ignore_ext=False,
compression=None,
api_kwargs: dict = None, # type: ignore
):
mode: str = "r",
buffering: int = -1,
encoding: Optional[str] = None,
errors: Optional[str] = None,
newline: Optional[str] = None,
force_overwrite_from_cloud: bool = False, # extra kwarg not in pathlib
force_overwrite_to_cloud: bool = False, # extra kwarg not in pathlib
closefd=True,
opener=None,
ignore_ext=False,
compression=None,
api_kwargs: dict = None, # type: ignore
):
"""
Open S3Path as a file-liked object.
:return: a file-like object.
See https://github.com/RaRe-Technologies/smart_open for more info.
"""
Open S3Path as a file-liked object.
:return: a file-like object.
See https://github.com/RaRe-Technologies/smart_open for more info.
"""
kwargs = dict(
uri=self.as_uri(),
mode=mode,
Expand All @@ -559,10 +559,10 @@ def open(
newline=newline,
closefd=closefd,
opener=opener,
transport_params={"client": self.client.client}
transport_params={"client": self.client.client},
)
return smart_open.open(**kwargs)

def read_text(
self,
encoding="utf-8",
Expand All @@ -572,11 +572,12 @@ def read_text(
mode="r",
encoding=encoding,
errors=errors,

) as f:
return f.read()

def read_bytes(self, ) -> bytes:
def read_bytes(
self,
) -> bytes:
with self.open(mode="rb") as f:
return f.read()

Expand All @@ -586,7 +587,6 @@ def write_text(
encoding="utf-8",
errors=None,
newline=None,

):
with self.open(
mode="w",
Expand Down

0 comments on commit f4f2462

Please sign in to comment.