refactor node markers, remove need to be aware of nodes

This commit is contained in:
Ronny Pfannschmidt
2018-03-18 16:52:43 +01:00
parent 2d06ae0f65
commit 5e56e9b4f6
2 changed files with 7 additions and 11 deletions
+3 -9
View File
@@ -369,13 +369,8 @@ class NodeKeywords(MappingMixin):
@attr.s(cmp=False, hash=False)
class NodeMarkers(object):
node = attr.ib(repr=False)
own_markers = attr.ib(default=attr.Factory(list))
@classmethod
def from_node(cls, node):
return cls(node=node)
def update(self, add_markers):
"""update the own markers
"""
@@ -386,7 +381,6 @@ class NodeMarkers(object):
find markers in own nodes or parent nodes
needs a better place
"""
for node in reversed(self.node.listchain()):
for mark in node._markers.own_markers:
if mark.name == name:
yield mark
for mark in self.own_markers:
if mark.name == name:
yield mark