Skip to content

Commit ad38b05

Browse files
committed
Fix lint issues
1 parent 3d29abc commit ad38b05

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

docs/concepts.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ for reading from AWS's S3 cloud object storage using `boto3
269269
if parsed.scheme == "s3":
270270
bucket = parsed.netloc
271271
key = parsed.path[1:]
272-
272+
273273
obj = self.s3.Object(bucket, key)
274274
return obj.get()["Body"].read().decode("utf-8")
275275
else:
@@ -288,7 +288,7 @@ for reading from AWS's S3 cloud object storage using `boto3
288288
super().write_text(dest, txt, *args, **kwargs)
289289
290290
StacIO.set_default(CustomStacIO)
291-
291+
292292
293293
If you only need to customize read operations you can inherit from
294294
:class:`~pystac.stac_io.DefaultStacIO` and only overwrite the read method. For example,
@@ -304,7 +304,7 @@ to take advantage of connection pooling using a `requests.Session
304304
class ConnectionPoolingIO(DefaultStacIO):
305305
def __init__():
306306
self.session = requests.Session()
307-
307+
308308
def read_text(
309309
self, source: Union[str, Link], *args: Any, **kwargs: Any
310310
) -> str:
@@ -313,7 +313,7 @@ to take advantage of connection pooling using a `requests.Session
313313
return self.session.get(uri).text
314314
else:
315315
return super().read_text(source, *args, **kwargs)
316-
316+
317317
StacIO.set_default(ConnectionPoolingIO)
318318
319319
Validation

pystac/stac_io.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def read_text(
5050
:class:`~pystac.Link`. If it is a string, it must be a URI or local path from
5151
which to read. Using a :class:`~pystac.Link` enables implementations to use
5252
additional link information, such as paging information contained in the
53-
extended links described in the `STAC API spec
53+
extended links described in the `STAC API spec
5454
<https://github.com/radiantearth/stac-api-spec/tree/master/item-search#paging>`__.
5555
5656
Args:
@@ -263,12 +263,11 @@ def default(cls) -> "StacIO":
263263

264264

265265
class DefaultStacIO(StacIO):
266-
def read_text(
267-
self, source: Union[str, "Link_Type"], *_: Any, **__: Any
268-
) -> str:
269-
"""A concrete implementation of :meth:`StacIO.read_text <pystac.StacIO.read_text>`. Converts the
270-
``source`` argument to a string (if it is not already) and delegates to
271-
:meth:`DefaultStacIO.read_text_from_href` for opening and reading the file."""
266+
def read_text(self, source: Union[str, "Link_Type"], *_: Any, **__: Any) -> str:
267+
"""A concrete implementation of :meth:`StacIO.read_text
268+
<pystac.StacIO.read_text>`. Converts the ``source`` argument to a string (if it
269+
is not already) and delegates to :meth:`DefaultStacIO.read_text_from_href` for
270+
opening and reading the file."""
272271
href: Optional[str]
273272
if isinstance(source, str):
274273
href = source
@@ -305,9 +304,10 @@ def read_text_from_href(self, href: str) -> str:
305304
def write_text(
306305
self, dest: Union[str, "Link_Type"], txt: str, *_: Any, **__: Any
307306
) -> None:
308-
"""A concrete implementation of :meth:`StacIO.write_text <pystac.StacIO.write_text>`. Converts the
309-
``dest`` argument to a string (if it is not already) and delegates to
310-
:meth:`DefaultStacIO.write_text_from_href` for opening and reading the file."""
307+
"""A concrete implementation of :meth:`StacIO.write_text
308+
<pystac.StacIO.write_text>`. Converts the ``dest`` argument to a string (if it
309+
is not already) and delegates to :meth:`DefaultStacIO.write_text_from_href` for
310+
opening and reading the file."""
311311
href: Optional[str]
312312
if isinstance(dest, str):
313313
href = dest
@@ -317,9 +317,7 @@ def write_text(
317317
raise IOError(f"Could not get an absolute HREF from link {dest}")
318318
return self.write_text_to_href(href, txt)
319319

320-
def write_text_to_href(
321-
self, href: str, txt: str
322-
) -> None:
320+
def write_text_to_href(self, href: str, txt: str) -> None:
323321
"""Writes text to file using UTF-8 encoding.
324322
325323
This implementation uses :func:`open` and therefore can only write to the local

0 commit comments

Comments
 (0)