Remove too verbose debug logs, implement repr() for KeyCache

This commit is contained in:
Piotr F. Mieszkowski 2022-10-20 22:27:34 +02:00
parent 540ca2adf3
commit 99e939bb4e
2 changed files with 5 additions and 2 deletions

View File

@ -60,6 +60,11 @@ class KeyCache:
"""Check if cache contains a key assigned to the given email."""
return email in self._keys.values()
def __repr__(self):
"""Return text representation of this object."""
details = ' '.join(self._keys.keys())
return f'<KeyCache {details}>'
class KeyRing:
"""A high-level adapter for GnuPG-maintained keyring directory.

View File

@ -189,9 +189,7 @@ def _identify_gpg_recipients(recipients, keys: kcache.KeyCache):
# GnuPG keys found in our keyring.
LOG.info(f'Processisng recipients: {recipients!r}; keys: {keys!r}')
for to in recipients:
LOG.info(f"At to={to!r}")
own_key = _try_configured_key(to, keys)
if own_key is not None:
gpg_to.append(GpgRecipient(own_key[0], own_key[1]))