Skip to content

Commit

Permalink
Fix DeprecationWarnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jan 20, 2025
1 parent 7c22d79 commit 822e037
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions news/4090.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix DeprecationWarnings. [maurits]
6 changes: 3 additions & 3 deletions plone/portlets/assignable.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions plone/portlets/settings.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plone/portlets/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 822e037

Please sign in to comment.