summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-07-15 15:12:28 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-08-16 17:04:59 -0300
commitf3b1df8ec4126dea3befec27a4ebe0a8f80d0557 (patch)
tree0f414d7aaf5c05bd8170dfb84025c20f77fd3c19
parente84fe219a6146c14795d7ec8798f415b95b1956b (diff)
pyolian: Add a method to get the hierarchy of extensions
-rw-r--r--src/scripts/pyolian/eolian.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 790fdb2385..211cd7d975 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -700,6 +700,23 @@ class Class(Object):
700 return Iterator(Class, lib.eolian_class_extensions_get(self)) 700 return Iterator(Class, lib.eolian_class_extensions_get(self))
701 701
702 @cached_property 702 @cached_property
703 def extensions_hierarchy(self):
704 visited = set()
705 queue = [ext for ext in self.extensions]
706
707 while queue:
708 current = queue.pop()
709
710 if current in visited:
711 continue
712
713 visited.add(current)
714
715 queue.extend(current.extensions)
716
717 return visited
718
719 @cached_property
703 def inherits_full(self): 720 def inherits_full(self):
704 L = [] 721 L = []
705 722