From 9f3ad49f1434b17393bf7a6f7669a8d275f0ac5c Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Sun, 16 Oct 2022 22:58:38 +0200 Subject: [PATCH] Rename lacre.keycache to lacre.keyring This will better reflect the fact we're doing more than just caching. --- lacre/daemon.py | 4 ++-- lacre/{keycache.py => keyring.py} | 2 +- lacre/mailgate.py | 2 +- test/modules/test_lacre_keycache.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename lacre/{keycache.py => keyring.py} (98%) diff --git a/lacre/daemon.py b/lacre/daemon.py index 9a0a428..dffad4d 100644 --- a/lacre/daemon.py +++ b/lacre/daemon.py @@ -25,7 +25,7 @@ lacre.init_logging(conf.get_item("logging", "config")) LOG = logging.getLogger(__name__) import lacre.mailgate as gate -import lacre.keycache as kcache +import lacre.keyring as kcache class MailEncryptionProxy: @@ -53,7 +53,7 @@ class MailEncryptionProxy: return RESULT_OK -def _init_controller(keys: kcache.KeyCache, tout: float = 2.5): +def _init_controller(keys: kcache.KeyCache, tout: float = 5): proxy = MailEncryptionProxy(keys) host, port = conf.daemon_params() LOG.info(f"Initialising a mail Controller at {host}:{port}") diff --git a/lacre/keycache.py b/lacre/keyring.py similarity index 98% rename from lacre/keycache.py rename to lacre/keyring.py index 3a3ad99..49d8527 100644 --- a/lacre/keycache.py +++ b/lacre/keyring.py @@ -1,4 +1,4 @@ -"""A cache of OpenPGP keys known to Lacre. +"""Data structures and utilities to make keyring access easier. IMPORTANT: This module has to be loaded _after_ initialisation of the logging module. diff --git a/lacre/mailgate.py b/lacre/mailgate.py index 4f139b6..1743b5e 100644 --- a/lacre/mailgate.py +++ b/lacre/mailgate.py @@ -40,7 +40,7 @@ from M2Crypto import BIO, SMIME, X509 import logging import lacre.text as text import lacre.config as conf -import lacre.keycache as kcache +import lacre.keyring as kcache from lacre.mailop import KeepIntact, InlineOpenPGPEncrypt, MimeOpenPGPEncrypt diff --git a/test/modules/test_lacre_keycache.py b/test/modules/test_lacre_keycache.py index 2f0be90..4c7f496 100644 --- a/test/modules/test_lacre_keycache.py +++ b/test/modules/test_lacre_keycache.py @@ -1,4 +1,4 @@ -from lacre.keycache import KeyCache +from lacre.keyring import KeyCache import unittest