From 822e037981d562378d1ba84f1caa888f61749b5d Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 20 Jan 2025 11:54:56 +0100 Subject: [PATCH] Fix DeprecationWarnings. --- news/4090.bugfix | 1 + plone/portlets/assignable.py | 6 +++--- plone/portlets/settings.py | 4 ++-- plone/portlets/storage.py | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 news/4090.bugfix diff --git a/news/4090.bugfix b/news/4090.bugfix new file mode 100644 index 0000000..8528aef --- /dev/null +++ b/news/4090.bugfix @@ -0,0 +1 @@ +Fix DeprecationWarnings. [maurits] diff --git a/plone/portlets/assignable.py b/plone/portlets/assignable.py index 049ac6d..1d1dc6f 100644 --- a/plone/portlets/assignable.py +++ b/plone/portlets/assignable.py @@ -1,5 +1,5 @@ from BTrees.OOBTree import OOBTree -from persistent.dict import PersistentDict +from persistent.mapping import PersistentMapping from plone.portlets.constants import CONTEXT_ASSIGNMENT_KEY from plone.portlets.constants import CONTEXT_BLACKLIST_STATUS_KEY from plone.portlets.constants import CONTEXT_CATEGORY @@ -68,13 +68,13 @@ def _getBlacklist(self, create=False): local = annotations.get(CONTEXT_BLACKLIST_STATUS_KEY, None) if local is None: if create: - local = annotations[CONTEXT_BLACKLIST_STATUS_KEY] = PersistentDict() + local = annotations[CONTEXT_BLACKLIST_STATUS_KEY] = PersistentMapping() else: return None blacklist = local.get(self.manager.__name__, None) if blacklist is None: if create: - blacklist = local[self.manager.__name__] = PersistentDict() + blacklist = local[self.manager.__name__] = PersistentMapping() else: return None return blacklist diff --git a/plone/portlets/settings.py b/plone/portlets/settings.py index dc5456f..a06f58b 100644 --- a/plone/portlets/settings.py +++ b/plone/portlets/settings.py @@ -1,4 +1,4 @@ -from persistent.dict import PersistentDict +from persistent.mapping import PersistentMapping from plone.portlets.constants import ASSIGNMENT_SETTINGS_KEY from plone.portlets.interfaces import IPortletAssignment from plone.portlets.interfaces import IPortletAssignmentSettings @@ -12,7 +12,7 @@ @implementer(IPortletAssignmentSettings) class PortletAssignmentSettings(Contained): def __init__(self): - self.data = PersistentDict() + self.data = PersistentMapping() def __setitem__(self, name, value): self.data[name] = value diff --git a/plone/portlets/storage.py b/plone/portlets/storage.py index e2c58ca..334d973 100644 --- a/plone/portlets/storage.py +++ b/plone/portlets/storage.py @@ -74,7 +74,7 @@ class PortletAssignmentMapping(OrderedContainer): def __init__(self, manager="", category="", name=""): # XXX: This depends on implementation detail in OrderedContainer, - # but it uses a PersistentDict, which sucks :-/ + # but it uses a PersistentMapping, which sucks :-/ OrderedContainer.__init__(self) self._data = OOBTree()