Add a print to assist with debugging

This commit is contained in:
Raoul Snyman 2019-03-26 14:14:33 -07:00
parent cdc3d68a2c
commit ce8996c8b9
1 changed files with 2 additions and 6 deletions

View File

@ -51,6 +51,7 @@ class PresentationManagerImport(SongImport):
encoding = get_file_encoding(file_path)['encoding']
# Open file with detected encoding and remove encoding declaration
text = file_path.read_text(encoding=encoding)
print(text)
text = re.sub(r'.+\?>\n', '', text)
try:
tree = etree.fromstring(text, parser=etree.XMLParser(recover=True))
@ -59,12 +60,7 @@ class PresentationManagerImport(SongImport):
translate('SongsPlugin.PresentationManagerImport',
'File is not in XML-format, which is the only format supported.'))
continue
xml = etree.tostring(tree)
if tree.docinfo.encoding.lower() != 'unicode':
# If the XML string is a bytes object, lxml sometimes croaks
xml = xml.decode(tree.docinfo.encoding)
print(xml)
root = objectify.fromstring(xml)
root = objectify.fromstring(etree.tostring(tree))
self.process_song(root, file_path)
def _get_attr(self, elem, name):