forked from openlp/openlp
Skip PresentationManager files we do not support.
This commit is contained in:
parent
8f04f587ec
commit
7265065906
@ -54,7 +54,13 @@ class PresentationManagerImport(SongImport):
|
|||||||
# Open file with detected encoding and remove encoding declaration
|
# Open file with detected encoding and remove encoding declaration
|
||||||
text = open(file_path, mode='r', encoding=encoding).read()
|
text = open(file_path, mode='r', encoding=encoding).read()
|
||||||
text = re.sub('.+\?>\n', '', text)
|
text = re.sub('.+\?>\n', '', text)
|
||||||
|
try:
|
||||||
tree = etree.fromstring(text, parser=etree.XMLParser(recover=True))
|
tree = etree.fromstring(text, parser=etree.XMLParser(recover=True))
|
||||||
|
except ValueError:
|
||||||
|
self.log_error(file_path,
|
||||||
|
translate('SongsPlugin.PresentationManagerImport',
|
||||||
|
'File is not in XML-format, which is the only format supported.'))
|
||||||
|
continue
|
||||||
root = objectify.fromstring(etree.tostring(tree))
|
root = objectify.fromstring(etree.tostring(tree))
|
||||||
self.process_song(root)
|
self.process_song(root)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user