| Conditions | 5 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # pylint: disable=invalid-name,missing-module-docstring,line-too-long |
||
| 2 | def get_AllIndexed(self, classes=None, index_sort=True): |
||
| 3 | """ |
||
| 4 | Get all indexed children sorted by their ``@index``. |
||
| 5 | |||
| 6 | Arguments: |
||
| 7 | classes (list): Type of children to return. Default: ['RegionRef', 'OrderedGroup', 'UnorderedGroup'] |
||
| 8 | index_sort (boolean): Whether to sort by ``@index`` |
||
| 9 | """ |
||
| 10 | if not classes: |
||
| 11 | classes = ['RegionRef', 'OrderedGroup', 'UnorderedGroup'] |
||
| 12 | ret = [] |
||
| 13 | for class_ in classes: |
||
| 14 | ret += getattr(self, 'get_{}Indexed'.format(class_))() |
||
| 15 | if index_sort: |
||
| 16 | return sorted(ret, key=lambda x: x.index) |
||
| 17 | return ret |
||
| 18 |