add RecordCollection.findEntrypoints()

This commit is contained in:
randomuser 2021-11-22 18:19:40 -06:00
parent b5aec5940e
commit d34d9272fe
2 changed files with 12 additions and 0 deletions

View File

@ -67,3 +67,12 @@ class RecordCollection():
except KeyError: except KeyError:
pass pass
def findEntrypoints(self):
ret = []
for i in self.objects:
if not self.objects[i].parents:
ret.append(self.objects[i])
return ret

View File

@ -2,4 +2,7 @@ import record
records = record.RecordCollection('datafile') records = record.RecordCollection('datafile')
entries = records.findEntrypoints()
print(records.objects) print(records.objects)
print(entries)