MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / replaceWith

Method replaceWith

thirdparty/beautifulsoup/beautifulsoup.py:164–177  ·  view source on GitHub ↗
(self, replaceWith)

Source from the content-addressed store, hash-verified

162 self.previousSibling.nextSibling = self
163
164 def replaceWith(self, replaceWith):
165 oldParent = self.parent
166 myIndex = self.parent.index(self)
167 if hasattr(replaceWith, "parent")\
168 and replaceWith.parent is self.parent:
169 # We're replacing this element with one of its siblings.
170 index = replaceWith.parent.index(replaceWith)
171 if index and index < myIndex:
172 # Furthermore, it comes before this element. That
173 # means that when we extract it, the index of this
174 # element will change.
175 myIndex = myIndex - 1
176 self.extract()
177 oldParent.insert(myIndex, replaceWith)
178
179 def replaceWithChildren(self):
180 myParent = self.parent

Callers

nothing calls this directly

Calls 3

extractMethod · 0.95
indexMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected