@@ -164,7 +164,7 @@ def from_bytes(
164164 return deserializer .deserialize (data )
165165
166166 def to_dict (self ) -> Dict [str , Any ]:
167- """Returns the dict representation of self. """
167+ """Returns the dict representation of self."""
168168
169169 signatures = []
170170 for sig in self .signatures :
@@ -397,7 +397,7 @@ def is_expired(self, reference_time: datetime = None) -> bool:
397397
398398 # Modification.
399399 def bump_expiration (self , delta : timedelta = timedelta (days = 1 )) -> None :
400- """Increments the expires attribute by the passed timedelta. """
400+ """Increments the expires attribute by the passed timedelta."""
401401 self .expires += delta
402402
403403 def bump_version (self ) -> None :
@@ -465,7 +465,7 @@ def __init__(
465465
466466 @classmethod
467467 def from_dict (cls , root_dict : Mapping [str , Any ]) -> "Root" :
468- """Creates Root object from its dict representation. """
468+ """Creates Root object from its dict representation."""
469469 common_args = cls ._common_fields_from_dict (root_dict )
470470 consistent_snapshot = root_dict .pop ("consistent_snapshot" )
471471 keys = root_dict .pop ("keys" )
@@ -474,7 +474,7 @@ def from_dict(cls, root_dict: Mapping[str, Any]) -> "Root":
474474 return cls (* common_args , consistent_snapshot , keys , roles , root_dict )
475475
476476 def to_dict (self ) -> Dict [str , Any ]:
477- """Returns the dict representation of self. """
477+ """Returns the dict representation of self."""
478478 root_dict = self ._common_fields_to_dict ()
479479 root_dict .update (
480480 {
@@ -489,14 +489,14 @@ def to_dict(self) -> Dict[str, Any]:
489489 def add_key (
490490 self , role : str , keyid : str , key_metadata : Mapping [str , Any ]
491491 ) -> None :
492- """Adds new key for 'role' and updates the key store. """
492+ """Adds new key for 'role' and updates the key store."""
493493 if keyid not in self .roles [role ]["keyids" ]:
494494 self .roles [role ]["keyids" ].append (keyid )
495495 self .keys [keyid ] = key_metadata
496496
497497 # Remove key for a role.
498498 def remove_key (self , role : str , keyid : str ) -> None :
499- """Removes key for 'role' and updates the key store. """
499+ """Removes key for 'role' and updates the key store."""
500500 if keyid in self .roles [role ]["keyids" ]:
501501 self .roles [role ]["keyids" ].remove (keyid )
502502 for keyinfo in self .roles .values ():
@@ -543,14 +543,14 @@ def __init__(
543543
544544 @classmethod
545545 def from_dict (cls , timestamp_dict : Mapping [str , Any ]) -> "Timestamp" :
546- """Creates Timestamp object from its dict representation. """
546+ """Creates Timestamp object from its dict representation."""
547547 common_args = cls ._common_fields_from_dict (timestamp_dict )
548548 meta = timestamp_dict .pop ("meta" )
549549 # All fields left in the timestamp_dict are unrecognized.
550550 return cls (* common_args , meta , timestamp_dict )
551551
552552 def to_dict (self ) -> Dict [str , Any ]:
553- """Returns the dict representation of self. """
553+ """Returns the dict representation of self."""
554554 timestamp_dict = self ._common_fields_to_dict ()
555555 timestamp_dict .update ({"meta" : self .meta })
556556 return timestamp_dict
@@ -559,7 +559,7 @@ def to_dict(self) -> Dict[str, Any]:
559559 def update (
560560 self , version : int , length : int , hashes : Mapping [str , Any ]
561561 ) -> None :
562- """Assigns passed info about snapshot metadata to meta dict. """
562+ """Assigns passed info about snapshot metadata to meta dict."""
563563 self .meta ["snapshot.json" ] = {
564564 "version" : version ,
565565 "length" : length ,
@@ -611,14 +611,14 @@ def __init__(
611611
612612 @classmethod
613613 def from_dict (cls , snapshot_dict : Mapping [str , Any ]) -> "Snapshot" :
614- """Creates Snapshot object from its dict representation. """
614+ """Creates Snapshot object from its dict representation."""
615615 common_args = cls ._common_fields_from_dict (snapshot_dict )
616616 meta = snapshot_dict .pop ("meta" )
617617 # All fields left in the snapshot_dict are unrecognized.
618618 return cls (* common_args , meta , snapshot_dict )
619619
620620 def to_dict (self ) -> Dict [str , Any ]:
621- """Returns the dict representation of self. """
621+ """Returns the dict representation of self."""
622622 snapshot_dict = self ._common_fields_to_dict ()
623623 snapshot_dict .update ({"meta" : self .meta })
624624 return snapshot_dict
@@ -631,7 +631,7 @@ def update(
631631 length : Optional [int ] = None ,
632632 hashes : Optional [Mapping [str , Any ]] = None ,
633633 ) -> None :
634- """Assigns passed (delegated) targets role info to meta dict. """
634+ """Assigns passed (delegated) targets role info to meta dict."""
635635 metadata_fn = f"{ rolename } .json"
636636
637637 self .meta [metadata_fn ] = {"version" : version }
@@ -719,15 +719,15 @@ def __init__(
719719
720720 @classmethod
721721 def from_dict (cls , targets_dict : Mapping [str , Any ]) -> "Targets" :
722- """Creates Targets object from its dict representation. """
722+ """Creates Targets object from its dict representation."""
723723 common_args = cls ._common_fields_from_dict (targets_dict )
724724 targets = targets_dict .pop ("targets" )
725725 delegations = targets_dict .pop ("delegations" )
726726 # All fields left in the targets_dict are unrecognized.
727727 return cls (* common_args , targets , delegations , targets_dict )
728728
729729 def to_dict (self ) -> Dict [str , Any ]:
730- """Returns the dict representation of self. """
730+ """Returns the dict representation of self."""
731731 targets_dict = self ._common_fields_to_dict ()
732732 targets_dict .update (
733733 {
@@ -739,5 +739,5 @@ def to_dict(self) -> Dict[str, Any]:
739739
740740 # Modification.
741741 def update (self , filename : str , fileinfo : Mapping [str , Any ]) -> None :
742- """Assigns passed target file info to meta dict. """
742+ """Assigns passed target file info to meta dict."""
743743 self .targets [filename ] = fileinfo
0 commit comments