コード例 #1
0
 def test_text(self):
     node = Node("category")
     self.assertIsNone(node.text)
     node = Node("category", ("This is text", 60))
     self.assertEqual(node.text, "This is text")
     node.corr_text = "Text is corrected"
     self.assertEqual(node.text, "Text is corrected")
コード例 #2
0
 def apply_change(self, node: Node):
     """
     Method used to apply a BackChange to a node
     :param node: the node which needs to be changed
     """
     change = self.back_changes.get(self.tree_identifiers[id(node)],
                                    BackChange())
     node.corr_text = change.text
     if isinstance(node, LabelNode):
         node.corr_label = change.label