moinformat/tree/moin.py | raw changeset files shortlog |
1.1 --- a/moinformat/tree/moin.py Tue Jul 31 00:00:49 2018 +0200 1.2 +++ b/moinformat/tree/moin.py Tue Jul 31 00:07:22 2018 +0200 1.3 @@ -106,6 +106,13 @@ 1.4 if text: 1.5 self.append(text) 1.6 1.7 + def replace(self, old, new): 1.8 + 1.9 + "Replace 'old' with 'new' in the children." 1.10 + 1.11 + i = self.nodes.index(old) 1.12 + self.nodes[i] = new 1.13 + 1.14 def __str__(self): 1.15 return self.prettyprint() 1.16