Code cleanup (#234)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-07-31 18:22:57 -07:00
1 parent 8b414bafab
commit e35781fe85
14 files changed
+46 -68

No files matched your search

+2 -4
View File
@@ -16,7 +16,6 @@
Functions for traversing server bridge tree nodes (storage)
"""
from __future__ import absolute_import, division, print_function
from collections import defaultdict
from typing import List
@@ -28,7 +27,7 @@ class TreeNode(defaultdict):
__slots__ = ["object", "transform", "properties", "animation"]
def __init__(self, *args, **kwargs):
super(TreeNode, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self.object = None
self.properties = []
self.transform = None
@@ -46,8 +45,7 @@ def walk(tree: TreeNode) -> None:
"""
yield tree
for v in tree.values():
for t in walk(v): # could use `yield from` if we didn't need python2
yield t
yield from walk(v)
def find_node(tree: TreeNode, path: List[str]) -> TreeNode: