MCPcopy
hub / github.com/django/django / finalize

Method finalize

django/test/html.py:92–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 self.children.append(element)
91
92 def finalize(self):
93 def rstrip_last_element(children):
94 if children and isinstance(children[-1], str):
95 children[-1] = children[-1].rstrip()
96 if not children[-1]:
97 children.pop()
98 children = rstrip_last_element(children)
99 return children
100
101 rstrip_last_element(self.children)
102 for i, child in enumerate(self.children):
103 if isinstance(child, str):
104 self.children[i] = child.strip()
105 elif hasattr(child, "finalize"):
106 child.finalize()
107
108 def __eq__(self, element):
109 if not hasattr(element, "name") or self.name != element.name:

Callers 1

parse_htmlFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected