diff options
author | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2019-07-15 15:12:28 -0300 |
---|---|---|
committer | Lauro Moura <lauromoura@expertisesolutions.com.br> | 2019-08-16 17:04:59 -0300 |
commit | f3b1df8ec4126dea3befec27a4ebe0a8f80d0557 (patch) | |
tree | 0f414d7aaf5c05bd8170dfb84025c20f77fd3c19 | |
parent | e84fe219a6146c14795d7ec8798f415b95b1956b (diff) | |
download | efl-f3b1df8ec4126dea3befec27a4ebe0a8f80d0557.tar.gz |
pyolian: Add a method to get the hierarchy of extensions
-rw-r--r-- | src/scripts/pyolian/eolian.py | 17 |
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): return Iterator(Class, lib.eolian_class_extensions_get(self)) @cached_property + def extensions_hierarchy(self): + visited = set() + queue = [ext for ext in self.extensions] + + while queue: + current = queue.pop() + + if current in visited: + continue + + visited.add(current) + + queue.extend(current.extensions) + + return visited + + @cached_property def inherits_full(self): L = [] |