Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
edan-bainglass committed Jan 5, 2025
1 parent a23d362 commit d79e30e
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def __init__(
**kwargs,
)

@property
def process_node(self):
return orm.load_node(self.uuid)

def update(self, node=None):
node = node or orm.load_node(self.uuid)
node = node or self.process_node
self.state.value = self._get_state(node)
self.emoji.value = self._get_emoji(self.state.value)

Expand Down Expand Up @@ -168,10 +172,10 @@ def collapsed(self):
return self.toggle.icon == "plus"

def update(self, node=None):
node = node or orm.load_node(self.uuid)
node = node or self.process_node
super().update(node)
self.tally.value = self._get_tally(node)
self._add_children(node)
self._add_branches(node)
branch: TreeNode
for branch in self.branches.children:
branch.update()
Expand Down Expand Up @@ -210,12 +214,12 @@ def _build_header(self, node, level):
self.tally,
]

def _add_children(self, node):
def _add_branches(self, node):
for child in node.called:
if child.pk in self.pks:
continue
if child.process_label == "BandsWorkChain":
self._add_children(child)
self._add_branches(child)
else:
TreeNodeClass = (
WorkChainTreeNode
Expand Down

0 comments on commit d79e30e

Please sign in to comment.