Return an element loaded from the XML in the template file identified by `template_name`.
(template_file_name: str)
| 23 | |
| 24 | |
| 25 | def parse_from_template(template_file_name: str): |
| 26 | """Return an element loaded from the XML in the template file identified by `template_name`.""" |
| 27 | thisdir = os.path.split(__file__)[0] |
| 28 | filename = os.path.join(thisdir, "..", "templates", "%s.xml" % template_file_name) |
| 29 | with open(filename, "rb") as f: |
| 30 | xml = f.read() |
| 31 | return parse_xml(xml) |
| 32 | |
| 33 | |
| 34 | def parse_xml(xml: str | bytes): |
no test coverage detected
searching dependent graphs…