From 662a8cb8a704ba8f6b3f883ae4c4c5bf58289272 Mon Sep 17 00:00:00 2001 From: Florian Strzelecki Date: Wed, 9 Feb 2022 22:25:38 +0100 Subject: [PATCH] fix tools move memories Co-authored-by: dgw --- sopel/tools/__init__.py | 1 + sopel/tools/memories.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sopel/tools/__init__.py b/sopel/tools/__init__.py index 7ad1a6d8fa..10b07d43cd 100644 --- a/sopel/tools/__init__.py +++ b/sopel/tools/__init__.py @@ -27,6 +27,7 @@ from sopel import __version__ from ._events import events # NOQA +# shortcuts & backward compatibility with pre-8.0 from .identifiers import Identifier # NOQA from .memories import ( # NOQA SopelIdentifierMemory, diff --git a/sopel/tools/memories.py b/sopel/tools/memories.py index 7d07ab4901..2ee9396183 100644 --- a/sopel/tools/memories.py +++ b/sopel/tools/memories.py @@ -2,7 +2,7 @@ Sopel uses lots of threads to manage rules and jobs and other features, and it needs to store shared information safely. This class contains various memory -classes that are thread-safe, with some added feature. +classes that are thread-safe, with some convenience features. """ from __future__ import annotations @@ -29,6 +29,8 @@ class SopelMemory(dict): Moved to ``tools.WillieMemory`` .. versionchanged:: 6.0 Renamed from ``WillieMemory`` to ``SopelMemory`` + .. versionchanged:: 8.0 + Moved from ``tools`` to ``tools.memories`` """ def __init__(self, *args): dict.__init__(self, *args) @@ -68,6 +70,8 @@ class SopelMemoryWithDefault(defaultdict): As ``WillieMemoryWithDefault`` .. versionchanged:: 6.0 Renamed to ``SopelMemoryWithDefault`` + .. versionchanged:: 8.0 + Moved from ``tools`` to ``tools.memories`` """ def __init__(self, *args): defaultdict.__init__(self, *args) @@ -137,6 +141,8 @@ def setup(bot): .. versionchanged:: 8.0 + Moved from ``tools`` to ``tools.memories``. + The parameter ``identifier_factory`` has been added to properly transform ``str`` into :class:`~.identifiers.Identifier`. This factory is stored and accessible through :attr:`make_identifier`.