@@ -24,7 +24,7 @@ class Node(object):
24
24
def __init__ (self , name ):
25
25
"""Node representing an item in the tree.
26
26
name - The tag name associated with the node
27
- parent - The parent of the current node (or None for the root node)
27
+ parent - The parent of the current node (or None for the document node)
28
28
value - The value of the current node (applies to text nodes and
29
29
comments
30
30
attributes - a dict holding name, value pairs for attributes of the node
@@ -52,7 +52,8 @@ def __repr__(self):
52
52
return "<%s %s>" % (self .__class__ , self .name )
53
53
54
54
def appendChild (self , node ):
55
- """Insert node as a child of the current node"""
55
+ """Insert node as a child of the current node
56
+ """
56
57
raise NotImplementedError
57
58
58
59
def insertText (self , data , insertBefore = None ):
@@ -68,21 +69,24 @@ def insertBefore(self, node, refNode):
68
69
raise NotImplementedError
69
70
70
71
def removeChild (self , node ):
71
- """Remove node from the children of the current node"""
72
+ """Remove node from the children of the current node
73
+ """
72
74
raise NotImplementedError
73
75
74
76
def reparentChildren (self , newParent ):
75
77
"""Move all the children of the current node to newParent.
76
78
This is needed so that trees that don't store text as nodes move the
77
- text in the correct way"""
79
+ text in the correct way
80
+ """
78
81
#XXX - should this method be made more general?
79
82
for child in self .childNodes :
80
83
newParent .appendChild (child )
81
84
self .childNodes = []
82
85
83
86
def cloneNode (self ):
84
87
"""Return a shallow copy of the current node i.e. a node with the same
85
- name and attributes but with no parent or child nodes"""
88
+ name and attributes but with no parent or child nodes
89
+ """
86
90
raise NotImplementedError
87
91
88
92
0 commit comments