Merge pull request #2281 from fridex/pydocstyle-d209

Fix pydocstyle D209
This commit is contained in:
Jussi Kukkonen 2023-02-02 14:33:41 +02:00 committed by GitHub
commit d61dbabc78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 10 deletions

View file

@ -16,13 +16,14 @@
class RepositoryError(Exception):
"""An error with a repository's state, such as a missing file.
It covers all exceptions that come from the repository side when
looking from the perspective of users of metadata API or ngclient."""
looking from the perspective of users of metadata API or ngclient.
"""
class UnsignedMetadataError(RepositoryError):
"""An error about metadata object with insufficient threshold of
signatures."""
"""An error about metadata object with insufficient threshold of signatures."""
class BadVersionNumberError(RepositoryError):

View file

@ -1613,8 +1613,10 @@ def __init__(
@property
def custom(self) -> Any:
"""Can be used to provide implementation specific data related to the
target. python-tuf does not use or validate this data."""
"""Get implementation specific data related to the target.
python-tuf does not use or validate this data.
"""
return self.unrecognized_fields.get("custom")
def __eq__(self, other: Any) -> bool:

View file

@ -96,9 +96,11 @@ def _fetch(self, url: str) -> Iterator[bytes]:
return self._chunks(response)
def _chunks(self, response: "requests.Response") -> Iterator[bytes]:
"""A generator function to be returned by fetch. This way the
caller of fetch can differentiate between connection and actual data
download."""
"""A generator function to be returned by fetch.
This way the caller of fetch can differentiate between connection
and actual data download.
"""
try:
for data in response.iter_content(self.chunk_size):

View file

@ -40,7 +40,8 @@ class Repository(ABC):
def open(self, role: str) -> Metadata:
"""Load a roles metadata from storage or cache, return it
If role has no metadata, create first version from scratch"""
If role has no metadata, create first version from scratch.
"""
raise NotImplementedError
@abstractmethod
@ -48,7 +49,8 @@ def close(self, role: str, md: Metadata) -> None:
"""Write roles metadata into storage
Update expiry and version and replace signatures with ones from all
available keys. Keep snapshot_info and targets_infos updated."""
available keys. Keep snapshot_info and targets_infos updated.
"""
raise NotImplementedError
@property