Differences From Artifact [7aba067c30a34ede]:
- File
tree.py
- 2011-09-13 20:02:12 - part of checkin [18dba95a2e] on branch feature/abc - Changed parser to include nodes (user: brian) [annotate]
To Artifact [29c78902c8370937]:
- File
tree.py
- 2011-09-13 20:08:17 - part of checkin [029fd48614] on branch feature/abc - Added a name parameter to the Tree class that will prove helpful in generating the score (user: brian) [annotate]
- 2011-10-11 15:31:53 - part of checkin [192b8b1639] on branch develop - Merged in rewrite of core functionality (user: brian) [annotate]
- 2011-10-20 18:44:05 - part of checkin [ba64e400ba] on branch ply - Yay, first alpha release. program supports syncing and basic section/subsection ordering. (user: brian) [annotate]
1 import pdb 1 import pdb
2 2
3 class Tree(): 3 class Tree():
4 def __init__(self): | 4 def __init__(self, name):
5 self.nodes = [] 5 self.nodes = []
> 6 self.name = name
6 7
7 def traverse_depth_first(self): 8 def traverse_depth_first(self):
8 all_nodes = [] 9 all_nodes = []
9 for node in self.nodes: 10 for node in self.nodes:
10 if isinstance(node, Node): 11 if isinstance(node, Node):
11 all_nodes.append(node) 12 all_nodes.append(node)
12 elif isinstance(node, Tree): 13 elif isinstance(node, Tree):