helper functions -------------------------------------------------------—
iterate over a (possibly nested) ``seq`` AlgSequence.
if the sequence contains nested sub-sequences, everything will be flatten
out in-order.
example:
>>> import AthenaCommon.AlgSequence as acas
>>> aaa = CfgMgr.AthSequencer('aaa')
>>> aaa += CfgMgr.AthSequencer('aaa1')
>>> aaa.aaa1 += CfgMgr.AthSequencer('aaa2')
>>> aaa.aaa1.aaa2 += CfgMgr.AthSequencer('aaa3')
>>> aaa.aaa1.aaa2.aaa3 += CfgMgr.AthSequencer('aaa4')
>>> aaa.aaa1.aaa2.aaa3.aaa4 += CfgMgr.AthSequencer('aaa5')
>>> aaa += CfgMgr.AthSequencer('aaa11')
>>> aaa.aaa11 += CfgMgr.AthSequencer('aaa21')
>>> print ([c.getName() for c in acas.iter_algseq(aaa)])
['aaa', 'aaa1', 'aaa2', 'aaa3', 'aaa4', 'aaa5', 'aaa11', 'aaa21']
Definition at line 75 of file Control/AthenaCommon/python/AlgSequence.py.
76 """iterate over a (possibly nested) ``seq`` AlgSequence.
78 if the sequence contains nested sub-sequences, everything will be flatten
82 >>> import AthenaCommon.AlgSequence as acas
83 >>> aaa = CfgMgr.AthSequencer('aaa')
84 >>> aaa += CfgMgr.AthSequencer('aaa1')
85 >>> aaa.aaa1 += CfgMgr.AthSequencer('aaa2')
86 >>> aaa.aaa1.aaa2 += CfgMgr.AthSequencer('aaa3')
87 >>> aaa.aaa1.aaa2.aaa3 += CfgMgr.AthSequencer('aaa4')
88 >>> aaa.aaa1.aaa2.aaa3.aaa4 += CfgMgr.AthSequencer('aaa5')
89 >>> aaa += CfgMgr.AthSequencer('aaa11')
90 >>> aaa.aaa11 += CfgMgr.AthSequencer('aaa21')
91 >>> print ([c.getName() for c in acas.iter_algseq(aaa)])
92 ['aaa', 'aaa1', 'aaa2', 'aaa3', 'aaa4', 'aaa5', 'aaa11', 'aaa21']
94 def _iter_algseq(seq):
96 for c
in seq.getChildren():
97 for sub
in _iter_algseq(c):
99 return _iter_algseq(seq)