|
18 | 18 | from xml.etree.ElementTree import Element, SubElement, Comment, ElementTree
|
19 | 19 |
|
20 | 20 | __license__ = "MIT"
|
21 |
| -__version__ = '2.0.1' |
| 21 | +__version__ = '2.0.2' |
22 | 22 |
|
23 | 23 | # define log output
|
24 | 24 | logging.basicConfig(format='%(levelname)s: %(message)s')
|
@@ -134,15 +134,15 @@ def createFileDesc(config):
|
134 | 134 | editors = config.get('Project', 'editor').splitlines()
|
135 | 135 | for entity in editors:
|
136 | 136 | SubElement(titleStmt, 'editor').text = entity
|
137 |
| - if len(titleStmt.getchildren()) == 1: |
| 137 | + if len(list(titleStmt)) == 1: |
138 | 138 | logging.warning('Editor missing')
|
139 | 139 | SubElement(titleStmt, 'editor')
|
140 | 140 | # publication statement
|
141 | 141 | publicationStmt = SubElement(fileDesc, 'publicationStmt')
|
142 | 142 | publishers = config.get('Project', 'publisher').splitlines()
|
143 | 143 | for entity in publishers:
|
144 | 144 | SubElement(publicationStmt, 'publisher').text = entity
|
145 |
| - if not(publicationStmt.getchildren()): |
| 145 | + if not(list(publicationStmt)): |
146 | 146 | for editor in titleStmt.findall('editor'):
|
147 | 147 | SubElement(publicationStmt, 'publisher').text = editor.text
|
148 | 148 | idno = SubElement(publicationStmt, 'idno')
|
@@ -591,5 +591,6 @@ def processPlace(letter, correspondent):
|
591 | 591 |
|
592 | 592 | try:
|
593 | 593 | tree.write(outFile, encoding="utf-8", xml_declaration=True, method="xml")
|
| 594 | + print('CMI file written to', outFile) |
594 | 595 | except PermissionError:
|
595 | 596 | logging.error('Could not save the file due to insufficient permission')
|
0 commit comments