mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 10:16:32 +01:00
Test with different tree solution
This commit is contained in:
parent
40d9bd4ff5
commit
5d313b0cac
1 changed files with 6 additions and 4 deletions
|
|
@ -362,12 +362,14 @@ def get_prototype_tree(metaprotos):
|
|||
elif isinstance(proto, (tuple, list)):
|
||||
parents[key].extend([pro.lower() for pro in proto])
|
||||
|
||||
def _iterate(root):
|
||||
prts = parents[root]
|
||||
def _iterate(child, level=0):
|
||||
tree = [_iterate(parent, level + 1) for parent in parents[key]]
|
||||
return tree if tree else level * " " + child
|
||||
|
||||
for key in parents:
|
||||
print("Mproto {}:\n{}".format(_iterate(key, level=0)))
|
||||
|
||||
|
||||
return parents
|
||||
return []
|
||||
|
||||
roots = [root for root in metaprotos if not root.prototype.get('prototype')]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue