Skip to content

Commit

Permalink
Fix blank lines in tuf.api as per styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
lukpueh committed Mar 5, 2021
1 parent c254fd0 commit 17c25e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tuf/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ def verify(self, key: Mapping[str, Any],
signed_serializer.serialize(self.signed))



class Signed:
"""A base class for the signed part of TUF metadata.
Expand All @@ -281,12 +280,10 @@ class Signed:
metadata format adheres to.
expires: The metadata expiration datetime object.
"""
# NOTE: Signed is a stupid name, because this might not be signed yet, but
# we keep it to match spec terminology (I often refer to this as "payload",
# or "inner metadata")

def __init__(
self, _type: str, version: int, spec_version: str,
expires: datetime) -> None:
Expand Down Expand Up @@ -333,13 +330,11 @@ def _common_fields_to_dict(self) -> Dict[str, Any]:
'expires': self.expires.isoformat() + 'Z'
}


# Modification.
def bump_expiration(self, delta: timedelta = timedelta(days=1)) -> None:
"""Increments the expires attribute by the passed timedelta. """
self.expires += delta


def bump_version(self) -> None:
"""Increments the metadata version number by 1."""
self.version += 1
Expand Down Expand Up @@ -420,7 +415,6 @@ def add_key(self, role: str, keyid: str,
self.roles[role]['keyids'].append(keyid)
self.keys[keyid] = key_metadata


# Remove key for a role.
def remove_key(self, role: str, keyid: str) -> None:
"""Removes key for 'role' and updates the key store. """
Expand All @@ -433,8 +427,6 @@ def remove_key(self, role: str, keyid: str) -> None:
del self.keys[keyid]




class Timestamp(Signed):
"""A container for the signed part of timestamp metadata.
Expand Down
2 changes: 2 additions & 0 deletions tuf/api/serialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
"""
import abc


# TODO: Should these be in tuf.exceptions or inherit from tuf.exceptions.Error?
class SerializationError(Exception):
"""Error during serialization. """


class DeserializationError(Exception):
"""Error during deserialization. """

Expand Down

0 comments on commit 17c25e2

Please sign in to comment.