Skip to content

Commit

Permalink
add string method to class
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Jan 28, 2025
1 parent 047a253 commit 0cbb522
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion csv2cmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from secrets import token_hex
from typing import Optional
from uuid import UUID
from xml.etree.ElementTree import Comment, Element, ElementTree, SubElement
from xml.etree.ElementTree import Comment, Element, ElementTree, SubElement, tostring

__license__ = "MIT"
__version__ = "3.0.0-alpha"
Expand Down Expand Up @@ -115,6 +115,9 @@ def __init__(self):
tei_body = SubElement(text, "body")
SubElement(tei_body, "p")

def __str__(self) -> str:
return tostring(self.cmi, method="xml").decode("utf-8")

def create_file_desc(self, project: configparser) -> None:
"""Create a TEI file description from config file."""
# title statement
Expand Down

0 comments on commit 0cbb522

Please sign in to comment.