diff options
| author | J08nY | 2017-07-26 21:19:34 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-26 21:19:34 +0200 |
| commit | 13055e265c738be43c0a4cb4c2898939cd0c1cd5 (patch) | |
| tree | 0fc6f89afe70e60705c702824dbd47bb665b419b | |
| parent | 276c82849f61bd13b0fb2b38a028d58d87e830ed (diff) | |
| download | mailman-pgp-13055e265c738be43c0a4cb4c2898939cd0c1cd5.tar.gz mailman-pgp-13055e265c738be43c0a4cb4c2898939cd0c1cd5.tar.zst mailman-pgp-13055e265c738be43c0a4cb4c2898939cd0c1cd5.zip | |
| -rw-r--r-- | src/mailman_pgp/utils/pgp.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/mailman_pgp/utils/pgp.py b/src/mailman_pgp/utils/pgp.py index 0e1e75c..4251693 100644 --- a/src/mailman_pgp/utils/pgp.py +++ b/src/mailman_pgp/utils/pgp.py @@ -25,7 +25,7 @@ def verifies(verifications): """ :param verifications: - :type verifications: Sequence[pgpy.types.SignatureVerification] + :type verifications: typing.Sequence[pgpy.types.SignatureVerification] :return: bool """ return all(bool(verification) and @@ -40,7 +40,7 @@ def hashes(verifications): :param verifications: :return: - :rtype: Generator[str] + :rtype: typing.Generator[bytes] """ for verification in verifications: for sigsubj in verification.good_signatures: @@ -56,12 +56,10 @@ def key_from_blob(blob): :param blob: :return: + :rtype: pgpy.PGPKey """ - keys = PGPKey.from_blob(blob) - if isinstance(keys, tuple): - return keys[0] - else: - return keys + key, _ = PGPKey.from_blob(blob) + return key @public @@ -70,9 +68,7 @@ def key_from_file(file): :param file: :return: + :rtype: pgpy.PGPKey """ - keys = PGPKey.from_file(file) - if isinstance(keys, tuple): - return keys[0] - else: - return keys + key, _ = PGPKey.from_file(file) + return key |
