feature(keyringctl): add type hinting direct sigs/revocations
This commit is contained in:
parent
147287959f
commit
e422149c8a
10
keyringctl
10
keyringctl
@ -178,8 +178,8 @@ def convert_certificate( # noqa: ignore=C901
|
|||||||
# root packets
|
# root packets
|
||||||
certificate_fingerprint: Optional[Fingerprint] = None
|
certificate_fingerprint: Optional[Fingerprint] = None
|
||||||
pubkey: Optional[Path] = None
|
pubkey: Optional[Path] = None
|
||||||
direct_sigs: Dict[str, List[Path]] = defaultdict(list)
|
direct_sigs: Dict[Fingerprint, List[Path]] = defaultdict(list)
|
||||||
direct_revocations: Dict[str, List[Path]] = defaultdict(list)
|
direct_revocations: Dict[Fingerprint, List[Path]] = defaultdict(list)
|
||||||
|
|
||||||
# subkey packets
|
# subkey packets
|
||||||
subkeys: Dict[Fingerprint, Path] = {}
|
subkeys: Dict[Fingerprint, Path] = {}
|
||||||
@ -228,7 +228,7 @@ def convert_certificate( # noqa: ignore=C901
|
|||||||
if not certificate_fingerprint:
|
if not certificate_fingerprint:
|
||||||
raise Exception('missing certificate fingerprint for "{packet.name}"')
|
raise Exception('missing certificate fingerprint for "{packet.name}"')
|
||||||
|
|
||||||
issuer = packet_dump_field(packet, "Issuer")
|
issuer: Fingerprint = Fingerprint(packet_dump_field(packet, "Issuer"))
|
||||||
signature_type = packet_dump_field(packet, "Type")
|
signature_type = packet_dump_field(packet, "Type")
|
||||||
|
|
||||||
if current_packet_mode == "pubkey":
|
if current_packet_mode == "pubkey":
|
||||||
@ -441,7 +441,7 @@ def persist_subkey_revocations(
|
|||||||
|
|
||||||
|
|
||||||
def persist_direct_sigs(
|
def persist_direct_sigs(
|
||||||
direct_sigs: Dict[str, List[Path]],
|
direct_sigs: Dict[Fingerprint, List[Path]],
|
||||||
pubkey: Path,
|
pubkey: Path,
|
||||||
key_dir: Path,
|
key_dir: Path,
|
||||||
sig_type: str = "certification",
|
sig_type: str = "certification",
|
||||||
@ -451,7 +451,7 @@ def persist_direct_sigs(
|
|||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
direct_sigs: Dict[str, List[Path]]
|
direct_sigs: Dict[Fingerprint, List[Path]]
|
||||||
The direct sigs to write to file
|
The direct sigs to write to file
|
||||||
pubkey: Path
|
pubkey: Path
|
||||||
The path to the public key of the root key
|
The path to the public key of the root key
|
||||||
|
Loading…
x
Reference in New Issue
Block a user