diff --git a/record.py b/record.py index f77e933..cd26bf4 100644 --- a/record.py +++ b/record.py @@ -67,3 +67,12 @@ class RecordCollection(): except KeyError: pass + + def findEntrypoints(self): + ret = [] + + for i in self.objects: + if not self.objects[i].parents: + ret.append(self.objects[i]) + + return ret diff --git a/record_test.py b/record_test.py index 739b906..9202490 100644 --- a/record_test.py +++ b/record_test.py @@ -2,4 +2,7 @@ import record records = record.RecordCollection('datafile') +entries = records.findEntrypoints() + print(records.objects) +print(entries)