Skip to content

Commit

Permalink
fix: TreeNode has same name with NodeMixin
Browse files Browse the repository at this point in the history
NodeMixin have attrubute called size and it is set property.
This patch fixed this issue.

reference: https://github.com/c0fec0de/anytree/blob/main/anytree/node/nodemixin.py
  • Loading branch information
TaiJuWu committed Oct 9, 2023
1 parent ffba0d1 commit de454ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/size_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Process an ELF file to generate size report on RAM and ROM.
"""

import pdb
import argparse
import json
import os
Expand Down Expand Up @@ -530,14 +531,22 @@ class TreeNode(NodeMixin):
def __init__(self, name, identifier, size=0, parent=None, children=None):
super().__init__()
self.name = name
self.size = size
self._size = size
self.parent = parent
self.identifier = identifier
if children:
self.children = children

def __repr__(self):
return self.name

@property
def size(self):
return self._size

@size.setter
def size(self, value):
self._size = value


def sum_node_children_size(node):
Expand Down

0 comments on commit de454ab

Please sign in to comment.