diff --git a/src/diana/sgfParser/node.py b/src/diana/sgfParser/node.py --- a/src/diana/sgfParser/node.py +++ b/src/diana/sgfParser/node.py @@ -98,18 +98,18 @@ class Node: return ";" + "".join(str(p) for p in self.properties.values()) def export(self): - # there is a beatiful recursive solution, which this stack is too narrow to contain + # there is a beautiful recursive solution, which this stack is too narrow to contain stack=[(self,1,1)] output=[] while len(stack)>0: node,left,right=stack.pop() if left>0: output.append("("*left) - output.append(str(node)) + output.append(str(node)+"\n") childCount=len(node.children) if childCount==0: # a leaf - output.append(")"*right) + output.append(")"*right+"\n") elif childCount==1: # a line stack.append((node.children[0],0,right)) else: # a branching node