flow/hooks/DFGHook: add iterator on hooks
This commit is contained in:
parent
37fe6d64c3
commit
adacdadd58
|
@ -37,9 +37,10 @@ class DFGHook:
|
||||||
ep = data["source"]
|
ep = data["source"]
|
||||||
ep_to_hook[ep] = create(u, ep, v)
|
ep_to_hook[ep] = create(u, ep, v)
|
||||||
|
|
||||||
def get_fragment(self):
|
def hooks_iter(self):
|
||||||
frag = Fragment()
|
|
||||||
for v1 in self.nodepair_to_ep.values():
|
for v1 in self.nodepair_to_ep.values():
|
||||||
for v2 in v1.values():
|
for v2 in v1.values():
|
||||||
frag += v2.get_fragment()
|
yield v2
|
||||||
return frag
|
|
||||||
|
def get_fragment(self):
|
||||||
|
return sum([h.get_fragment() for h in self.hooks_iter()], Fragment())
|
||||||
|
|
Loading…
Reference in New Issue