| Conditions | 7 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | from niprov.dependencies import Dependencies |
||
| 15 | def lookupRelativesRecursive(images, relationToLookFor): |
||
| 16 | if relationToLookFor is 'parents': |
||
| 17 | parentLocations = set() |
||
| 18 | for image in images: |
||
| 19 | parentLocations.update(image.provenance.get('parents',[])) |
||
| 20 | relatives = self.files.byLocations(list(parentLocations)) |
||
| 21 | elif relationToLookFor is 'children': |
||
| 22 | thisGenerationLocations = [i.location.toString() for i in images] |
||
| 23 | relatives = self.files.byParents(thisGenerationLocations) |
||
| 24 | for relative in relatives: |
||
| 25 | filesByLocation[relative.location.toString()] = relative |
||
| 26 | if relatives: |
||
| 27 | lookupRelativesRecursive(relatives, relationToLookFor) |
||
| 28 | |||
| 32 |