Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 474674e

Browse files
committed
Update interface.py
Rename accessor methods
1 parent b2ebd54 commit 474674e

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

‎w3/python/core/interface.py

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ def __init__(self) -> None:
9696
self.hasChildNodes: Callable[[], bool]
9797
self.cloneNodes: Callable[[bool], Node]
9898

99-
def _getNodeName(self) -> DOMString:
100-
"""Indirect accessor to get the 'nodeName' property."""
99+
def _get_nodeName(self) -> DOMString:
100+
"""Indirect accessor to get the `nodeName` property."""
101101
return self._node_name
102102

103-
def _setNodeName(self, name: DOMString) -> None:
104-
"""Indirect accessor to set the 'nodeName' property."""
103+
def _set_nodeName(self, name: DOMString) -> None:
104+
"""Indirect accessor to set the `nodeName` property."""
105105
self._node_name = DOMString(name)
106106

107-
def _getNodeValue(self) -> DOMString:
108-
"""Indirect accessor to get the 'nodeValue' property.
107+
def _get_nodeValue(self) -> DOMString:
108+
"""Indirect accessor to get the `nodeValue` property.
109109
110110
Raises:
111111
DOMException:
@@ -114,62 +114,62 @@ def _getNodeValue(self) -> DOMString:
114114
# XXX: DOMException.DOMSTRING_SIZE_ERR was not taken into account.
115115
return self._node_value
116116

117-
def _setNodeValue(self, value: DOMString) -> None:
118-
"""Indirect accessor to set the 'nodeValue' property."""
117+
def _set_nodeValue(self, value: DOMString) -> None:
118+
"""Indirect accessor to set the `nodeValue` property."""
119119
self._node_value = DOMString(value)
120120

121-
def _getNodeType(self) -> c_ushort:
122-
"""Indirect accessor to get the 'nodeType' property."""
121+
def _get_nodeType(self) -> c_ushort:
122+
"""Indirect accessor to get the `nodeType` property."""
123123
return self._node_type
124124

125-
def _setNodeType(self, type: c_ushort) -> None:
126-
"""Indirect accessor to set the 'nodeType' property."""
125+
def _set_nodeType(self, type: c_ushort) -> None:
126+
"""Indirect accessor to set the `nodeType` property."""
127127
self._node_type = c_ushort(type)
128128

129-
def _getParentNode(self) -> Node:
130-
"""Indirect accessor to get the 'parentNode' property."""
129+
def _get_parentNode(self) -> Node:
130+
"""Indirect accessor to get the `parentNode` property."""
131131
return self._parent_node
132132

133-
def _setParentNode(self, node: Optional[Node] = None) -> None:
134-
"""Indirect accessor to set the 'parentNode' property."""
133+
def _set_parentNode(self, node: Optional[Node] = None) -> None:
134+
"""Indirect accessor to set the `parentNode` property."""
135135
self._parent_node = node
136136

137-
def _getChildNodes(self) -> NodeList:
138-
"""Indirect accessor to get the 'childNodes' property."""
137+
def _get_childNodes(self) -> NodeList:
138+
"""Indirect accessor to get the `childNodes` property."""
139139
return self._child_nodes
140140

141-
def _getFirstChild(self) -> Node:
142-
"""Indirect accessor to get the 'firstChild' property."""
141+
def _get_firstChild(self) -> Optional[Node]:
142+
"""Indirect accessor to get the `firstChild` property."""
143143
raise NotImplementedError()
144144

145-
def _getLastChild(self) -> Node:
146-
"""Indirect accessor to get the 'lastChild' property."""
145+
def _get_lastChild(self) -> Node:
146+
"""Indirect accessor to get the `lastChild` property."""
147147
raise NotImplementedError()
148148

149-
def _getPreviousSibling(self) -> Node:
150-
"""Indirect accessor to get the 'previousSibling' property."""
149+
def _get_previousSibling(self) -> Node:
150+
"""Indirect accessor to get the `previousSibling` property."""
151151
return self._prev_sibling_node
152152

153-
def _getNextSibling(self) -> Node:
154-
"""Indirect accessor to get the 'nextSibling' property."""
153+
def _get_nextSibling(self) -> Node:
154+
"""Indirect accessor to get the `nextSibling` property."""
155155
return self._next_sibling_node
156156

157-
def _getAttributes(self) -> NamedNodeMap:
158-
"""Indirect accessor to get the 'attributes' property."""
157+
def _get_attributes(self) -> NamedNodeMap:
158+
"""Indirect accessor to get the `attributes` property."""
159159
return self._attributes
160160

161-
def _getOwnerDocument(self) -> Document:
162-
"""Indirect accessor to get the 'ownerDocument' property."""
161+
def _get_ownerDocument(self) -> Document:
162+
"""Indirect accessor to get the `ownerDocument` property."""
163163
return self._owner_document
164164

165-
def _setOwnerDocument(self, owner_document: Document) -> None:
166-
"""Indirect accessor to set the 'ownerDocument' property."""
165+
def _set_ownerDocument(self, owner_document: Document) -> None:
166+
"""Indirect accessor to set the `ownerDocument` property."""
167167
self._owner_document = owner_document
168168

169169
@property
170170
def nodeName(self) -> DOMString:
171171
"""The name of this node, depending on its type."""
172-
return self._getNodeName()
172+
return self._get_nodeName()
173173

174174
@property
175175
def nodeValue(self) -> DOMString:
@@ -184,16 +184,16 @@ def nodeValue(self) -> DOMString:
184184
DOMException:
185185
DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a `DOMString` variable on the implementation platform.
186186
"""
187-
return self._getNodeValue()
187+
return self._get_nodeValue()
188188

189189
@nodeValue.setter
190190
def nodeValue(self, value: DOMString) -> None:
191-
self._setNodeValue(value)
191+
self._set_nodeValue(value)
192192

193193
@property
194194
def nodeType(self) -> c_ushort:
195195
"""A code representing the type of the underlying object."""
196-
return self._getNodeType()
196+
return self._get_nodeType()
197197

198198
@property
199199
def parentNode(self) -> Optional[Node]:
@@ -202,7 +202,7 @@ def parentNode(self) -> Optional[Node]:
202202
All nodes, except `Document`, `DocumentFragment`, and `Attr` may have a parent.
203203
However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is `None`.
204204
"""
205-
return self._getParentNode()
205+
return self._get_parentNode()
206206

207207
@property
208208
def childNodes(self) -> NodeList:
@@ -212,42 +212,42 @@ def childNodes(self) -> NodeList:
212212
The content of the returned `NodeList` is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the `NodeList` accessors; it is not a static snapshot of the content of the node.
213213
This is true for every `NodeList`, including the ones returned by the `getElementsByTagName` method.
214214
"""
215-
return self._getChildNodes()
215+
return self._get_childNodes()
216216

217217
@property
218218
def firstChild(self) -> Node:
219219
"""The first child of this node.
220220
221221
If there is no such node, this returns `null`."""
222-
return self._getFirstChild()
222+
return self._get_firstChild()
223223

224224
@property
225225
def lastChild(self) -> Node:
226226
"""The last child of this node.
227227
228228
If there is no such node, this returns `null`."""
229-
return self._getLastChild()
229+
return self._get_lastChild()
230230

231231
@property
232232
def previousSibling(self) -> Node:
233233
"""The node immediately preceding this node.
234234
235235
If there is no such node, this returns `null`."""
236-
return self._getPreviousSibling()
236+
return self._get_previousSibling()
237237

238238
@property
239239
def nextSibling(self) -> Node:
240240
"""The node immediately following this node.
241241
242242
If there is no such node, this returns `None`.
243243
"""
244-
return self._getNextSibling()
244+
return self._get_nextSibling()
245245

246246
@property
247247
def attributes(self) -> NamedNodeMap:
248248
"""A `NamedNodeMap` containing the attributes of this node (if it is an `Element`) or `None` otherwise.
249249
"""
250-
return self._getAttributes()
250+
return self._get_attributes()
251251

252252
@property
253253
def ownerDocument(self) -> Document:
@@ -256,7 +256,7 @@ def ownerDocument(self) -> Document:
256256
This is also the `Document` object used to create new nodes.
257257
When this node is a `Document` this is `None`.
258258
"""
259-
return self._getOwnerDocument()
259+
return self._get_ownerDocument()
260260

261261
def insertBefore(self, newChild: Node, refChild: Node) -> Node:
262262
"""Inserts the node `newChild` before the existing child node `refChild`.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /