--- a/src/pyams_utils/container.py Wed Nov 20 19:26:23 2019 +0100
+++ b/src/pyams_utils/container.py Fri Nov 22 18:51:37 2019 +0100
@@ -9,14 +9,13 @@
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
+# pylint: disable=no-name-in-module
"""PyAMS_utils.container module
This module provides several classes, adapters and functions about containers.
"""
-__docformat__ = 'restructuredtext'
-
from BTrees.OOBTree import OOBTree
from persistent.list import PersistentList
from pyramid.threadlocal import get_current_registry
@@ -28,6 +27,9 @@
from pyams_utils.adapter import ContextAdapter, adapter_config
+__docformat__ = 'restructuredtext'
+
+
class BTreeOrderedContainer(OrderedContainer):
"""BTree based ordered container
@@ -35,11 +37,12 @@
"""
def __init__(self):
+ # pylint: disable=super-init-not-called
self._data = OOBTree()
self._order = PersistentList()
-class ParentSelector(object):
+class ParentSelector:
"""Interface based parent selector
This selector can be used as a subscriber predicate on IObjectAddedEvent to define
@@ -55,11 +58,13 @@
"""
def __init__(self, ifaces, config):
+ # pylint: disable=unused-argument
if not isinstance(ifaces, (list, tuple, set)):
ifaces = (ifaces,)
self.interfaces = ifaces
def text(self):
+ """Predicate string output"""
return 'parent_selector = %s' % str(self.interfaces)
phash = text
@@ -119,7 +124,7 @@
yield root
locations = ISublocations(root, None)
if locations is not None:
- for location in locations.sublocations():
+ for location in locations.sublocations(): # pylint: disable=too-many-function-args
if condition(location):
yield location
yield from find_objects_matching(location, condition, ignore_root=True)