Skip to content

Commit f082857

Browse files
precommitted base_types.py file
1 parent d4862bb commit f082857

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/modelspec/base_types.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,8 @@ def to_xml(self) -> str:
126126
build_xml_element(root, self.to_dict())
127127

128128
xml_string = ET.tostring(
129-
root,
130-
encoding="utf-8",
131-
xml_declaration=False,
132-
method="xml"
133-
).decode("utf-8")
129+
root, encoding="utf-8", xml_declaration=False, method="xml"
130+
).decode("utf-8")
134131

135132
parsed_xml = xml.dom.minidom.parseString(xml_string)
136133
pretty_xml = parsed_xml.toprettyxml(indent=" " * 4)
@@ -284,11 +281,7 @@ def to_xml_file(
284281
tree = ET.ElementTree(root)
285282

286283
# Generate the XML string
287-
xml_str = ET.tostring(
288-
root,
289-
encoding="utf-8",
290-
method="xml"
291-
).decode("utf-8")
284+
xml_str = ET.tostring(root, encoding="utf-8", method="xml").decode("utf-8")
292285

293286
# Create a pretty-formatted XML string using minidom
294287
parsed_xml = xml.dom.minidom.parseString(xml_str)
@@ -300,7 +293,6 @@ def to_xml_file(
300293

301294
return filename
302295

303-
304296
@classmethod
305297
def from_file(cls, filename: str) -> "Base":
306298
"""

0 commit comments

Comments
 (0)